package linux-image-3.2.0-31-generic 3.2.0-31.50 failed to install/upgrade: run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1 [/dev/disk/by-uuid: Is a directory , mkinitramfs: for root /dev/disk/by-uuid missing disk/by-uuid /sys/block/ entry]

Bug #1062699 reported by Gelu N.
44
This bug affects 9 people
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Selecting previously unselected package linux-image-3.2.0-31-generic.
(Reading database ... 275104 files and directories currently installed.)
Unpacking linux-image-3.2.0-31-generic (from .../linux-image-3.2.0-31-generic_3.2.0-31.50_amd64.deb) ...
Done.
Selecting previously unselected package linux-image-generic.
Unpacking linux-image-generic (from .../linux-image-generic_3.2.0.31.34_amd64.deb) ...
Selecting previously unselected package linux-image.
Unpacking linux-image (from .../linux-image_3.2.0.31.34_amd64.deb) ...
Setting up linux-image-3.2.0-31-generic (3.2.0-31.50) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-31-generic /boot/vmlinuz-3.2.0-31-generic
update-initramfs: Generating /boot/initrd.img-3.2.0-31-generic
/dev/disk/by-uuid: Is a directory
mkinitramfs: for root /dev/disk/by-uuid missing disk/by-uuid /sys/block/ entry
mkinitramfs: workaround is MODULES=most
mkinitramfs: Error please report the bug
update-initramfs: failed for /boot/initrd.img-3.2.0-31-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.2.0-31-generic.postinst line 1010.
dpkg: error processing linux-image-3.2.0-31-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-3.2.0-31-generic; however:
  Package linux-image-3.2.0-31-generic is not configured yet.
dpkg: error processing linux-image-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image:
 linux-image depends on linux-image-generic (= 3.2.0.31.34); however:
  Package linux-image-generic is not configured yet.
