Your message dated Sun, 16 Jan 2005 17:40:42 +0100
with message-id <[EMAIL PROTECTED]>
and subject line Bug#288150: multipath-tools: initrd script breaks booting lvm 
root
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 12 Jan 2005 22:02:53 +0000
>From [EMAIL PROTECTED] Wed Jan 12 14:02:52 2005
Return-path: <[EMAIL PROTECTED]>
Received: from smtp-vbr2.xs4all.nl [194.109.24.22] 
        by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
        id 1CoqZo-0003r9-00; Wed, 12 Jan 2005 14:02:52 -0800
Received: from banaan.xs4all.nl (banaan.xs4all.nl [80.126.2.237])
        by smtp-vbr2.xs4all.nl (8.12.11/8.12.11) with ESMTP id j0CM2oVk029924;
        Wed, 12 Jan 2005 23:02:50 +0100 (CET)
        (envelope-from [EMAIL PROTECTED])
Received: (from [EMAIL PROTECTED])
        by banaan.xs4all.nl (8.11.6/8.11.6) id j0CM2op19602;
        Wed, 12 Jan 2005 23:02:50 +0100
Date: Wed, 12 Jan 2005 23:02:50 +0100
From: Erik van Konijnenburg <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: multipath-tools: initrd script breaks booting lvm root
Message-ID: <[EMAIL PROTECTED]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5.1i
X-Virus-Scanned: by XS4ALL Virus Scanner
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
        autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 

Package: multipath-tools
Version: 0.4.1-1
Severity: critical
Justification: breaks the whole system
Tags: patch

If multipath-tools-0.4.1-1 is installed, the initrd generated by
initrd-tools-0.1.76 is non-bootable for systems using an LVM
root device.

Symptoms: pivot_root: no such file or directory; sbin/init not found;
panic: attempting to kill init.

The cause: multipath adds a script /etc/mkinitrd/scripts/01_udev; this
mounts a new /dev and lets udevstart run on it.  This happens after
/script is executed, which is where the LVM command "vgchange -a y vg0"
is executed to create LVM devices.  Unfortunately, udevstart has no way
of creating the /dev/mapper nodes required by LVM, so the root device
/dev/mapper/vg0 stays missing.

One possible fix would be not to mount an empty /dev in 01_udev, so that
the LVM devices remain visible.  However, mounting a new /dev protects
against a possible read-only prior /dev, and the prior /dev is indeed
read-only.  (it is part of the initrd image and contains some symlinks
to ../devfs)

So the attached patch instead copies the contents of the old /dev to the
new /dev.  It's possible that a similar problem would occur for other
virtual devices such as MD; these too are not created by hotplugging
but by an init.d script.  I have not tested this, but the patch should
cover such cases.

The patch was tested on a PC with LVM devices on a SATA disk but no
actual multipath devices: I only installed multipath-tools to take a
look at the documentation ...

I'm including #288150 (initrd no longer works unless busybox is
installed) on the Cc list.  That report mentions /bin/sleep missing
from initrd image.  The missing sleep is still missing after attached
patch, but it does not seem to harm anything.  No claim that this
patchs solves #288150, but the symptoms seem similar enough to justify
a cross reference.

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.8-1-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages multipath-tools depends on:
ii  debconf [debconf-2.0]    1.4.41          Debian configuration management sy
ii  hotplug                  0.0.20040329-16 Linux Hotplug Scripts
ii  initscripts              2.86.ds1-1      Standard scripts needed for bootin
ii  libc6                    2.3.2.ds1-20    GNU C Library: Shared libraries an
ii  libdevmapper1.00         2:1.00.20-1     The Linux Kernel Device Mapper use
ii  libsysfs1                1.1.0-1         Interface library to sysfs
ii  makedev                  2.3.1-75        Creates device files in /dev
ii  udev                     0.050-4         /dev/ management daemon

-- no debconf information

--- 01_udev.org 2005-01-12 10:57:58.000000000 +0100
+++ 01_udev.works       2005-01-12 22:51:22.000000000 +0100
@@ -4,8 +4,9 @@
 cp /sbin/udevstart $INITRDDIR/sbin/
 cp /bin/mountpoint $INITRDDIR/bin/
 cp /bin/readlink $INITRDDIR/bin/
+cp /bin/cp $INITRDDIR/bin/
 
-PROGS="/sbin/udev /sbin/udevstart /bin/mountpoint /bin/readlink"
+PROGS="/sbin/udev /sbin/udevstart /bin/mountpoint /bin/readlink /bin/cp"
 LIBS=`ldd $PROGS | grep -v linux-gate.so | sort -u | \
 awk '{print $3}'` 
 for i in $LIBS
