Bug 611445

Summary: [TRACKER] What's the default behavior of LVM snapshot root?
Product: Red Hat Enterprise Linux 6 Reporter: Alexander Todorov <atodorov>
Component: dracutAssignee: Harald Hoyer <harald>
Status: CLOSED NOTABUG QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: jstodola, pknirsch, prajnoha
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-07-07 14:35:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alexander Todorov 2010-07-05 10:19:35 UTC
Description of problem:
With this bug as a tracker I'd like to know what will be default behavior of the feature where root filesystem is on LVM snapshot volume (see bug #602723). 

In particular:
https://bugzilla.redhat.com/show_bug.cgi?id=602723#c6

> 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 

I believe you have to update the fstab which is on the lv_snap not on lv_root.


I've tried this:

1) After creating lv_snap and while lv_root was mounted I've updated grub.conf (which is on /boot) and fstab which is on lv_root. Follow the above steps in the exact same order. 

The fstab now points to lv_snap. I've touched the file /root/original-root to distinguish between volumes. 

2) Rebooted the system where root=lv_snap. There was no dracut error but mount showed that lv_root was mounted. This is OK since fstab specified this, I haven't updated it. /root/original-root wasn't there though. 

3) Then I've rebooted with root=lv_root on the command line and mount showed that lv_snap was mounted but original-root file was there. At this point I was confused. 

4) I've fixed fstab files on both volumes to specify the correct volume as root file system and rebooted few more times. All appeared to be working fine and mount was now showing the correct volumes as root file sytem. 



With this bug I need to understand the following:
1) How root file system on LVM snapshot should work - this is not documented in Deployment Guide nor in the LVM Administrators Guide so it has to be. 

2) Based on 1) file a RFE for a tool that will make changes to the required config files so that this feature is less confusing.

Comment 1 Harald Hoyer 2010-07-05 10:44:35 UTC
(In reply to comment #0)
> Description of problem:
> With this bug as a tracker I'd like to know what will be default behavior of
> the feature where root filesystem is on LVM snapshot volume (see bug #602723). 
> 
> In particular:
> https://bugzilla.redhat.com/show_bug.cgi?id=602723#c6
> 
> > 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 
> 
> I believe you have to update the fstab which is on the lv_snap not on lv_root.
> 
> 
> I've tried this:
> 
> 1) After creating lv_snap and while lv_root was mounted I've updated grub.conf
> (which is on /boot) and fstab which is on lv_root. Follow the above steps in
> the exact same order. 
> 
> The fstab now points to lv_snap. I've touched the file /root/original-root to
> distinguish between volumes. 
> 
> 2) Rebooted the system where root=lv_snap. There was no dracut error but mount
> showed that lv_root was mounted. This is OK since fstab specified this, I
> haven't updated it. /root/original-root wasn't there though. 

this is expected, because "mount" outputs mtab, which does not really reflect the current state for root, because mtab could not be modified by mount, because root was mounted read-only... better check /proc/mounts or /proc/self/mountinfo.

> 
> 3) Then I've rebooted with root=lv_root on the command line and mount showed
> that lv_snap was mounted but original-root file was there. At this point I was
> confused.

again.. same mistake
 
> 
> 4) I've fixed fstab files on both volumes to specify the correct volume as root
> file system and rebooted few more times. All appeared to be working fine and
> mount was now showing the correct volumes as root file sytem. 

it's only the output of "mount" with an old mtab, which confuses you.
mtab should really be updated in rc.sysinit to reflect the real state for the root device.

You can also look at /dev/root or replace in /etc/fstab:
/dev/root      /                       <filesystem>    defaults       1 1