Commit Graph

28 Commits (c5758f20902b37e3232cd6a1b79f914155457ffd)

Author SHA1 Message Date
Harald Hoyer 5297d4f5b2 lvm/lvm_scan.sh: udevadm settle after lvm scan 2012-07-23 15:36:58 +02:00
Peter Rajnoha b8a81fb885 lvm: disable lvmetad
Currently dracut uses lvm.conf as found in the system and modifies only
global/locking_type setting. As there's a new feature introduced - the lvmetad
daemon, dracut should disable its use as well by setting "global/use_lvmetad=0"
(patch attached).

Otherwise, there's a warning message issued:

dracut: WARNING: Failed to connect to lvmetad: No such file or directory.
Falling back to internal scanning.

@@ -, +, @@
 modules.d/90lvm/lvm_scan.sh     |    2 ++
 modules.d/90lvm/module-setup.sh |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)
2012-04-16 14:46:53 +02:00
Harald Hoyer fb67e4aa36 shutdown on demand
Do not save and restore the initramfs, but instead, just unpack the
default initramfs for shutdown on shutdown.
2012-02-13 07:08:08 +01:00
Harald Hoyer e23f46e86f 90lvm/lvm_scan.sh: use "--partial" to force assembly incomplete VGs
If our internal loop counter is bigger than half of the maximum
count, try to assemble lvm device partially with the "--partial"
option.

https://bugzilla.redhat.com/show_bug.cgi?id=723548
2011-08-11 14:27:26 +02:00
Harald Hoyer 23b28c0ab5 lvm/lvm_scan.sh: remove references to lvm-cleanup
lvm-cleanup was removed long time ago
2011-05-17 12:29:47 +02:00
Harald Hoyer 3b403b32fc removed trailing whitespaces 2011-05-10 11:56:09 +02:00
Harald Hoyer fb59f4c967 get rid of absolute PATHs 2011-04-08 13:49:06 +02:00
Harald Hoyer d125a47061 mkdir always with -m 0755 2011-04-08 10:39:46 +02:00
Harald Hoyer 0b53ca70b6 Move all hooks to "$hookdir"
hookdir=/lib/dracut/hooks for now, to keep the root directory clean
2011-03-25 16:10:46 +01:00
Harald Hoyer c9f1e3d1f4 check for getarg() function before sourcing dracut-lib.sh
make use of "type getarg" to check, if we really need to source
dracut-lib.sh
2011-03-25 16:10:46 +01:00
Harald Hoyer 2826a877af 90lvm/lvm_scan.sh: removed garbage line 2011-02-22 18:40:40 +01:00
Harald Hoyer 53570e16c3 90lvm/lvm_scan.sh: fixed lvm version parsing 2011-02-22 17:45:11 +01:00
Harald Hoyer b282107fa9 lvm: use --sysinit, if lvm version >= v2.02.65 2011-02-18 10:58:39 +01:00
Harald Hoyer fa7ada31d0 new parameter option names with "rd.*" namespace
Renamed Options
       Here is a list of options, which were used in dracut prior to
       version 008, and their new replacement.

       rdbreak
           rd.break

       rd_CCW
           rd.ccw

       rdcopystate
           rd.copystate

       rd_DASD_MOD
           rd.dasd_mod.dasd

       rd_DASD
           rd.dasd

       rdinitdebug rdnetdebug
           rd.debug

       rd_NO_DM
           rd.dm=0

       rd_DM_UUID
           rd.dm.uuid

       rdblacklist
           rd.driver.blacklist

       rdinsmodpost
           rd.driver.post

       rdloaddriver
           rd.driver.pre

       rd_NO_FSTAB
           rd.fstab=0

       rdinfo
           rd.info

       check
           rd.live.check

       rdlivedebug
           rd.live.debug

       live_dir
           rd.live.dir

       liveimg
           rd.live.image

       overlay
           rd.live.overlay

       readonly_overlay
           rd.live.overlay.readonly

       reset_overlay
           rd.live.overlay.reset

       live_ram
           rd.live.ram

       rd_NO_CRYPTTAB
           rd.luks.crypttab=0

       rd_LUKS_KEYDEV_UUID
           rd.luks.keydev.uuid

       rd_LUKS_KEYPATH
           rd.luks.keypath

       rd_NO_LUKS
           rd.luks=0

       rd_LUKS_UUID
           rd.luks.uuid

       rd_LUKS_UUID
           rd.luks.uuid

       rd_NO_LVMCONF
           rd.lvm.conf

       rd_LVM_LV
           rd.lvm.lv

       rd_NO_LVM
           rd.lvm=0

       rd_LVM_SNAPSHOT
           rd.lvm.snapshot

       rd_LVM_SNAPSIZE
           rd.lvm.snapsize

       rd_LVM_VG
           rd.lvm.vg

       rd_NO_MDADMCONF
           rd.md.conf=0

       rd_NO_MDIMSM
           rd.md.imsm=0

       rd_NO_MD
           rd.md=0

       rd_MD_UUID
           rd.md.uuid

       rd_NFS_DOMAIN
           rd.nfs.domain

       rd_NO_PLYMOUTH
           rd.plymouth=0

       rd_retry
           rd.retry

       rdshell
           rd.shell

       rd_NO_SPLASH
           rd.splash

       rdudevdebug
           rd.udev.debug

       rdudevinfo
           rd.udev.info

       rd_NO_ZFCPCONF
           rd.zfcp.conf=0

       rd_ZFCP
           rd.zfcp