@@ -33,10 +34,15 @@
 cat <<EOF >| $INITRDDIR/scripts/10_udev.sh
 
 cd /
+mount -n --bind /dev /mnt
 mount -nt proc proc proc
 mount -nt sysfs sysfs sys
 mount -nt tmpfs tmpfs dev || mount -nt ramfs ramfs dev
 mount -nt tmpfs tmpfs tmp || mount -nt ramfs ramfs tmp
+# preserve old /dev contents, since udev does not make
+# eg LVM nodes.
+cp -a /mnt/* /dev
+umount -n /mnt
 
 #modprobe dm-mod
 #modprobe dm-multipath

---------------------------------------
Received: (at 290145-done) by bugs.debian.org; 16 Jan 2005 16:40:45 +0000
>From [EMAIL PROTECTED] Sun Jan 16 08:40:45 2005
Return-path: <[EMAIL PROTECTED]>
Received: from smtp-vbr7.xs4all.nl [194.109.24.27] 
        by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
        id 1CqDSG-00013T-00; Sun, 16 Jan 2005 08:40:45 -0800
Received: from banaan.xs4all.nl (banaan.xs4all.nl [80.126.2.237])
        by smtp-vbr7.xs4all.nl (8.12.11/8.12.11) with ESMTP id j0GGehP2029508;
        Sun, 16 Jan 2005 17:40:43 +0100 (CET)
        (envelope-from [EMAIL PROTECTED])
Received: (from [EMAIL PROTECTED])
        by banaan.xs4all.nl (8.11.6/8.11.6) id j0GGehH01508;
        Sun, 16 Jan 2005 17:40:43 +0100
Date: Sun, 16 Jan 2005 17:40:42 +0100
From: Erik van Konijnenburg <[EMAIL PROTECTED]>
To: Guido Guenther <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: Re: Bug#288150: multipath-tools: initrd script breaks booting lvm root
Message-ID: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5.1i
In-Reply-To: <[EMAIL PROTECTED]>; from [EMAIL PROTECTED] on Thu, Jan 13, 2005 
at 01:59:22PM +0100
X-Virus-Scanned: by XS4ALL Virus Scanner
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
        autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 
X-CrossAssassin-Score: 2

Pulling for now seems indeed the best option.  I'm closing the #290145
report with suggested patch; it's obviously not what's needed.

Based on reading of mkinitrd, the extension scripts are invoked as
the very last action in mkinitrd.  LVM is special-cased in the main body;
thus your extension script can't act before the code generated for LVM.

Extending initrd-tools for multipath-tools could be done as follows:

Let multipath-tools depend on dmsetup.  Having a multipath device
causes mkinitrd to invoke dmsetup, and initrd-tools also runs in
environments where everything is on a single IDE disk, so having
the dependency in initrd-tools would needlessly bloat simple desktop
installs.

In mkinitrd, the getroot() function looks at devices and decides how
to make them operational.  For device-mapper devices, it invokes dm(),
which uses `dmsetup table` to determine whether it's a crypt device
or LVM.  This function would need to be extended to recognise multipath.
You then need a function to generate script code for multipath; dmcrypt()
is a good example.  This does the following:

- invoke getroot() on underlying devices
- echo required modules to file descriptor 1
- echo required files to fd 4
- echo required script fragment to fd 5
- echo names of required executables and libraries to fd 6

Regards,
Erik

On Thu, Jan 13, 2005 at 01:59:22PM +0100, Guido Guenther wrote:
> On Wed, Jan 12, 2005 at 11:02:50PM +0100, Erik van Konijnenburg wrote:
> > The cause: multipath adds a script /etc/mkinitrd/scripts/01_udev; this
> > mounts a new /dev and lets udevstart run on it.  This happens after
> > /script is executed, which is where the LVM command "vgchange -a y vg0"
> > is executed to create LVM devices.  Unfortunately, udevstart has no way
> > of creating the /dev/mapper nodes required by LVM, so the root device
> > /dev/mapper/vg0 stays missing.
> Uargh, that is very bad. We should run the multipath stuff before the
> LVM stuff anyway since you most likely want LVM over the multipath (if
> not you're of corse still free to do so). I'll have to have a look at
> the scripts of 0.4.2 to see if we can do this easily. Until then it
> would probably be best to pull the initrd related parts from
> multipath-tools again since they seem to cause quiet some trouble at the
> moment and are "only" needed if your root device is multipathed.
> Cheers,
>  -- Guido


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to