udev and initramfs

Tom H tomh0665 at gmail.com
Thu Dec 16 11:47:03 UTC 2010


On Thu, Dec 9, 2010 at 5:46 AM, Loïc Grenié <loic.grenie at gmail.com> wrote:
> 2010/12/9 Tom H <tomh0665 at gmail.com>:
>> On Thu, Dec 9, 2010 at 5:26 AM, Loïc Grenié <loic.grenie at gmail.com> wrote:
>>> 2010/12/9 Tom H <tomh0665 at gmail.com>:
>>>> On Thu, Dec 9, 2010 at 3:52 AM, Loïc Grenié <loic.grenie at gmail.com> wrote:
>>>>>
>>>>>    I have a problem and I do not understand why... From udev (lucid: 151-12.2)
>>>>>  I have in file /lib/udev/rules.d/60-persistent-storage.rules:
>>>>>
>>>>> [snip]
>>>>> # probe filesystem metadata of optical drives which have a media inserted
>>>>> KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*",
>>>>> ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*",
>>>>> IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O
>>>>> $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode"
>>>>> # single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET
>>>>> KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*",
>>>>> ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="",
>>>>> IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode"
>>>>>
>>>>> # probe filesystem metadata of disks
>>>>> KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
>>>>> [snip]
>>>>>
>>>>>  and in file /usr/share/initramfs-tools/hooks/udev:
>>>>>
>>>>> [snip]
>>>>> copy_exec /sbin/blkid /lib/udev
>>>>> [snip]
>>>>>
>>>>>   Thus blkid ends in /lib/udev on the initramfs. The consequence I have
>>>>>  is that the system won't reboot because blkid is not executed (because
>>>>>  udev will look for it in /sbin and it's not there) and I thus do not have the
>>>>>  links created in /dev/disk/by-uuid.
>>>>>
>>>>>    What I'd love to understand is why I seem to be the *only one* with
>>>>>  that problem. Are there somehow
>>>>>  /etc/udev/rules.d/60-persistent-storage.rules on "normal" systems
>>>>>  with a different call to blkid ? Does anybody understand what I have
>>>>>  modified to break my system ? How does your kernel command-line
>>>>>  look like (cat /proc/cmdline) ?
>>>>
>>>> If you unpack your initrd, you'll find that "/sbin/blkid" exists.
>>>
>>>    Well no, it's not there (that's why my system won't boot without tweaking,
>>>  and it's also the reason why I've asked for help in the first place). This
>>>  probably means I delete it somehow or I do not create it or whatever.
>>>
>>>       Thanks,
>>
>> You're welcome.
>>
>> You should check whether "/sbin/blkid" exists on your system because
>> it is explicitly copied by mkinitramfs (which is called by
>> update-initramfs).
>
>    Yes it does exist however I had a modified (and broken) version of
>  mkinitramfs. This is why *I* was the only one.
>
>    Now, please, why does udev copy blkid to /lib/udev on the initramfs and
>  forces mkinitramfs to put it in the right place ? It sounds strange to me...
>
>    THANKS again !

You're welcome.

OK for mkinitramfs. That certainly explains it...

For "/lib/udev" all that I can say is that vol_id used to be there (as
well as in "/sbin") and it was called from there. There may have been
a bad "sed ..." when blkid superceded vol_id and blkid is now still
copied there. I'd have to unpack my initrd and search its scripts to
find out whether blkid's still called by one of the initrd script from
"/lib/udev".




More information about the ubuntu-users mailing list