Hit by a really nasty bug in Ubuntu

I was booting my laptop into Ubuntu and noticed it was stuck immediately after starting the kernel. Rebooting into recovery mode gave me a message that it could not mount the root file system.

Didn’t have a clue why it didn’t want to do this. Some googling brought me to this Ubuntu bug. The problem according to the bug is the following:


Minix uses the “magic number” 137f, 138f, 2468,2478, at the location 0×410 to mark a Minix file system.

0×410 is also the location any ext filesystem uses to record the number of free inodes.

In decimals those four numbers are 4991,5007,9320,9336

If the number of free inodes happens to be one of those four numbers plus a multiple of 65536, then the ext filesystem will write one of the four Minix magic numbers to the 0×410 location.

So blkid gets confused and does not know whether the files system is Minix or Ext.
In particular, if this happens on the root partition, Ubuntu will no longer boot.


So in theory this happens once every 16384 times when you boot (4 out of a possible 65536 values for location 0×410  trigger this bug). Solution is simple just boot from a live-CD and remove a few files from your boot partition and reboot.

So far several people have confirmed this bug but I’d expect much more people to be affected by it if the probability is really 1 in 16384.

Share

14 Responses to “Hit by a really nasty bug in Ubuntu”

  1. z says:

    I was this bug as well a month ago. I initialy thought it was a harddisk failure.

  2. You say this is an ‘Ubuntu’ bug, but nothing in it seems particularly Ubuntu-specific; shouldn’t it be reported upstream to the ext fs devs?

  3. Joe Buck says:

    Based on the discussion, the real probability of hitting the bug is much lower; the magic number is a necessary but not a sufficient condition to falsely detect the filesystem as Minix.

  4. Juan Carlos Bodoque says:

    Interesting. It seems I hit this bug some days ago (may be a week or so). I thought it was a hard disk problem, so I booted the computer with an usb key and updated my backups. Later I gave it the root fs directly on grub (root=/dev/sda5).

  5. xurfa says:

    Could You, please, STOP using “Ubuntu” for “Linux”? There are many other Linux distributions than Ubuntu!

    • Filip says:

      Why? The ordinary user sees “Ubuntu” on splash, “Ubuntu” on the CD, “Ubuntu” on the web. When searching for a help, they search for “ubuntu” again, as the user often can not decide whether the bug/feature is distro-specific. Moreover, it is not sure this has not been fixed in another distro. There is no reason for not using “Ubuntu” instead of the kernel’s name.

  6. Jens Georg says:

    Ahhhhhhh – That explains the strange “filesystem suicide” a openSUSE committed

  7. hellboy says:

    I thing, when somebody says Ubuntu – he probably means Ubuntu not GNU Linux.

  8. blueblended says:

    when changing MODULES=dep in /etc/initramfs-tools/initramfs.conf and update the initramfs shouldn’t only the needed fs-drivers be loaded. this would be a workaround, i guess…

    a ‘update-initramfs -c -u -v’ gives me only the ext4 module as the filesystem module added to the initramfs since i use no minix fs.

    <3