A decade later, found the same bug in grub.

It might not affect "standard" grub usage (e.g. Ubuntu) where it may not
need to probe and guess filesystem type just to boot the system, but
thank you for the excellent diagnosis nevertheless!

https://lists.gnu.org/archive/html/grub-devel/2020-05/msg00205.html

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to util-linux in Ubuntu.
https://bugs.launchpad.net/bugs/518582

Title:
  mount ext fileystem fails, booting fails, blkid produces no output

Status in util-linux package in Ubuntu:
  Fix Released
Status in util-linux source package in Lucid:
  Fix Released

Bug description:
  Symptoms:  (Ubuntu 9.10 on an ext4 partition /dev/sda1)

  1. Booting fails with error message:

       Gave up waiting for root device. common problems
      -Boot args(cat/proc/cmdline)
      -check rootdelay=(did the system wait long enough?)
      -check root=(did the system wait for the right device?)
       Missing modules(cat/proc/modules; IS/dev)
       Alert!/dev/disk/by-uuid/d3bb8e26-9798-49 ce-bc57-afb6ca6za7ba does not 
exist. Drop to a shell!

  2.  "mount  /dev/sda1  /mnt"  gives  "mount: you must specify the filesystem 
type"
      but  "mount  -t ext4 /dev/sda1"   is successful

  3. "blkid /dev/sda1"  returns nothing

  4.  "blkid  -p /dev/sda1" gives "ambivalent result (probably more
  filesystems on the device)"

  5.  "hexdump -s 0x410 -n 2 /dev/sda1" returns on of the four numbers
  hexadecimals 137f, 138f, 2468,2478,


  6.   "sudo BLKID_DEBUG=0xffff blkid -p /dev/sda1 | grep "minix: magic"
  returns

      "ambivalent result (probably more filesystems on the device)"
       minix: magic sboff=16, kboff=1 

  
  7.  After installing util-linux-ng-2.17 from source:  "wipefs  /dev/sda1"   
returns:

      offset               type
  ----------------------------------------------------------------
  0x410                minix   [filesystem]

  0x438                ext4   [filesystem]
                           UUID:  d3bb8e26-9798-49ce-bc57-afb6ca62a7ba

  
  I was able to cure  the problem by creating a file  on "/dev/sda1" and 
whereby changing  the number of free inodes. 

  There have been seven of these case in the Ubuntu forums by now:
  http://ubuntuforums.org/showthread.php?t=1397193
  http://ubuntuforums.org/showthread.php?t=1414662
  http://ubuntuforums.org/showthread.php?t=1068895
  http://ubuntuforums.org/showthread.php?t=1422558

  
  My diagnosis:

  Minix uses the "magic number" 137f, 138f, 2468,2478,  at  the location
  0x410   to mark a Minix file system.

  0x410 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 0x410 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.

  Cure:

  Boot from the Ubuntu LiveCD and create a file on the affected
  partition:

  sudo mount /dev/sda1 /mnt
  sudo touch /mnt/empty_file

  This solution works for an  ext4 filesystem. But does not work for
  ext2. For ext2 one needs to replace the UUID in fstab and grub.cfg by
  the device name. See
  
https://sourceforge.net/apps/mediawiki/bootinfoscript/index.php?title=Boot_Problems:minix
  for more details.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/518582/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to