One volume group solution:
One volume group solution:
pvcreate /dev/sdb
vgextend vg0 /dev/sdb
pvmove -n /dev/vg0/bar /dev/sda /dev/sdb
Two volume group solution:Be aware the pvmove command can take a long time depending on the size of your disk.
Two volume group solution:
pvcreate /dev/sdb
vgcreate vg1 /dev/sdb
lvcreate -l100%FREE vg1
mkfs -t ext4 /dev/vg1/lvol1
mount /dev/vg1/lvol1 /mnt
Now difficult part, all activities MUST stop on /bar:
cd /mnt ; ( cd /bar ; tar cf - * ) | tar xf -
cd /
umount /mnt
mount /dev/vg1/lvol1 /bar
where
pvcreateerase all data on disk (and prepare for LVM)lvcreatesouldshould create a logical volume lvol1, you specify lv name with-n bar- I use HP-UX syntax for lv, you might have to use
/dev/mapper/myvg-mylvsyntax
Once you have verified data are OK, in new place:
- you can safely delete old
/bar - edit
/etc/fstabto use new/bar