[SOLVED] error: unknown filesystem. grub rescue.

If none of the more specific forums is the right place to ask

[SOLVED] error: unknown filesystem. grub rescue.

Postby davideluque » 2019-08-04 19:24

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.
davideluque
 
Posts: 4
Joined: 2019-08-04 19:11

Re: error: unknown fileystem. grub rescue.

Postby Head_on_a_Stick » 2019-08-04 19:35

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
User avatar
Head_on_a_Stick
 
Posts: 10321
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: error: unknown fileystem. grub rescue.

Postby kedaha » 2019-08-04 19:58

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.
Mate DE & OSSv4.
LaMp, WordPress; ispmail
Debian Stable

Words, as is well known, are the great foes of reality. Joseph Conrad.
Kedaha's Conjecture
User avatar
kedaha
 
Posts: 2903
Joined: 2008-05-24 12:26

Re: error: unknown fileystem. grub rescue.

Postby davideluque » 2019-08-04 21:29

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.

Postby davideluque » 2019-08-04 21:35

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).
davideluque
 
Posts: 4
Joined: 2019-08-04 19:11

Re: error: unknown fileystem. grub rescue.

Postby Head_on_a_Stick » 2019-08-05 14:03

Try the top voted answer from this thread: https://unix.stackexchange.com/question ... -partition
User avatar
Head_on_a_Stick
 
Posts: 10321
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: error: unknown fileystem. grub rescue.

Postby davideluque » 2019-08-06 11:56

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.
davideluque
 
Posts: 4
Joined: 2019-08-04 19:11


Return to General Questions

Who is online

Users browsing this forum: No registered users and 9 guests

fashionable