Tuesday, August 1, 2017

Moving a LVM disk between systems

Say you have a LVM volume mounted on system A that you need to move to system B, you first have to umount it from A:
# umount /path-to-volume
Then either power down and remove the physical disk or if it's hot-pluggable, detach that device before moving it to sysetm B. Once it's installed on B:
# mkdir /new-path-to-volume
Look for your volume and its device path, for example
# lvscan
  inactive            '/dev/myvolume-volgroup/myvolume_logical_volume' [223.00 GiB] inherit
It will most likely be 'inactive', you need to activate it:
# vgchange -ay
# lvscan
  ACTIVE            '/dev/myvolume-volgroup/myvolume_logical_volume' [223.00 GiB] inherit
Add an entry to /etc/fstab:
/dev/myvolume-volgroup/myvolume_logical_volume   /new-path-to-volume       brtfs    discard,noatime 0       0
And mount it !
# mount -a

No comments:

Post a Comment