Monday, June 15, 2009

How to mount an LVM partition

This details the commands I had to run to mount a CentOS 5.1 main disk into another machine. Because of LVM using mount on standard scsi partitions is not enough.

Assuming main physical disk: /dev/sda
Second physical disk: /dev/sdb
  1. Run pvscan to list the physical volumes found in any block device of the system. Among error lines this returned PV lines for /dev/sda2 and /dev/sdb2. On the same line was the name of the volume group, in my case 'sysvg'
  2. Made the 'sysvg' volume group active by typing lvchange -ay sysvg. This created a new entry in the /dev/sysvg
  3. Doing an ls /dev/sysvg showed the different volumes under that volume group, from there simply had to do: mount /dev/sysvg/root.vol /mnt
  4. When done: umount /mnt && lvchange -an sysvg

1 comment:

Andrew Antle said...

Thanks Sylvain -

This really helped me out just now, mounting a logical volume from a fedora install. :)

Cheers,
Andrew