dpkg: error processing linux-image (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          No apport report written because the error message indicates its a followup error from a previous failure.
                                                    Errors were encountered while processing:
 linux-image-3.2.0-31-generic
 linux-image-generic
 linux-image
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up linux-image-3.2.0-31-generic (3.2.0-31.50) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-3.2.0-31-generic
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-31-generic /boot/vmlinuz-3.2.0-31-generic
update-initramfs: Generating /boot/initrd.img-3.2.0-31-generic
/dev/disk/by-uuid: Is a directory
mkinitramfs: for root /dev/disk/by-uuid missing disk/by-uuid /sys/block/ entry
mkinitramfs: workaround is MODULES=most
mkinitramfs: Error please report the bug
update-initramfs: failed for /boot/initrd.img-3.2.0-31-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.2.0-31-generic.postinst line 1010.
dpkg: error processing linux-image-3.2.0-31-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-3.2.0-31-generic; however:
  Package linux-image-3.2.0-31-generic is not configured yet.
dpkg: error processing linux-image-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image:
 linux-image depends on linux-image-generic (= 3.2.0.31.34); however:
  Package linux-image-generic is not configured yet.
dpkg: error processing linux-image (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-3.2.0-31-generic
 linux-image-generic
 linux-image

ProblemType: Package
DistroRelease: Ubuntu 12.04
Package: linux-image-3.2.0-31-generic 3.2.0-31.50
ProcVersionSignature: Ubuntu 3.2.0-26.41-generic 3.2.19
Uname: Linux 3.2.0-26-generic x86_64
NonfreeKernelModules: btrfs zlib_deflate libcrc32c ufs qnx4 hfsplus hfs minix ntfs vfat msdos fat jfs xfs reiserfs ext2 tcp_diag inet_diag xt_multiport iptable_filter nls_utf8 udf crc_itu_t ses enclosure usb_storage pci_stub vboxpci vboxnetadp vboxnetflt vboxdrv rfcomm bnep bluetooth parport_pc ppdev binfmt_misc ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_conntrack nf_defrag_ipv4 ip_tables x_tables joydev usbhid cdc_ether usbnet hid uas i7core_edac edac_core bnx2 ioatdma dca serio_raw shpchp tpm_tis megaraid_sas mac_hid lp parport
ApportVersion: 2.0.1-0ubuntu11
Architecture: amd64
Date: Sat Oct 6 09:10:36 2012
ErrorMessage: run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111011)
SourcePackage: initramfs-tools
Title: package linux-image-3.2.0-31-generic 3.2.0-31.50 failed to install/upgrade: run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
UpgradeStatus: Upgraded to precise on 2012-04-30 (158 days ago)

Revision history for this message
Gelu N. (gelu) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :

Hi,
  Did this occur during an installation, a full upgrade or just a minor security upgrade?
Can you add the result of

   ls -l /dev/disk/by-uuid
and
   ls -ld /dev/disk/by-uuid*

Dave

summary: package linux-image-3.2.0-31-generic 3.2.0-31.50 failed to
install/upgrade: run-parts: /etc/kernel/postinst.d/initramfs-tools
- exited with return code 1
+ exited with return code 1 [/dev/disk/by-uuid: Is a directory ,
+ mkinitramfs: for root /dev/disk/by-uuid missing disk/by-uuid /sys/block/
+ entry]
Changed in initramfs-tools (Ubuntu):
status: New → Incomplete
Revision history for this message
Gelu N. (gelu) wrote :

That occur during an installation/uninstallation of an any package.

:~$ ls -l /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 Oct 6 16:16 b887034b-acfb-489a-b6b6-4733a0bf5602 -> ../../sdc1
lrwxrwxrwx 1 root root 10 Oct 6 16:14 c1351f6b-075e-4f8f-b977-28914b25cdc2 -> ../../sda1
lrwxrwxrwx 1 root root 10 Oct 6 16:14 c5ac72d0-a336-4ce2-9712-d8bbea0cdc8c -> ../../sda2
lrwxrwxrwx 1 root root 10 Oct 6 16:14 dc2980a6-b18a-4855-99cc-4a28f459f1e8 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Oct 6 16:14 e13006bb-5c76-4dea-90fe-feb326c08490 -> ../../sdb2

:~$ ls -ld /dev/disk/by-uuid*
drwxr-xr-x 2 root root 140 Oct 6 16:22 /dev/disk/by-uuid

sda1 is / in my system
sdb1 is swap
sdb2 is /home

lilo is installed on sda (but lilo is not the problem, with grub and lilo purged is the same error)
sdb is IBM ServeRAID M5014

sda2 unused partition
sdc is an external usb hard disk

On ubuntu 11.10 this error never existed. This error occurred when upgraded first time the kernel on ubuntu 12.04. Since then appears each time I use apt-get or synaptic (sorry for my bad english).

G.N.

Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :

I'd try running update-initramfs with -v on the new kernel and see what happens, something like

   update-initramfs -v -u -k 3.5.0-11 (or whatever your latest kernel version in /boot is)

and attach the debug output it produces; hopefully it'll provide some more information as to why it's getting confused.

Can you please also include your /etc/fstab and the output of cat /proc/partitions

Dave

Revision history for this message
Gelu N. (gelu) wrote :

# cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
UUID=c1351f6b-075e-4f8f-b977-28914b25cdc2 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda2 during installation
#UUID=c5ac72d0-a336-4ce2-9712-d8bbea0cdc8c none swap sw 0 0
# swap was on /dev/sdb1 during installation
UUID=dc2980a6-b18a-4855-99cc-4a28f459f1e8 none swap sw 0 0
UUID=e13006bb-5c76-4dea-90fe-feb326c08490 /home ext4 errors=remount-ro 0 1

# cat /proc/partitions
major minor #blocks name

  11 0 1048575 sr0
   8 0 78156288 sda
   8 1 36405248 sda1
   8 2 2420736 sda2
   8 16 975585280 sdb
   8 17 25164800 sdb1
   8 18 950419439 sdb2
  11 1 684032 sr1
   8 32 976075776 sdc
   8 33 976069206 sdc1

# update-initramfs -v -u -k 3.2.0-32-generic
update-initramfs: Generating /boot/initrd.img-3.2.0-32-generic
/dev/disk/by-uuid: Is a directory
mkinitramfs: for root /dev/disk/by-uuid missing disk/by-uuid /sys/block/ entry
mkinitramfs: workaround is MODULES=most
mkinitramfs: Error please report the bug
update-initramfs: failed for /boot/initrd.img-3.2.0-32-generic with 1.

Same error for any kernel from the /boot directory

But after I change MODULES=dep with MODULES=most in /etc/initramfs-tools/conf.d/driver-policy
update-initramfs seems to work ok:

# update-initramfs -v -u -k 3.2.0-32-generic
Keeping /boot/initrd.img-3.2.0-32-generic.dpkg-bak
update-initramfs: Generating /boot/initrd.img-3.2.0-32-generic
Adding module /lib/modules/3.2.0-32-generic/kernel/drivers/hid/hid.ko
Adding module /lib/modules/3.2.0-32-generic/kernel/drivers/hid/usbhid/usbhid.ko
Adding module /lib/modules/3.2.0-32-generic/kernel/drivers/hid/hid-apple.ko
Adding module /lib/modules/3.2.0-32-generic/kernel/drivers/hid/hid-cherry.ko
Adding module /lib/modules/3.2.0-32-generic/kernel/drivers/input/ff-memless.ko
Adding module /lib/modules/3.2.0-32-generic/kernel/drivers/hid/hid-logitech.ko
Adding module /lib/modules/3.2.0-32-generic/kernel/drivers/hid/hid-microsoft.ko
Adding module /lib/modules/3.2.0-32-generic/kernel/drivers/hid/hid-a4tech.ko
[...]
Calling hook kbd
Adding binary /bin/setfont
Adding binary /bin/kbd_mode
Adding binary /bin/loadkeys
Calling hook busybox
Adding binary /usr/lib/initramfs-tools/bin/busybox
Calling hook dmsetup
Adding binary /sbin/dmsetup
Adding library /lib/libdevmapper.so.1.02.1
Building cpio /boot/initrd.img-3.2.0-32-generic.new initramfs
Added linux + *

G.N.

Revision history for this message
Gelu N. (gelu) wrote :

PS: And of course the generated initrd.img is 14M instead of 2.1M. :)

G.N.

Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :

Hi,
  Hmm well that looks ok, but the output of the update-initramfs has a clue:

# update-initramfs -v -u -k 3.2.0-32-generic
update-initramfs: Generating /boot/initrd.img-3.2.0-32-generic
/dev/disk/by-uuid: Is a directory

Can you rerun that update-initramfs like this (with the original MODULES=dep) setting like this:

/bin/bash -x /usr/sbin/update-initramfs -v -u -k 3.2.0-32-generic

What that should do is spew each line of update-initramfs and each command it executed in detail - the challenge is to find why something is mis-understanding a disk path. My guess is the error is actually coming from mkinitramfs, but the /bin/bash -x should give you the exact line for mkinitramfs to run.

Dave

Revision history for this message
Gelu N. (gelu) wrote :

with MODULES=dep in /etc/initramfs-tools/conf.d/driver-policy:

# /bin/bash -x /usr/sbin/update-initramfs -v -u -k 3.2.0-32-generic
[...]
+ generate_initramfs
+ echo 'update-initramfs: Generating /boot/initrd.img-3.2.0-32-generic'
update-initramfs: Generating /boot/initrd.img-3.2.0-32-generic
+ OPTS=-o
+ '[' 1 = 1 ']'
+ OPTS='-v -o'
+ mkinitramfs -v -o /boot/initrd.img-3.2.0-32-generic.new 3.2.0-32-generic
/dev/disk/by-uuid: Is a directory
mkinitramfs: for root /dev/disk/by-uuid missing disk/by-uuid /sys/block/ entry
mkinitramfs: workaround is MODULES=most
mkinitramfs: Error please report the bug
+ mkinitramfs_return=1
+ remove_initramfs_bak
+ '[' -z /boot/initrd.img-3.2.0-32-generic.dpkg-bak ']'
+ rm -f /boot/initrd.img-3.2.0-32-generic.dpkg-bak
+ verbose 'Removing /boot/initrd.img-3.2.0-32-generic.dpkg-bak'
+ '[' 1 = 1 ']'
+ printf 'Removing /boot/initrd.img-3.2.0-32-generic.dpkg-bak\n'
Removing /boot/initrd.img-3.2.0-32-generic.dpkg-bak
+ rm -f /boot/initrd.img-3.2.0-32-generic.new
+ '[' 1 = 2 ']'
+ echo 'update-initramfs: failed for /boot/initrd.img-3.2.0-32-generic with 1.'
update-initramfs: failed for /boot/initrd.img-3.2.0-32-generic with 1.
+ exit 1

