How Do I Fix a "Bad magic number in super-block" error?

Linode Staff

I've recently run into an issue where my Linode is unable to boot. When I looked at the console, I found this error message:

Bad magic number in super-block while trying to open /dev/sda

I've tried rebooting but that doesn't work. How can I fix this?

1 Reply

You'll want to follow the steps below to fix the Bad magic number in super-block error on your Linode. This guide is written for when when the error is in reference to /dev/sda disk, if you're seeing this error for another disk you'll want to swap out /dev/sda with the disk mentioned in the commands below.

  1. Reboot your Linode into Rescue Mode

  2. Run mke2fs -n /dev/sda to find the disks Superblocks backups. Your output should look similar to what's below.

mke2fs 1.45.6 (20-Mar-2020)
Creating filesystem with 12976128 4k blocks and 3244032 inodes
Filesystem UUID: 2500590e-c494-4e0b-ab27-2e000a1fb6d9
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424
  1. Run fsck -b $BACKUPSB /dev/sda to repair your disk using the Superblock backup. As an example, for the output above you'll want to run fsck -b 32768 /dev/sda which uses the first backup block. Enter y to proceed with fixing the errors.
  2. Mount the disk with mount -o barrier=0 /dev/sda /media/sda to confirm the disk has been repaired and can now be mounted.

If your disk successfully mounts, you should be able to reboot your Linode normally and be good to go.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct