initramfs fails to mount ext4 root partition or provide user intervention (even when ext4 module is available in the image)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
klibc (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Bug Description
Binary package hint: initramfs-tools
The init scripts in initramfs do not mount an ext4 root partition, this leaves the user stuck at an (initram) prompt at a point that is too late for the user to correct matters. There are a few TODO notes in the local script that mention that there is not error handling when the FSTYPE detection or root mount fails. This should be addressed.
When dropped to the (initram) I was able to "modprobe ext4; mount /dev/sda1 /root", but attempting to run "exec init", resulted in a Kernel Panic.
The init local script had continued running past the root mount failure, so commands like these:
mount -n --bind /root/dev /dev/.static/dev
mount -n --move /dev /root/dev
mount -n --move /proc /root/proc
mount -n --move /sys /root/sys
had already been attempted before I could intervene and manually mount root. Running them myself, and trying to finish off the local script (which ends with something like "exec run-init .... </root/dev/console > /root/dev/console ... " resulted in a kernel panic that /root/dev/console could not be found.
I don't know why the ext4 mount was not successfully mounted, but I was able to work around this by adding a /etc/initramfs-
#! /bin/sh
modprobe ext4
mount /dev/sda1 /root
mount /dev/disk/
I also copied this script to local-top. I am mounting it twice and in both locations because I'm not sure which 'mount' command worked or when the device file is available. The first attempt I made at this workaround was to do "modprobe ext4; mount /dev/sda1 /root" from local-top (see bug #309758). That gave the error that /dev/sda1 was not a device file - I suppose that is created by a script run later. It existed by the time I got the (initramfs) prompt.
Related branches
description: | updated |
description: | updated |
I believe in one of the conditions where I tried to work from the (initram) prompt the error I received when trying to move on to the root partitions /sbin/init was that ~ "(null) was an invalid runlevel".