Wednesday, May 8, 2013

Adding drives to LVM and resizing volume

/dev/sdg1, /dev/sdf1 are 1.5TB drives. /dev/sdf1 is full, /dev/sdg1 is almost full. Move a bunch of stuff off of /dev/sdg1, resize it, make a partiton, add it to the lvm pool, move more stuff off...

Resize /dev/sdg1 to the minimum partition size:
resize2fs -M /dev/sdg1

Make the new partition from free space:
cfdisk /dev/sdg1

Add it to the pool:
pvcreate /dev/sdg2
vgextend /dev/sdg2
lvextend -l 100%vg /dev/vg/media

Increase the pool partition size to maximum:
resize2fs /dev/vg/media

No comments: