Jackson Fox’s Weblog

Interaction designer, student, and all around web geek

Jackson Fox’s Weblog random header image

Recovering Data From an LVM Volume

October 12th, 2008 · No Comments

Recently my Fedora Linux desktop had some kind of mysterious brain fart, the result of which was kernel panic on boot. Since the machine is a bit long in the tooth (circa 2003), I wasn’t really too upset. I grabbed the drive out of the box, connected it to the magic USB cable, and plugged it into my laptop. I was… horrified… yes, horrified is a good word, to find no browseable partitions. Suddenly, I was faced with the fairly real possibility of losing the vast majority of the personal digital junk I’d accumulated over the last 20 odd years.

A little poking around revealed that the disk had been setup (by the Fedora installer I assume) as an LVM volume. This meant that I couldn’t browse or mount the volume without LVM2 installed, and thus began my quest to learn how to read the stupid thing and recover whatever I could from the disk.

First I tried to recover the partition from an Ubuntu LiveCD, but in the end grabbed a spare drive, installed Ubuntu, then stuck the busted drive in as a secondary. Then I had to figure out the magic words to make the Ubuntu box mount the LVM partition.

  1. Install LVM2
    # sudo aptitude install lvm2
  2. Reboot, and then double check that the necessary kernel module is loaded
    # sudo modprobe dm-mod
  3. Find all of the volumes available, you’re looking for the name of the volume
    # sudo pvs
    PV         VG         Fmt  Attr PSize  PFree
    /dev/hdb2  VolGroup00 lvm2 a-   74.41G 32.00M
  4. Get the details on the volume, using the volume group name pvs spit out. We’re looking for the biggest logical volume (LV) in the volume group.
    # sudo lvdisplay /dev/VolGroup00
    --- Logical volume ---
    LV Name                /dev/VolGroup00/LogVol00
    VG Name                VolGroup00
    LV UUID                mD1CI2-X3yf-2ORa-d0mY-i70k-Q1BW-gw8hSH
    LV Write Access        read/write
    LV Status              available
    # open                 0
    LV Size                73.38 GB
    Current LE             2348
    Segments               1
    Allocation             inherit
    Read ahead sectors     0
    Block device           254:0
    
    --- Logical volume ---
    LV Name                /dev/VolGroup00/LogVol01
    VG Name                VolGroup00
    LV UUID                vy2MW1-NlTl-IXne-T96V-zcmo-ezV2-0KMQsW
    LV Write Access        read/write
    LV Status              available
    # open                 0
    LV Size                1.00 GB
    Current LE             32
    Segments               1
    Allocation             inherit
    Read ahead sectors     0
    Block device           254:1
  5. Mount the offending volume, referencing it as VolumeGroup-LogicalVolume
    # sudo mount /dev/mapper/VolGroup00-LogVol00

Hopefully this info will help some other poor sap like myself avoid the hours and hours of experimenting I had to go through to get access to my data.

Tags: Weblog

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment