update-grub install-grub - error: unknown filesystem

8,692

I had this error on a ext4 filesystem (without RAID). So maybe your problem is completely different. But in case it's useful for others landing here like I did:

When an ext4 filesystem has the metadata_csum_seed feature enabled, then grub-install will not work and report this grub-install: error: unknown filesystem error.

This is documented in Debian bug 866603 which also has a simple test for the problem:

grub-probe --target=fs --device /dev/sda1

It will give the same error if sda1 has that feature enabled.

You can also use tune2fs to check:

tune2fs -l /dev/sda1 | grep metadata_csum_seed

and you can disable the feature with

tune2fs -O ^metadata_csum_seed /dev/sda1
Share:
8,692

Related videos on Youtube

Michael
Author by

Michael

Updated on September 18, 2022

Comments

  • Michael
    Michael over 1 year

    My root partition is /dev/md0, I changed the size of the partition and filesystem. Now when I run update-grub and install-grub it fails:

    # grub-install /dev/sda
    Installing for i386-pc platform.
    grub-install: error: unknown filesystem.
    
    # update-grub
    Generating grub configuration file ...
    Found linux image: /boot/vmlinuz-4.4.0-67-generic
    Found initrd image: /boot/initrd.img-4.4.0-67-generic
    /usr/sbin/grub-probe: error: unknown filesystem.
    Found linux image: /boot/vmlinuz-4.4.0-66-generic
    Found initrd image: /boot/initrd.img-4.4.0-66-generic
    /usr/sbin/grub-probe: error: unknown filesystem.
    Found memtest86+ image: /boot/memtest86+.elf
    Found memtest86+ image: /boot/memtest86+.bin
    done
    

    .

    # cat /proc/mdstat
    ...
    md0 : active raid1 sda1[1] sdb1[0]
          14553024 blocks [2/2] [UU]
    
    unused devices: <none>
    

    .

    # cat /proc/partitions
    major minor  #blocks  name
    
       8        0   39082680 sda
       8        1   14553088 sda1
       8       16   15646680 sdb
       8       17   14553088 sdb1
       9        0   14553024 md0
    

    I don't dare reboot this server until this is fixed. Any suggestions?

    • Yaron
      Yaron about 7 years
      how did you change the size of the partition?
    • Yaron
      Yaron about 7 years
      take a look at this answer
    • Michael
      Michael about 7 years
      To change size: remove raid partition from md, create new larger partition, add new larger partition, wait for sync, make md larger 'mdadm --grow /dev/md0 --size max', make filesystem larger resize2fs /dev/md0', remove other raid partition, copy partition table to other disk using sfdisk, add other parition to md, sync. Mostly using instructions like this howtoforge.com/…
    • Michael
      Michael about 7 years
      Thanks for l ink, but not sure how it helps. it just says update-grub && grub-install /dev/sda. This is a server, graphical options are not available.
  • shouldsee
    shouldsee almost 5 years
    Saved my day!!! Grub should probably make a more informative message.
  • Adrien Beau
    Adrien Beau over 3 years
    Wow, thank you for writing that answer, which is spot on. Apparently, this problem can also occur for other recently added ext4 features: casefold and large_dir. GRUB does not (yet) know about them, and since they are marked "incompat" in ext4, GRUB does what any ext4 program should do in such a case: refuse to work with the filesystem. Hopefully the fix is trivial, at least for the checksum feature.
  • Adrien Beau
    Adrien Beau over 3 years
    The ea_inode feature also cannot be used with GRUB. Even worse in that case, the feature cannot be disabled with tune2fs, the filesystem must be recreated from scratch.