Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
HACK Mount LVM Partitions #80 See Also · The mdadm documentation: /usr/share/doc/mdadm/ directory on your Knoppix disk. · The mdadm manpage (type man mdadm in a console). H A C K Mount LVM Partitions It only takes a few extra steps to rescue data stored on an LVM partition. Hack #80 #80 There are a number of distributions these days that make use of Logical Vol- ume Management (LVM) to provide you with all sorts of useful features such as snapshots and the ability to more easily expand your storage. The Fedora distribution, for instance, even defaults to using LVM. One down- side to LVM partitions are that they require a few extra steps when you want to access them from a rescue CD. Luckily Knoppix has all of the tools you need to mount your LVM partitions and can set them up in only a few steps. First, boot your system into Knoppix and open a terminal. To mount the LVM, you need to have a copy of the configuration file for that LVM. Of course, it is likely to be stored on the partition you are trying to mount, so how do you get it? Multiple copies of the LVM configuration are stored near the beginning of each LVM partition, so once we have identified the LVM partitions, we can then grab the configuration from them. Use fdisk to iden- tify all of the LVM partitions on the system: $ sudo fdisk -l Disk /dev/hda: 255 heads, 63 sectors, 1044 cylinders Units = cylinders of 16065 * 512 bytes Device Boot /dev/hda1 * /dev/hda2 Start 1 14 End 13 1044 Blocks 104391 8281507+ Id 83 8e System Linux Linux LVM In this example, I have a default Fedora install that has only created a single LVM partition, /dev/hda2. If your LVM partition spans multiple disks, then you will need to first assemble your array before you can grab the configura- tion. Load the md module, then use mdadm to scan the available disks in your system for any RAID arrays and output the results into Knoppix's mdadm configuration file. Finally, start the array: $ sudo modprobe md $ sudo mdadm --examine --scan >> /etc/mdadm/mdadm.conf $ sudo mdadm --assemble --auto=yes /dev/md0 /dev/sd[ab]1 Here I'm assembling the array /dev/md0 from /dev/sda1 and /dev/sdb1. Change these values to reflect the partitions used in your LVM. Chapter 6, Repair Linux | 237