Red Hat Bugzilla – Bug 720684
Booting with snapshot of / requires non user-friendly config
Last modified: 2014-03-31 19:46:25 EDT
Bug 602793 suggests that it's possible to boot with snapshot of / (root) mounted as / (root). So I have: [root@hogofogo ~]# lvs LV VG Attr LSize Origin Snap% root_rhel6 vg_hogofogo owi-a- 10.00g root_rhel6_ati vg_hogofogo swi-ao 5.00g root_rhel6 0.21 swap vg_hogofogo -wi-ao 2.00g I did the change in grub, to point to the snapshot: kernel /vmlinuz-2.6.32-166.el6.x86_64 ro root=/dev/mapper/vg_hogofogo-root_rhel6_ati rd_LVM_LV=vg_hogofogo/root_rhel6_ati rd_LVM_LV=vg_hogofogo/swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us But that doesn't work. Root is not found. Reading more in bug 602793 I tried settings rd_LVM_LV to the original volume, not the snapshot. That did the trick. But it's not something user friendly that I could have just edited. I suggest dracut tries to activate the original volume when it attemps to activate the snapshot (which doesn't work). Or perhaps this would be better done in LVM? Or in the worst case (least preferred) at least print a proper error message. [root@hogofogo ~]# rpm -q kernel dracut kernel-2.6.32-166.el6.x86_64 dracut-004-53.el6.noarch
bug 602793 ???
Ooops, temporary brain outage / finger malfunction. I meant bug 602723 / bug 602649. Sorry for the confusion.
https://bugzilla.redhat.com/show_bug.cgi?id=602649#c3 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" nothing I can do about...
Could perhaps dracut query LVM and figure out that we're trying to boot from snapshot, and request activating the original volume (+all snapshots)? Or could this logic be pushed to LVM? Are there any downsides to activating the original volume + all snapshots during boot?
Since RHEL 6.2 External Beta has begun, and this bug remains unresolved, it has been rejected as it is not proposed as exception or blocker. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux.
reassigning to lvm2 to get some comments here.
Since version 2.02.89 lvm2 is able to activate snapshots automatically with its origin (giving you a question). If you want proceed with [y] answer - use command like this: lvchange -ay --yes vg/snapshot_lv
So I think this is just about adding the "--yes" option to the lvchange command in dracut, reassigning back... Harald, would you add the "--yes" to the lvchange you use in dracut, please? Note that this will activate the origin as well as all other existing snapshots, but I don't see any problem with that except if there are numerous volumes/snapshots, it'll take a bit more time to activate of course.
will do
First alpha build for testing: http://people.redhat.com/harald/downloads/dracut/dracut-004-316.el6/ Would be nice, if you could test it.
[root@rhevh-x3650-01-g1 ~]# lvs LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert lv_root vg_test -wi-ao---- 9.78g [root@rhevh-x3650-01-g1 ~]# lvcreate -s /dev/mapper/vg_test-lv_root -l 100%ORIGIN -n lv_root_snapshot Logical volume "lv_root_snapshot" created [root@rhevh-x3650-01-g1 ~]# sed s/lv_root/lv_root_snapshot/g -i /boot/grub/grub.conf [root@rhevh-x3650-01-g1 ~]# sed s/lv_root/lv_root_snapshot/g -i /etc/fstab [root@rhevh-x3650-01-g1 ~]# reboot During boot: ... dracut: inactive Original '/dev/vg_test/lv_root' [9.78 GiB] inherit dracut: inactive Snapshot '/dev/vg_test/lv_root_snapshot' [9.78 GiB] inherit EXT4-fs (dm-3): mounted filesystem with ordered data mode. Opts: dracut: Mounted root filesystem /dev/mapper/vg_test-lv_root_snapshot ... After login: [root@rhevh-x3650-01-g1 ~]# mount | grep ' / ' /dev/mapper/vg_test-lv_root_snapshot on / type ext4 (rw) [root@rhevh-x3650-01-g1 ~]# lvs LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert lv_root vg_test owi-a-s--- 9.78g lv_root_snapshot vg_test swi-aos--- 9.78g lv_root 0.03 [root@rhevh-x3650-01-g1 ~]# rpm -q dracut dracut-004-335.el6.noarch [root@rhevh-x3650-01-g1 ~]# Moving to VERIFIED.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2013-1674.html