Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[SOLVED] error: unknown filesystem. grub rescue.

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
davideluque
Posts: 4
Joined: 2019-08-04 19:11

[SOLVED] error: unknown filesystem. grub rescue.

#1 Post by davideluque »

Hello.

I have Debian 9 and Windows 10 installed in my computer.

My computer's battery does not work and someone disconnected it while it was frozen.

When I turn it on, it appears on the screen:

Code: Select all

error: unknown filesystem
grub rescue>
I have read on many pages solutions for this problem but apparently everyone can access the partition where the system is, I do not.

Even when I try to do

Code: Select all

sudo mount /dev/sda5 /mnt/linux
The terminal says: wrong fs type, bad option, bad superblock on /dev/sda5 ...

I have a LiveUSB with Debian that I can use to fix the system, I just do not know how.

Thank you.

If this is not the right place to post this, please tell me where I can do it.
Last edited by davideluque on 2019-08-06 11:59, edited 1 time in total.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: error: unknown fileystem. grub rescue.

#2 Post by Head_on_a_Stick »

davideluque wrote:I have a LiveUSB with Debian that I can use to fix the system, I just do not know how.
https://www.debian.org/releases/stretch ... 07.html.en
deadbang

kedaha
Posts: 3521
Joined: 2008-05-24 12:26
Has thanked: 33 times
Been thanked: 77 times

Re: error: unknown fileystem. grub rescue.

#3 Post by kedaha »

Hi
Looks like the file system got corrupted due to pulling out the battery.
From the grub rescue prompt I reckon you can run fsck /dev/sda5
fsck must be run without mounting the partition.
I suppose fsck will have to be run manually without appending the -a (for automatic) flag.
But you should take a look at the fsck utility first so you know what you're doing.
DebianStable

Code: Select all

$ vrms

No non-free or contrib packages installed on debian!  rms would be proud.

davideluque
Posts: 4
Joined: 2019-08-04 19:11

Re: error: unknown fileystem. grub rescue.

#4 Post by davideluque »

Head_on_a_Stick wrote:
davideluque wrote:I have a LiveUSB with Debian that I can use to fix the system, I just do not know how.
https://www.debian.org/releases/stretch ... 07.html.en
Hello.

Thank you for your response.

I have taken a look on this page and it does not work for me. I did the following:

Code: Select all

grub-installer /dev/sda5 #returns: ls: /dev/sda5/proc: Not a directory.

Code: Select all

grub-installer '(hd0,msdos5)' #returns the same.
'
I am using the shell in the installer environment.'

Any ideas?

davideluque
Posts: 4
Joined: 2019-08-04 19:11

Re: error: unknown fileystem. grub rescue.

#5 Post by davideluque »

kedaha wrote:Hi
Looks like the file system got corrupted due to pulling out the battery.
From the grub rescue prompt I reckon you can run fsck /dev/sda5
fsck must be run without mounting the partition.
I suppose fsck will have to be run manually without appending the -a (for automatic) flag.
But you should take a look at the fsck utility first so you know what you're doing.
Hello and thank you for your response.

The grub rescue prompt does not have the command fsck. However, the debian installer system does and when I do it I get the following:
fsck.ext4: Attempt to read block from filesystem resulted in short read while trying to open /dev/sda5 Could this be a zero-length partition?
Two facts that may be useful:
1. With lsblk I know that Debian is installed in sda5 because that has the same space I allocated for it.
2. I am able to see Windows partition and other two partitions with the LiveCD but I can not see Debian (sda5).

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: error: unknown fileystem. grub rescue.

#6 Post by Head_on_a_Stick »

Try the top voted answer from this thread: https://unix.stackexchange.com/question ... -partition
deadbang

davideluque
Posts: 4
Joined: 2019-08-04 19:11

Re: error: unknown fileystem. grub rescue.

#7 Post by davideluque »

Head_on_a_Stick wrote:Try the top voted answer from this thread: https://unix.stackexchange.com/question ... -partition
Thank you so much, it worked!

For others who might have the same problem.
First you have to identify which is the block where the system is mounted, for this, I used the lsblk command. I knew that my block was /dev/sda5 because I recognized it by its size. If you are not sure, you can boot with gparted live and see the partitions with errors.

Then start the system with Debian live install, follow the steps of the most voted answer (not the one that was accepted).

Notes

I was never able to run the following command:

Code: Select all

mount -o sb=32768 /dev/sdxx /mnt/sdxx
Since the output was always about bad superblock/short read.

So what I did was go straight to run:

Code: Select all

e2fsck -fy -b 32768 /dev/sdxx
And my file system was working again.

I can not guarantee that this works equally for everyone as others may have different configurations, as mentioned in the most voted answer, fs superblocks size may be larger than 4096, or it may not be in 32768.

If you can try to recover your files with ddrescue first, I think it's the best idea. I couldn't do it (I didn't have an external disk) so I took a chance.

Post Reply