RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 720684 - Booting with snapshot of / requires non user-friendly config
Summary: Booting with snapshot of / requires non user-friendly config
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: dracut
Version: 6.1
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Harald Hoyer
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-12 13:32 UTC by David Kovalsky
Modified: 2014-03-31 23:46 UTC (History)
14 users (show)

Fixed In Version: dracut-004-322.el6
Doc Type: Bug Fix
Doc Text:
Cause: dracut does not call "lvchange" with the "--yes" option. Consequence: Booting an LVM snapshot required adding rd_LVM_LV of the original volume, which is counter intuitive. Fix: dracut calls "lvchange" with the "--yes" option. Result: Booting an LVM snapshot does not require adding rd_LVM_LV of the original volume anymore.
Clone Of:
Environment:
Last Closed: 2013-11-21 21:53:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:1674 0 normal SHIPPED_LIVE Moderate: dracut security, bug fix, and enhancement update 2013-11-20 21:52:47 UTC

Description David Kovalsky 2011-07-12 13:32:13 UTC
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

Comment 1 Harald Hoyer 2011-07-15 08:00:43 UTC
bug 602793 ???

Comment 2 David Kovalsky 2011-07-18 09:26:35 UTC
Ooops, temporary brain outage / finger malfunction.

I meant bug 602723 / bug 602649. Sorry for the confusion.

Comment 3 Harald Hoyer 2011-07-18 10:03:08 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=602649#c3

According to prajnoha, 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...

Comment 4 David Kovalsky 2011-07-18 11:09:45 UTC
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?

Comment 5 Suzanne Logcher 2011-10-06 18:42:09 UTC
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.

Comment 6 Harald Hoyer 2012-07-04 12:18:17 UTC
reassigning to lvm2 to get some comments here.

Comment 7 Zdenek Kabelac 2012-10-19 07:56:17 UTC
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

Comment 8 Peter Rajnoha 2012-11-28 10:20:08 UTC
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.

Comment 9 Harald Hoyer 2012-11-28 10:52:54 UTC
will do

Comment 15 Harald Hoyer 2013-07-18 13:54:28 UTC
First alpha build for testing:
http://people.redhat.com/harald/downloads/dracut/dracut-004-316.el6/

Would be nice, if you could test it.

Comment 17 Jan Stodola 2013-10-18 10:18:56 UTC
[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.

Comment 18 errata-xmlrpc 2013-11-21 21:53:44 UTC
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


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