Can't mount snapshotted LVM partition in LiveCD command line

A while back, I installed OpenSUSE 10.3 on my hard disk in an LVM Volume Group.

The installation DVD set I got included a bootable DVD that allowed the 32-bit Live version of OpenSUSE 10.3 to booted from grub. I thought that having such a Live set up would be useful because if OpenSUSE 10.3 failed to boot then I could boot the Live DVD and then mount LVM logical volumes/partitions in the Volume Group so that I could investigate.

However, after loading in the Device Mapper kernel module (dm-mod), which LVM requires, I get the following:


linux:/home/linux # lvs
  LV                  VG   Attr   LSize   Origin     Snap%  Move Log Copy% 
  lv_home             vg01 owi--- 200.00G                                  
  lv_home_snapshot    vg01 sri--- 162.50G lv_home                          
  lv_root             vg01 owi---  16.00G                                  
  lv_root_snapshot    vg01 sri---  16.00G lv_root                          
  lv_swap             vg01 -wi---   8.00G                                  
  lv_tmp              vg01 owi---  16.00G                                  
  lv_tmp_snapshot     vg01 sri---  16.00G lv_tmp                           
  lv_usr              vg01 owi---  16.00G                                  
  lv_usr_snapshot     vg01 sri---  16.00G lv_usr                           
  lv_var              vg01 owi---  16.00G                                  
  lv_var_log          vg01 owi---   8.00G                                  
  lv_var_log_snapshot vg01 sri---   8.00G lv_var_log                       
  lv_var_snapshot     vg01 sri---  16.00G lv_var                           
linux:/home/linux # vgchange -a y vg01
  Can't expand LV lv_home_snapshot: snapshot target support missing from kernel?
  Can't expand LV lv_root_snapshot: snapshot target support missing from kernel?
  Can't expand LV lv_tmp_snapshot: snapshot target support missing from kernel?
  Can't expand LV lv_usr_snapshot: snapshot target support missing from kernel?
  Can't expand LV lv_var_snapshot: snapshot target support missing from kernel?
  Can't expand LV lv_var_log_snapshot: snapshot target support missing from kernel?
  1 logical volume(s) in volume group "vg01" now active
linux:/home/linux # 
linux:/home/linux # ll /dev/vg01
total 0
lrwxrwxrwx 1 root root 24 Mar 29 23:24 lv_swap -> /dev/mapper/vg01-lv_swap
linux:/home/linux # 

So, the only logical volume/partition I can mount is the swap partition.

The question is how do I adapt the bootable OpenSUSE DVD I have so that I can create one that can mount the snapshotted Logical Volumes?

I started looking at seeing how suitable the kernel on my main PC would be for creating a Live CD. That is, did it have device mapper already inside the kernel:


opensuse:~ # lsmod | grep dm
dm_snapshot            34120  2 
dm_mod                 77152  52 dm_snapshot
opensuse:~ # 

So, not only does the main Device Mapper module need to be loaded but also the Snapshot Device Mapper module (dm-snapshot), if you want snapshot Logical Volumes to be handled.

So I booted my Live DVD and then did “modprobe dm-snapshot” (if I remember correctly). This loaded both dm-snapshot and dm-mod (due to dm-snapshot’s dependency on dm-mod). I was then able to mount ALL my Logical Volumes/partitions successfully.