2010-10-28 17:11:27 +02:00
James Laska b2dff45423 lvm: support for dynamic LVM SNAPSHOT root volume
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).

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
2010-09-22 16:39:51 +02:00
Harald Hoyer cc02093d69 reformat source code
removed tabs and set indention to 4 spaces
added emacs and vi format headers
2010-09-10 15:34:36 +02:00
Harald Hoyer b3561ee15f lvm/lvm_scan.sh: silence lvm version check 2010-03-19 16:51:05 +01:00
Mike Snitzer f6458b80ef lvm_scan: use '--ignoremonitoring' rather than '--monitor n'
lvchange and vgchange '--monitor n' will not prevent lvm from
attempting to dlopen the libdevmapper-event library.

dracut git commit 47ab3b6c5e introduced the use of '--monitor n' but
'--ignoremonitoring' is needed now that the libdevmapper-event library
isn't copied into the initramfs (ever since 0fae59d6eb)

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2010-03-17 11:59:38 +01:00
Harald Hoyer dc0a0f6c93 lvm: add rd_LVM_LV and "--poll n" 2010-01-13 17:59:14 +01:00
Mike Snitzer 0fae59d6eb lvm: lvm.conf (locking_type = 4)
- the use of sed is placeholder "hack" until lvm2 provides a proper
  tool for changing lvm.conf
- lvm_scan.sh should run lvm commands with --ignorelockingfailure to
  re-use lvm's existing initrd-specific logic; future lvm2 changes
  will split this flag out into various new command-line switches
- no monitoring should be started from within initramfs
- NOTE: the same should apply to 90dmraid/install
- the correct types would be: '[ "blkext", 1 , "cciss0", 16 ]'
  but lvm2 (>= 2.02.52) already properly supports both 'blkext' and
  'cciss' (including cciss0 -> cciss7)
2010-01-13 16:29:12 +01:00
Harald Hoyer 47ab3b6c5e lvm: scan without monitor
https://bugzilla.redhat.com/show_bug.cgi?id=540289
2009-11-25 19:55:17 +01:00
Harald Hoyer 7a34efa5c4 md/dm/lvm: install pre-pivot cleanup hooks only if actually needed
- removed dmraid cleanup
- only call lvm cleanup, if no lvm.conf provided
- copy over lvm.conf by default
- add --nolvmconf --lvmconf parameters
2009-09-18 12:20:21 +02:00
Harald Hoyer 273b197d75 added initqueue-settled and refactored code 2009-09-07 19:12:01 +02:00
Harald Hoyer 5c6a593f2e add udevsettle function and settle after raid/lvm/crypto activities 2009-09-01 15:42:27 +02:00
Harald Hoyer 376cfd1c27 lvm_scan: do not overwrite a preexisting /etc/lvm/lvm.conf 2009-07-17 10:13:33 +02:00
Harald Hoyer f874872fc2 add command line parameters to specify exact actions for root assembly
LVM
       rd_NO_LVM
              disable LVM detection

       rd_LVM_VG=<volume group name>
              only activate the volume groups with the given name

crypto LUKS
       rd_NO_LUKS
              disable crypto LUKS detection

       rd_LUKS_UUID=<luks uuid>
              only activate the LUKS partitions with the given UUID

MD
       rd_NO_MD
              disable MD RAID detection

       rd_MD_UUID=<md uuid>
              only activate the raid sets with the given UUID

DMRAID
       rd_NO_DM
              disable DM RAID detection

       rd_DM_UUID=<dmraid uuid>
              only activate the raid sets with the given UUID
2009-07-15 18:27:21 +02:00
Harald Hoyer 1adaf3372c limit the devices for which lvm vgscan will scan
Build the filter list and create /etc/lvm/lvm.conf for all LVM_member
devices found by udev.
2009-07-15 18:27:20 +02:00
Harald Hoyer e3b4125e83 delay lvm scan, until udev has settled 2009-07-13 16:24:41 +02:00