I have three logical volumes in a single volume group using a single physical volume (the whole existing disk /dev/sda).
I now want to move one of those logical volumes to a new, faster disk, i.e., going from:
/dev/sda
|-vg0-root → mounted to /
|-vg0-foo → mounted to /foo
|-vg0-bar → mounted to /bar
to:
/dev/sda
|-vg0-root → mounted to /
|-vg0-foo → mounted to /foo
/dev/sdb
|-vg1-bar → mounted to /bar
From what I understand I cannot use pvmove
or vgsplit
because there's only one physical volume in the existing volume group.
What's a good approach to achieve this (preferably online, creating a new volume group for the new disk is not a requirement)?
Best Answer
One volume group solution:
Two volume group solution:
Now difficult part, all activities MUST stop on
/bar
:where
pvcreate
erase all data on disk (and prepare for LVM)lvcreate
sould create a logical volume lvol1, you specify lv name with-n bar
/dev/mapper/myvg-mylv
syntaxOnce you have verified data are OK, in new place:
/bar
/etc/fstab
to use new/bar