0

After a power failure, I had the following error:

error: unknown filesystem
grub rescue>
  1. I ran the Ubuntu repair using a live usb. The log can be found here

  2. After this grub disappeared (I cannot select which OS to boot) and by default I am booting windows now. I have an important application running on Linux but I cannot boot to Linux.

  3. I then edited the grub file and tried to update-grub but it says:

     failed to get canonical path of /cow
    
  4. The next option was to sudo mount /dev/sda5 /mnt But then I get the error:

     mount: you must specify the filesystem type
    
  5. I do not know the filesystem type, since I did not do the installation on this particular machine.

  6. I also tried cat /etc/fstab but it does not show sda5, neither can I see it using blkid command. From the GUI (since i have booted the system from live usb), I can see the partition 5 as having unknown type.

UPDATE: fsck -a -t ext4 /dev/sda5 immediately gives the following error:

fsck from util-linux 2.20.1 fsck.ext4: Bad magic number in super-block while trying to open /dev/sda5 /dev/sda5: The superblock could not be read or does not describe a valid ext2/ext3/ext4 filesystem.

If the device is valid and it really contains an ext2/ext3/ext4 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193 or e2fsck -b 32768

2 Answers 2

1

Test this:

You must boot from a live-dvd/usb.

Open a terminal.

Run it:

sudo -i
fsck -a -t ext4 /dev/sda5
mount /dev/sda5 /mnt
mount --bind /dev /mnt/dev 
mount --bind /dev/pts /mnt/dev/pts
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
chroot /mnt
grub-install --root-directory=/mnt /dev/sda
update-grub
umount /mnt
reboot 
3
  • after fsck -a -t ext4 /dev/sda5 it immediately gives the following error:fsck from util-linux 2.20.1 fsck.ext4: Bad magic number in super-block while trying to open /dev/sda5 /dev/sda5: The superblock could not be read or does not describe a valid ext2/ext3/ext4 filesystem. If the device is valid and it really contains an ext2/ext3/ext4 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193 <device> or e2fsck -b 32768 <device> Sep 30, 2014 at 16:32
  • Welcome to AU! Please include this info in your question. Sep 30, 2014 at 16:54
  • I did this followed by what you mentioned above: sudo e2fsck -b 32768 /dev/sda5 . Saved my day :) Oct 1, 2014 at 9:16
1

According to the rescue log and your comment the header of the file system on sda5, your Linux partition, is seriously broken. You may be able to recover from the backup superblock as described in the output of fsck (from a live system as described by kyodake):

sudo e2fsck -b 32768 /dev/sda5

If that doesn't work, the file system is likely beyond repair. If you have important data on it, you can try to salvage it with data recovery tools, e. g. as described in the community help.

1
  • Yes this worked followed by what Kyodake mentioned. Thanks. You guys saved us a lot of data ! :) Oct 1, 2014 at 9:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .