Bug#678688: Please add a /usr/share/initramfs-tools/scripts/local-block/ script

Goswin von Brederlow goswin-v-b at web.de
Sat Jun 23 18:54:12 UTC 2012

Package: lvm2
Version: 2.02.88-2
Severity: wishlist


the initramfs has a number of scripts to configure lvm, raid or crypto
devices (provided by their respective packages). Those script are run
once in fixed order allowing for certain combinations of them,
e.g. lvm on crypto. But some combinations won't work, especially
nested setups, e.g. raid on raid.

Another problem is that block devices might take a long time to
appear, specifically USB drivers take so long to load and detect an
USB block device that by that time the scripts for crypto, lvm and
raid have often already been run. Booting from LVM on an USB block
device becomes a game of chance or is simply impossible without
manually adding rootdelay=xx to the boot options.

I'm preparing a patch for initramfs-tools to solve this problem. This
involves a udev rule and a simple loop in /init that waits for new
block devices to appear and then runs all scripts in
/scripts/local-block/ until the devices for $ROOT and $resume appear
or a timeout is reached.

What I would like from your side is to add a script to

The scripts there will be called with the usual initramfs environment
variables set but also with NEWDEVS containing a list of new devices,
all devices discovered since the last time the script was called. The
script should then configure crypto / lvm / md for those devices as

Note: The scripts are called at least once. If udev is broken,
terribly slow or simply not present in the initramfs then NEWDEVS can
be empty. In that case all devices in /dev/ should be considered.

Note2: It is possible to simply copy your local-top script to
local-block, remove the prerequisites of the script and ignore NEWDEVS

Note3: Please do not delete the local-top script just yet so that you
remain compatible to the old and new version of initramfs. There is
little harm in running the script in local-top an extra time.


-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash

Versions of packages lvm2 depends on:
ii  dmsetup             2:1.02.67-2
ii  initscripts         2.88dsf-13.13
ii  libc6               2.13-32
ii  libdevmapper1.02.1  2:1.02.67-2
ii  libreadline5        5.2-11
ii  libudev0            175-3.1
ii  lsb-base            4.1+Debian0

lvm2 recommends no packages.

lvm2 suggests no packages.

-- debconf information excluded

More information about the pkg-lvm-maintainers mailing list