Bug 602649 - Add support for booting LVM snapshot root volume
Summary: Add support for booting LVM snapshot root volume
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dracut
Version: 13
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords:
Depends On:
Blocks: 602723
TreeView+ depends on / blocked
 
Reported: 2010-06-10 12:04 UTC by James Laska
Modified: 2013-09-02 06:49 UTC (History)
4 users (show)

(edit)
Clone Of:
: 602723 (view as bug list)
(edit)
Last Closed: 2010-10-27 22:55:03 UTC


Attachments (Terms of Use)

Description James Laska 2010-06-10 12:04:15 UTC
Description of problem:


Version-Release number of selected component (if applicable):
 * dracut-005-3.fc13.noarch

How reproducible:


Steps to Reproduce:
1. lvcreate -s -n lv_snap -L 9G /dev/vg_test1055/lv_root
2. sed -i 's|lv_root|lv_snap|g' /etc/grub.conf /etc/fstab
3. reboot
  
Actual results:

No root device found
+ source_all emergency
+ local f
+ [ emergency ]
+ [ -d /emergency ]
+ [ -e /emergency/50plymouth-emergency.sh ]
+ . /emergency/50plymouth-emergency.sh
+ [ -x /bin/plymouth ]
+ /bin/plymouth --hide-splash
+ echo

+ getarg rdshell
+ set +x
+ return 0
+ echo Dropping to debug shell.
Dropping to debug shell.
+ echo

+ export PS1=dracut:${PWD}# 
+ [ -e /.profile ]
+ echo exec 0<>/dev/console 1<>/dev/console 2<>/dev/console
+ sh -i -l
sh: can't access tty; job control turned off

dracut:/# lvm lvs
File descriptor 9 (/.console_lock) leaked on lvm invocation. Parent PID 853: sh
  LV      VG          Attr   LSize Origin  Snap%  Move Log Copy%  Convert
  lv_root vg_test1055 owi--- 8.81g                                       
  lv_snap vg_test1055 swi--- 9.00g lv_root                               
  lv_swap vg_test1055 -wi-a- 1.00g                                       

dracut:/# lvm vgscan
File descriptor 9 (/.console_lock) leaked on lvm invocation. Parent PID 853: sh
  Reading all physical volumes.  This may take a while...
  Found volume group "vg_test1055" using metadata type lvm2

dracut:/# lvm vgchange -ay
File descriptor 9 (/.console_lock) leaked on lvm invocation. Parent PID 853: sh
  vg_test1055-lv_snap: event registration failed: 856:3 libdevmapper-event-lvm2snapshot.so dlopen failed: libdevmapper-event-lvm2snapshot.so: cannot open shared object file: No such file or directory
  vg_test1055/snapshot0: snapshot segment monitoring function failed.
  3 logical volume(s) in volume group "vg_test1055" now active


Expected results:

 * dracut is able to find and use a LVM snapshot as the root volume

Additional info:
 # cat /proc/cmdline
ro root=/dev/mapper/vg_test1055-lv_snap rd_LVM_LV=vg_test1055/lv_snap rd_LVM_LV=vg_test1055/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us console=ttyS0 rdshell rdinitdebug

 * Harald already has a patch to address the missing library libdevmapper-event-lvm2snapshot.so.  See http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=commitdiff;h=edcd2c5eb7a455e9a606153bdbe2e9a4b8774a9c

Comment 1 James Laska 2010-06-10 12:23:27 UTC
Additional info:
 * Using the patch noted in comment#0, and rebuilding the dracut ramdisk addresses the missing library
 * I then needed to remove all rd_LVM_LV= values from the boot command-line, then dracut is able to find and use the lvm snapshot as the root volume

Comment 2 James Laska 2010-06-10 13:04:06 UTC
(In reply to comment #1)
>  * I then needed to remove all rd_LVM_LV= values from the boot command-line,
> then dracut is able to find and use the lvm snapshot as the root volume    

Still investigating why 'lvm vgchange -ay' WORKS, but 'lvm lvchange -ay /dev/vg_test1055/lv_snap' FAILS when attempting to mount the root device...

Comment 3 James Laska 2010-06-10 14:54:34 UTC
(In reply to comment #2)
> (In reply to comment #1)
> >  * I then needed to remove all rd_LVM_LV= values from the boot command-line,
> > then dracut is able to find and use the lvm snapshot as the root volume    
> 
> Still investigating why 'lvm vgchange -ay' WORKS, but 'lvm lvchange -ay
> /dev/vg_test1055/lv_snap' FAILS when attempting to mount the root device...    

According to prajnoha@redhat.com, the 'lvchange' command does not support a snapshot as an argument.  

"Instead, you need to run lvchange -ay /dev/vg/origin_lv which will activate *both* origin_lv and snap_lv.  Because of the way snapshots work, it is necessary always to have all snapshots+origin active together, or none of them active.  You can't pick and choose which"

To summarize, to get LVM snapshot root volume working:
 1. I applied the patch noted in comment#0
 2. I rebuild the initramfs
 3. Create a snapshot volume: lvcreate -s -n lv_snap -L9G /dev/vg_test1055/lv_root
 4. Update grub.conf and set root=/dev/vg_test1055/lv_snap 
 5. Update fstab to use /dev/vg_test1055/lv_snap 
 6. Reboot

Comment 4 Fedora Update System 2010-09-23 15:31:42 UTC
dracut-005-4.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/dracut-005-4.fc13

Comment 5 Fedora Update System 2010-09-23 15:33:04 UTC
dracut-005-4.fc12 has been submitted as an update for Fedora 12.
https://admin.fedoraproject.org/updates/dracut-005-4.fc12

Comment 6 Fedora Update System 2010-09-24 20:38:44 UTC
dracut-005-4.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update dracut'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/dracut-005-4.fc12

Comment 7 Fedora Update System 2010-10-27 22:53:38 UTC
dracut-005-5.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2010-10-30 23:38:14 UTC
dracut-005-5.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.