Yes, the error is certainly coming from mkinitramfs, I knew it.

In attachment is the output of:
# /bin/bash -x mkinitramfs -o ~/tmp/initramfs-3.2.0-32-generic 2> ~/tmp/log.dep

I have no /dev/root (see lines 343-356 of log.dep):
[...]
++ awk '/\/dev\// {if ($3 == "/") {print "root=" $1 "\nFSTYPE=" $5; exit}}'
+ eval 'root=/dev/root
FSTYPE=ext4'
++ root=/dev/root
++ FSTYPE=ext4
+ '[' -z /dev/root ']'
+ '[' -z /dev/root ']'
+ '[' ext4 = ubifs ']'
+ '[' /dev/root = /dev/root ']'
++ blkid -o value -s UUID /dev/root
+ root=/dev/disk/by-uuid/
++ readlink -f /dev/disk/by-uuid/
+ root=/dev/disk/by-uuid
++ /usr/lib/klibc/bin/fstype /dev/disk/by-uuid
/dev/disk/by-uuid: Is a directory
[...]

Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :

Hmm thanks!
OK, so I don't have a /dev/root either; what seems to happen (see /usr/share/initramfs-tools/hook-functions) is that it
checks the output of

mount

to see where / is mounted, and it's finding that it says /dev/root - and so that's what it uses /dev/disk/by-uuid to look at via blkid to see where it really goes; if mount is saying /dev/root then mkinitramfs is expecting there to be a /dev/root, and looking at the attched

df

output:

rootfs 36612928 22853144 11924828 66% /
/dev/root 36612928 22853144 11924828 66% /

It's obvious something is a bit weird.

So, time for some more questions:
   * What does cat /proc/cmdline show
   * Does this machine have any odd boot process?
   * Is there anything else odd you've seen, I see:

[ 4.743386] init: Failed to create pty - disabling logging for job
[ 4.743486] init: Temporary process spawn error: No such file or directory

in the logs - that's a bit odd.

Changed in initramfs-tools (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Alistair Buxton (a-j-buxton) wrote :

ls -l /boot/ may be enlightening too, if it's missing initramfs like I suspect...

Revision history for this message
Alistair Buxton (a-j-buxton) wrote :

Ok, I tested this in a VM:

Normal dmesg: http://paste.ubuntu.com/1330414/

Initramfs mounted at line 259, then nothing from kernel VFS around line 354.

Then I deleted all the initrds in /boot/ and rebooted. I had to mess with grub to make the system boot but I got it to come up in a way that appeared "normal", however:

http://paste.ubuntu.com/1330432/

Note VFS mounts root partition directly at line 357, and then the pty errors same as in the inital report. Now, the way I messed with grub didn't cause / to be on /dev/root but that's because UUID mounting failed for me, for some reason. However, I'm pretty sure that a missing or corrupted initrd is the cause of this issue, which leads to a situation where you can't make an initrd because you don't have an initrd.

Revision history for this message
Alistair Buxton (a-j-buxton) wrote :

Also, if this was caused by an upgrade, useful logs may be found in /var/log/dist-upgrade

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.