Failed to mount ISO with message "mount: wrong fs type, bad option, bad superblock on /dev/loop0"

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 7,8,9
  • ISO Mount

Issue

  • Failed to mount ISO with message "mount: wrong fs type, bad option, bad superblock on /dev/loop0"
# mount -o loop -t iso9660 /root/rhel-server-7.9-source-dvd1.iso /mnt/

mount: /dev/loop0 is write-protected, mounting read-only
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
  • Below messages are reported in dmesg while mounting the ISO:
[90807.131385] ISO 9660 Extensions: Microsoft Joliet Level 3
[90807.155885] ISOFS: changing to secondary root
[90807.158901] isofs_fill_super: root inode is not a directory. Corrupted media?    <<--------------

Resolution

  • Check/Verify the checksum is same of the downloaded ISO and the ISO available on distro site:
To check an md5sum/sha256sum/cksum checksum of a downloaded ISO file
  # md5sum -b filename.iso
  # sha256sum -b filename.iso
  # cksum filename.iso
  • If the checksum is different then download new ISO and try to mount it.

Root Cause

  • ISO could be corrupted.

  • The warning is generated from below code, which indicates ISO may be corrupted:

/* Make sure the root inode is a directory */
    if (!S_ISDIR(inode->i_mode)) {
        printk(KERN_WARNING
            "isofs_fill_super: root inode is not a directory. "
            "Corrupted media?\n");
        goto out_iput;

Diagnostic Steps

Check the messages reported while mounting ISO

Corrupted ISO:

# mount -o loop -t iso9660  /root/rhel-server-7.9-x86_64-dvd1.iso   /mnt  -vvv
mount: /dev/loop0 is write-protected, mounting read-only
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

# dmesg|tail 
[90807.131385] ISO 9660 Extensions: Microsoft Joliet Level 3
[90807.155885] ISOFS: changing to secondary root
[90807.158901] isofs_fill_super: root inode is not a directory. Corrupted media?    <<--------------

Good ISO:

# mount -o loop -t iso9660  /root/rhel-server-7.9-x86_64-dvd.iso   /mnt  -vvv
mount: /dev/loop0 is write-protected, mounting read-only
mount: /dev/loop0 mounted on /mnt.

# dmesg | tail
[ 4438.965622] ISO 9660 Extensions: Microsoft Joliet Level 3
[ 4438.965691] ISO 9660 Extensions: RRIP_1991A
  • Verify the checksum using below command:
# sha256sum -b /root/rhel-server-7.9-x86_64-dvd1.iso         <<---- Corrupted ISO
  61ee074449117c31b1abf6ecf0688ad139fca2e8cdb084e3199aea9bef41502d *rhel-server-7.9-x86_64-dvd1.iso


# sha256sum -b /root/rhel-server-7.9-x86_64-dvd.iso          <<---- Good ISO
  2cb36122a74be084c551bc7173d2d38a1cfb75c8ffbc1489c630c916d1b31b25 *rhel-server-7.9-x86_64-dvd.iso

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments