linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* /dev/disk/by-label/* not populated by initrd
@ 2006-05-17 14:58 Jens Dreger
  2006-05-17 16:30 ` Greg KH
  2006-05-18 11:15 ` Jens Dreger
  0 siblings, 2 replies; 3+ messages in thread
From: Jens Dreger @ 2006-05-17 14:58 UTC (permalink / raw)
  To: linux-hotplug

Hi!

A few days ago I installed debian/testing amd64 on one of our servers
to test some 64bit stuff. Upon bootup the machine loaded the SAN
modules (qla*) before the modules for the system disk, so it didn't
make it. I could fix this by blacklisting the modules.

After reading up on udev I understood that I am supposed to write
some rules which make sure the system disks get's a persistent
name. So I gave the disk a label and udevtest shows that it would be
assigned:

  root@zs11:~> udevtest /block/sda/sda1 | grep label
  udev_rules_get_name: add symlink 'disk/by-label/zs11_system'
  create_node: creating symlink '/dev/disk/by-label/zs11_system' to '../../sda1'

The problem is that this does not work inside initrd, but I obviously
need that link for the rootfs. I unpacked the initrd and init has
support for this:

  root@zs11:/boot/initrd.img-2.6.15-1-amd64-generic.unpack> grep LABEL init
                LABEL=*)
                        ROOT="/dev/disk/by-label/${ROOT#LABEL=}"

Booting with kernel-commandline root=LABEL=zs11_system didn't work.

I copied udevtest to the initrd. It shows:

[...]
main: looking at device '/block/sda/sda1' from subsystem 'block'
udev_rules_get_name: no node name set, will use kernel name 'sda1'
lookup_group: specified group unknown 'disk'
create_node: creating device node '/dev/sda1', major = '8', minor = '1', mode = '0660', uid = '0', gid = '0' 
main: run: 'socket:/org/kernel/udev/monitor'
[...]

I know that this is probably a debian issue but I would like to know
how to debug this further. In initrd there is no syslog, so increasing
the udev_log in udev.conf won't help unless I get syslog running
inside initrd. Apparently also groups are unknown at that time. Is
there a better way to find out what's wrong? Any ideas why
/dev/disk/by-label is not populated? vol_id is available in the
initrd.

Thanks in advance,

Jens.

-- 
Jens Dreger                      Freie Universitaet Berlin
dreger@physik.fu-berlin.de       Fachbereich Physik - ZEDV
Tel: +49 30 83854774             Arnimallee 14
Fax: +49 30 83855902	         14195 Berlin


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: /dev/disk/by-label/* not populated by initrd
  2006-05-17 14:58 /dev/disk/by-label/* not populated by initrd Jens Dreger
@ 2006-05-17 16:30 ` Greg KH
  2006-05-18 11:15 ` Jens Dreger
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2006-05-17 16:30 UTC (permalink / raw)
  To: linux-hotplug

On Wed, May 17, 2006 at 04:58:20PM +0200, Jens Dreger wrote:
> Hi!
> 
> A few days ago I installed debian/testing amd64 on one of our servers
> to test some 64bit stuff. Upon bootup the machine loaded the SAN
> modules (qla*) before the modules for the system disk, so it didn't
> make it. I could fix this by blacklisting the modules.
> 
> After reading up on udev I understood that I am supposed to write
> some rules which make sure the system disks get's a persistent
> name. So I gave the disk a label and udevtest shows that it would be
> assigned:
> 
>   root@zs11:~> udevtest /block/sda/sda1 | grep label
>   udev_rules_get_name: add symlink 'disk/by-label/zs11_system'
>   create_node: creating symlink '/dev/disk/by-label/zs11_system' to '../../sda1'
> 
> The problem is that this does not work inside initrd, but I obviously
> need that link for the rootfs. I unpacked the initrd and init has
> support for this:
> 
>   root@zs11:/boot/initrd.img-2.6.15-1-amd64-generic.unpack> grep LABEL init
>                 LABEL=*)
>                         ROOT="/dev/disk/by-label/${ROOT#LABEL=}"
> 
> Booting with kernel-commandline root=LABEL=zs11_system didn't work.
> 
> I copied udevtest to the initrd. It shows:
> 
> [...]
> main: looking at device '/block/sda/sda1' from subsystem 'block'
> udev_rules_get_name: no node name set, will use kernel name 'sda1'
> lookup_group: specified group unknown 'disk'
> create_node: creating device node '/dev/sda1', major = '8', minor = '1', mode = '0660', uid = '0', gid = '0' 
> main: run: 'socket:/org/kernel/udev/monitor'
> [...]
> 
> I know that this is probably a debian issue

Yes, it is.

> but I would like to know how to debug this further.

Try putting the rules and helper scripts that create the by-label/
symlinks into the initrd so that udev can create them.

good luck,

greg k-h


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: /dev/disk/by-label/* not populated by initrd
  2006-05-17 14:58 /dev/disk/by-label/* not populated by initrd Jens Dreger
  2006-05-17 16:30 ` Greg KH
@ 2006-05-18 11:15 ` Jens Dreger
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Dreger @ 2006-05-18 11:15 UTC (permalink / raw)
  To: linux-hotplug

On Wed, May 17, 2006 at 09:30:28AM -0700, Greg KH wrote:
> On Wed, May 17, 2006 at 04:58:20PM +0200, Jens Dreger wrote:
> > Hi!
> > 
> > A few days ago I installed debian/testing amd64 on one of our servers
> > to test some 64bit stuff. Upon bootup the machine loaded the SAN
> > modules (qla*) before the modules for the system disk, so it didn't
> > make it. I could fix this by blacklisting the modules.
> > 
> > After reading up on udev I understood that I am supposed to write
> > some rules which make sure the system disks get's a persistent
> > name. So I gave the disk a label and udevtest shows that it would be
> > assigned:
> > 
> >   root@zs11:~> udevtest /block/sda/sda1 | grep label
> >   udev_rules_get_name: add symlink 'disk/by-label/zs11_system'
> >   create_node: creating symlink '/dev/disk/by-label/zs11_system' to '../../sda1'
> > 
> > The problem is that this does not work inside initrd, but I obviously
> > need that link for the rootfs. I unpacked the initrd and init has
> > support for this:
> > 
> >   root@zs11:/boot/initrd.img-2.6.15-1-amd64-generic.unpack> grep LABEL init
> >                 LABEL=*)
> >                         ROOT="/dev/disk/by-label/${ROOT#LABEL=}"
> > 
> > Booting with kernel-commandline root=LABEL=zs11_system didn't work.
> > 
> > I copied udevtest to the initrd. It shows:
> > 
> > [...]
> > main: looking at device '/block/sda/sda1' from subsystem 'block'
> > udev_rules_get_name: no node name set, will use kernel name 'sda1'
> > lookup_group: specified group unknown 'disk'
> > create_node: creating device node '/dev/sda1', major = '8', minor = '1', mode = '0660', uid = '0', gid = '0' 
> > main: run: 'socket:/org/kernel/udev/monitor'
> > [...]
> > 
> > I know that this is probably a debian issue
> 
> Yes, it is.

Indeed: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug52753
 
> > but I would like to know how to debug this further.
> 
> Try putting the rules and helper scripts that create the by-label/
> symlinks into the initrd so that udev can create them.

Yes, this is somewhat obvious. I thought this to be the case since
mkinitramfs copies /etc/udev/* to the initrd. But:

root@zs11:~> grep persistent /usr/share/initramfs-tools/hooks/udev 
rm -f $DESTDIR/etc/udev/rules.d/z20_persistent.rules # XXX #352753

I upgraded to 0.091-2 and this line is gone.

For the record: I can now boot from the internal disk using the
disklabel with and without SAN attached.

1) label system disk: e2label /dev/sda1 zs11_system
2) change /boot/grub/menu.lst entry:
   root=/dev/sda1 -> root=LABEL=zs11_system
3) change /etc/fstab entry:
   /dev/sda1 -> LABEL=zs11_system

For some reason the internal disk now after the update always gets
assigned first (becomes /dev/sda) and SAN starts at /dev/sdb.
Order on PCI-Bus hasn't changed. Maybe another fix ? :)

Regards,

Jens.

-- 
Jens Dreger                      Freie Universitaet Berlin
dreger@physik.fu-berlin.de       Fachbereich Physik - ZEDV
Tel: +49 30 83854774             Arnimallee 14
Fax: +49 30 83855902	         14195 Berlin


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-05-18 11:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-17 14:58 /dev/disk/by-label/* not populated by initrd Jens Dreger
2006-05-17 16:30 ` Greg KH
2006-05-18 11:15 ` Jens Dreger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).