7

My machine is a desktop Ubuntu (no dual boot). The PC is unable to pass the Ubuntu screen at bootup. After a few mins, it falls back on a screen asking for the following: maintenance or reboot. I have 1Tb SSD drive. I removed all other secondary drives. When I run sudo fdisk -l, I get the following:

Device      Start        End          Sectors      Size   Type
/dev/sda1   2048         1050623      1048576      512M   EFI System
/dev/sda2   1050624      1052671      2048         1M     Bios boot
/dev/sda3   1984313344   2051198975   66885632    31.9G   Linux Swap
/dev/sda4   1052672      1984313343   1983260672  945.7G  Linux filesystem

Then I run fsck /dev/sdaX with X=1,2,3 or 4. All partitions X=1,3,4 I get no error. But for fsck /dev/sda2, the output is:

ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks ...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sda2

The superblock could not be read or does not describe a valid ext2/ext3/ext4 filesystem....you might try running e2fsck with an alternate superblock:

e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>

I am not sure what I should try: e2fsck -b 8193 /dev/sda? or e2fsck -b 8193 /dev/sda2

Thank you for any suggestions!

JMarc
  • 173
  • The fsck is for the ext family of file systems or ext2, ext3 & ext4. There are parameters to run dosfsck on FAT32 with fsck.vfat. But your sda2 is a bios_grub partition. That is totally unformatted space (or should be) and no fsck can or should be run on it. So ignore any errors on it. It is just for grub2's core.img when booting in BIOS boot mode. If you also have an ESP - efi system partition or your sda1, then you may be booting in UEFI mode. Then the bios_grub is not used. I normally do have both ESP & bios_grub on many drives, but that is only so later I could convert from UEFI to BIOS. – oldfred Jun 20 '18 at 21:14
  • @oldfred See below... ;-) – Fabby Jun 20 '18 at 21:51
  • See man fsck or man e2fsck - e2fsck - check a Linux ext2/ext3/ext4 file system. You cannot fsck an unformatted partition, it must have a Linux format. And bios_grub is must be unformatted. – oldfred Jun 20 '18 at 23:15

2 Answers2

3

You have a serious error, so the best thing to do before you start is to make an identical copy of your SSD to another SSD or HDD larger or equal to your current size. CloneZilla Live is the easiest way to do that. If you make a mistake or something else goes wrong you'll have an up-to-date image to fall back to.

No? You want to live dangerously and totally mess up your system and lose all data??? OK, your choice! Just execute:

e2fsck -b 8193 /dev/sda

and if that fails:

e2fsck -b 32768 /dev/sda

because the hint is in the <device>:

  • /dev/sda is your SSD (device)
  • /dev/sda1 is the first partition on your first device.

Oh, did I mention that if the second command fails, you have to restore your image and come back and ask a new question?

Fabby
  • 34,259
  • Thanks Fabby! I am not very sure what I was expecting as an answer but something like "do step1 && step2, and you should be good!!" would have made my day. I will try the e2fsck... lines and I guess I 'll talk to u later with a new question. – JMarc Jun 20 '18 at 22:22
  • 1
    So you're not going to make a backup first? Good luck! (95% chance it'll work though) ;-) @JMarc Oh, by the way: this was your first warning even SSDs die: *you need to start thinking about backups!* – Fabby Jun 20 '18 at 22:24
  • I 'll do a backup!! the stuff on the disk is too valuable, at least to me! 5% chance it might fail: that's too high. Thanks again for the answer. – JMarc Jun 20 '18 at 22:55
  • You're welcome... Favour returned: Q upvoted... ;-) – Fabby Jun 20 '18 at 22:58
0

You just need to uninstall or update ext2fsd in your Windows. However, in order to bring your Linux back temporarily or urgently, you may write the command below in the black screen you see the error:

e2fscl -c <-y> where you may write your Linux partition instead of ; for instance, /dev/sdb7. you either add -y or press y whenever the running command asks you for it. Be aware, it may take minutes!