Wednesday, April 29, 2009
How to mount an LVM partition on another system
I ran into a Fedora Core 3 box recently which after rebooting was unable to mount the root filesystem. Here's what I did to get this going:
First I booted off the Fedora CD and typed "linux rescue" at the prompt in order to boot into rescue mode. When asked if I would like to enable the network interfaces or mount the filesystems, I said no to both.
If you are running a different Linux distro or don't have the Fedora CD, I'm pretty sure you can use a different Linux bootable CD like Knoppix and then just install the LVM tools (How to install LVM tools on Knoppix) and use that instead.
So, once you're at the command prompt, you need to activate the LVM partitions so they can be used. This can be done using the following command:
lvm vgchange --ignorelockingfailure -P -a y
The -P will make logical volumes which are missing one of their disks available too.
This should create the device entries for these logical volumes. You can find out what the name of the logical volumes are by typing:
lvm lvs
This should give you output showing the name of the Volume Group and the name of the Logical Volume. The device entry should be created in /dev/
You can now mount or fsck or whatever you need to do. If you wanted to check/repair the filesystem you could run:
fsck /dev/VolGroup00/LogVol00
If you wanted to mount the filesystem you could run:
mkdir /volmount
mount /dev/VolGroup00/LogVol00 /volmount
And that's it, you now have access to your logical volume on another system. Please leave any comments or corrections using the comment form below.