Bug 602784 - RFE - support for dynamic LVM SNAPSHOT root volume
Summary: RFE - support for dynamic LVM SNAPSHOT root volume
Keywords:
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:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-06-10 18:31 UTC by James Laska
Modified: 2013-09-02 06:49 UTC (History)
3 users (show)

Fixed In Version: dracut-005-5.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-10-27 22:55:07 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
dracut-lv_snap.patch (1.95 KB, patch)
2010-06-10 18:31 UTC, James Laska
no flags Details | Diff

Description James Laska 2010-06-10 18:31:03 UTC
Created attachment 423009 [details]
dracut-lv_snap.patch

Description of problem:

I'm looking for a way to have a system with disposable storage that can be rebooted and all filesystem changes are thrown away.  After reboot, the system starts with a fresh root volume again.  The use case is for automated testing.  We run test scripts that could potentially not clean up after themselves.  

This is almost like stateless, but the storage is local to the system (not iSCSI, NFS or NBB).  I've experimented with using LVM snapshots and have something that works.  I'm not sure how best to maintain this on top of dracut, or whether it should be integrated within dracut.  This bug report is intended to track that discussion.

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

Steps to Reproduce:
1. Install Fedora 13 using default partition layout
  NOTE: modify the layout to leave extra room in the LVM volume group 
2. Apply attached patch
3. Update grub.conf to enable dracut LVM snapshot support.  Add the following boot arguments

 rd_LVM_SNAPSHOT=vg_test1055/lv_snap (note the VG name will depend on your system).
 rd_LVM_SNAPSIZE= (optional, defaults to size of volume specified with by rd_LVM_SNAPSHOT)

4. Adjust grub.conf and fstab to use LVM snapshot
 $ sed -i -e 's|lv_root|lv_snap|' /boot/grub/grub.conf
 $ sed -i -e 's|lv_root|lv_snap|' /etc/fstab
5. Reboot system 
  
Expected results (no value provided for rd_LVM_SNAPSIZE):

  dracut: Starting plymouth daemon
  dracut: rd_NO_DM: removing DM RAID activation
  dracut: rd_NO_MD: removing MD RAID activation
  dracut: Removing existing LVM snapshot vg_test1055/lv_snap
  dracut: Logical volume "lv_snap" successfully removed
  dracut: No LVM snapshot size provided, using size of vg_test1055/lv_root (  9024.00m)
  dracut: Creating LVM snapshot vg_test1055/lv_snap  (  9024.00m)
  dracut: Logical volume "lv_snap" created
  dracut: Scanning devices sda2  for LVM logical volumes vg_test1055/lv_root vg_test1055/lv_swap 
  dracut: inactive Original '/dev/vg_test1055/lv_root' [8.81 GiB] inherit
  dracut: inactive '/dev/vg_test1055/lv_swap' [1.00 GiB] inherit
  dracut: inactive Snapshot '/dev/vg_test1055/lv_snap' [8.81 GiB] inherit
  dracut: Mounted root filesystem /dev/mapper/vg_test1055-lv_snap
  dracut: Loading SELinux policy
  dracut: Switching root

Expected results (rd_LVM_SNAPSIZE=100m):

  dracut: Starting plymouth daemon
  dracut: rd_NO_DM: removing DM RAID activation
  dracut: rd_NO_MD: removing MD RAID activation
  dracut: Removing existing LVM snapshot vg_test1055/lv_snap 
  dracut: Logical volume "lv_snap" successfully removed
  dracut: Creating LVM snapshot vg_test1055/lv_snap  (100m )
  dracut: Rounding up size to full physical extent 128.00 MiB
  dracut: Logical volume "lv_snap" created
  dracut: Scanning devices sda2  for LVM logical volumes vg_test1055/lv_root vg_test1055/lv_swap 
  dracut: inactive Original '/dev/vg_test1055/lv_root' [8.81 GiB] inherit
  dracut: inactive '/dev/vg_test1055/lv_swap' [1.00 GiB] inherit
  dracut: inactive Snapshot '/dev/vg_test1055/lv_snap' [128.00 MiB] inherit
  dracut: Mounted root filesystem /dev/mapper/vg_test1055-lv_snap
  dracut: Loading SELinux policy
  dracut: Switching root

Additional info:
 * Requires fix for bug#602649

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

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

Comment 3 Fedora Update System 2010-09-24 20:38:49 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 4 Fedora Update System 2010-10-27 22:53:43 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 5 Fedora Update System 2010-10-30 23:38:19 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.