Friday, October 1, 2010

Ubuntu Update mess up: udevadm trigger is not permitted while udev is unconfigured

My cooperate environment forces me to only run Ubuntu in a virtual machine. So basically all the "real" work is done in VM. So my problem is most likely not related to that fact directly, but I won't blame Ubuntu for this problem. The problem occurred with the first reboot after a system updates which involved a new kernel version. During booting up the system issues "udevadm trigger is not permitted while udev is unconfigured" message and brought me to a limited shell.
Most likely this has been caused by not finishing the kernel installation completely. Likely to happen if you run from meeting to meeting and you host system tends to crash from time to time (See update on this one below).
Anyway - like always, I asked Google and here we go. Steps to recover are:
  1. Grab some boot-able Linux iso and boot a Live System
  2. Mount relevant hard disk  partition read-writable
  3. Bind parts of the life file system to the new mounted hard disk partition
  4. Chang the file system root.
  5. Fix udev configuration for the new installed kernel.
Sounds easy and actually has been - once you figured out the necessary steps.

For Step 1 I decided to download a preview version of Ubuntu 10.10 - which looks great btw. Just boot it with the "try it" option and create a terminal window.

Step 2 is easy as well. Only two things to remember. You need to know which device (e.g. something like /dev/sda holds the relevant system folders and you need to make sure that you really mount the file system read-writeable - default is read-only. So issue something along the lines of "sudo mount -rw -v /dev/ /mnt" in the terminal.

Step 3 requires to bind  /dev, /proc and /sys from the life system into the just mounted hard disk partition. This can be done by:

sudo mount --bind /mnt/dev
sudo mount --bind /mnt/proc
sudo mount --bind /mnt/sys

Step 4 is an easy piece of cake. Just issue "sudo chroot /mnt" and its done.

Finally for step 5 you need to navigate to the folder which holds your installed kernels (usually /boot), figure out which kernel is the current one and issue

sudo update-initramfs -u -k   

That did the trick for me. After rebooting the machine everything was fine again. I hope I remember my blog post next time this happen to me ;-). Input for the resolution is taken from here and here.

Update: And yes indeed - the update not properly finished. Next time I tried to start the packet manager, it forces me to run sudo dpkg --configure -a command and among others 

Setting up python-aptdaemon (0.11+bzr345-0ubuntu4.1) ...
Setting up sudo (1.7.2p1-1ubuntu5.2) ...
Setting up ubufox (0.9~rc2-0ubuntu2.1) ...
Processing triggers for menu ...
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-2.6.32-24-generic

the update-initramfs has been triggered. Next time I will focus a little more on the running update to have it finishing properly :-)