LVM allows you to hot add devices to expand volume space. It also allows you to hot remove devices, as long as there are enough free extents in the volume group (vgdisplay) to move data around. Here I’m going to replace a 400 GB drive (sdg) with a 750 GB one (sdf) from logical volume “backup” on volume group “disks”. It does not matter how many hard drives are in the volume group, and the filesystem can stay mounted.
$ sudo pvcreate /dev/sdh1
$ sudo vgextend disks /dev/sdh1
$ sudo pvmove /dev/sdg1
$ sudo vgreduce disks /dev/sdg1
$ sudo lvextend -l+83463 /dev/disks/backup
$ sudo resize2fs /dev/disks/backup
Copyright ©2005-2007 Nicholas Brand. All rights reserved.
powered by WordPress.
20 queries. 0.129 seconds