Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

When my host set up my server they partitioned the drives in a strange way. I have the following two file systems.

/dev/mapper/vg_norecordset-lv_root
/dev/mapper/vg_norecordset-lv_home

Unfortunately for me ...root is only 50GB and is 100% full. ...home still has a ton of space left. The problem is that /var/spool/postfix/ is located in ...root and I can't send nor receive any mails.

I think i have two options now. Move the location of postfix to the other filesystem -or- increase the size of the root partition at the cost of the home partition.

I have no idea how to do either.

fdisk -l output:


Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0009294e

Device Boot Start End Blocks Id System /dev/sda1 * 1 64 512000 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 64 243202 1953001472 8e Linux LVM

Disk /dev/mapper/vg_norecordset-lv_root: 53.7 GB, 53687091200 bytes 255 heads, 63 sectors/track, 6527 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x00000000

Disk /dev/mapper/vg_norecordset-lv_swap: 4143 MB, 4143972352 bytes 255 heads, 63 sectors/track, 503 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x00000000

Disk /dev/mapper/vg_norecordset-lv_home: 1942.0 GB, 1942038249472 bytes 255 heads, 63 sectors/track, 236106 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x00000000

pvs && vgs && lvs output:


  PV         VG             Fmt  Attr PSize PFree
  /dev/sda2  vg_norecordset lvm2 a--  1.82t    0
  VG             #PV #LV #SN Attr   VSize VFree
  vg_norecordset   1   3   0 wz--n- 1.82t    0
  LV      VG             Attr     LSize  Pool Origin Data%  Move Log Copy%  Convert
  lv_home vg_norecordset -wi-ao--  1.77t
  lv_root vg_norecordset -wi-ao-- 50.00g
  lv_swap vg_norecordset -wi-ao--  3.86g

share|improve this question
    
Could you please add the output of fdisk -l, pvs && vgs && lvs to your question? –  dawud Mar 20 at 20:45
    
@dawud I appended the information you requested to my question –  Ortix92 Mar 21 at 14:25

1 Answer 1

If downtime is permissible AND you have physical access AND you have a backup or don't care if this eats your data:

  • reboot into single user mode (or just do telinit 1 from a shell as root)
  • umount /home
  • do resize2fs /dev/mapper/vg_norecordset-lv_home , Make sure this is big enough to hold all your data!!!
  • i.e. resize2fs /dev/mapper/vg_norecordset-lv_home 20g
  • You'll be asked to do a full fsck
  • do lvresize --size /dev/mapper/vg_norecordset-lv_home
  • i.e. lvresize --size 21g /dev/mapper/vg_norecordset-lv_home
  • do resize2fs again without a size
  • resize2fs /dev/mapper/vg_norecordset-lv_home
  • mount /dev/mapper/vg_norecordset-lv_home
  • you'll be asked to fsck again

This should work but its from memory. I've had to do this a bunch of times but not for a little while.

HTH

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.