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

 

 

 

Grub Rescue - error: file not found

Ask for help with issues regarding the Installations of the Debian O/S.
Message
Author
janusz
Posts: 10
Joined: 2013-05-23 13:58

Grub Rescue - error: file not found

#1 Post by janusz »

I have recently switched to Debian. After installation it was running fine.
I update it and I had some dpkg problems and ended up messing something up when I was trying to fix that.

In short, I am now stuck at the Grub Rescue - error:file not found.

I have a dual boot Windows 7 / Debian setup onto a partitioned drive in an Asus F8Va laptop.

I have found similar post and tried to solve it using the following:

1) I tried booting from my live image to be able to re-install GRUB. PROBLEM: my computer does not want to use it for some reason. I have my boot set for USB first since this is how I installed my Debian distro. And to double check I plugged the USB into another laptop and of course the menu pops up and I was able to use the Debian LIVE.[/list]

2) Directly in the rescue mode:
a)
  • Code: Select all

    ls
    (hd0) (hd0, msdos6) (hd0,msdos5) (hd0,msdos2) (hd0,msdos1) (hd1) (hd1,msdos1) 
    
    hd0 is my laptop disk and hd1 my USB drive (I tried it both with and without hd1)
b)
  • Next I checked what is in each folder.

    Code: Select all

    ls (hd#,msdos#)/
    For (hd0,msdos,5 and 6), I received: "error: unknown filesystem"
    For (hd1,msdos1), the linux USB, I received: "error: unknown filesystem"
    For (hd0, msdos1,2) I got a list of windows files.

    So 5,6 are the partitions where linux is installed.
c)
  • Code: Select all

    set root=(hd#,#)
    set prefix=(hd#,#)/boot/grub
    insmod normal ---> error:file not found
    

And I get stuck since I cannot boot into linux to sudo update-grub

My frustration is now turning into a bit of panic so I am reaching out. Any help is appreciated.

Thank you,
J

dibl
Posts: 528
Joined: 2009-10-13 19:50
Location: Dayton, Ohio, USA

Re: Grub Rescue - error: file not found

#2 Post by dibl »

janusz wrote:I tried booting from my live image to be able to re-install GRUB. PROBLEM: my computer does not want to use it for some reason. I have my boot set for USB first since this is how I installed my Debian distro.
This is a problem -- I think you'll have to figure out why your BIOS is not seeing the USB stick. This may be related to the other error. Do you have other bootable USB devices to try?
Debian sid / siduction KDE

janusz
Posts: 10
Joined: 2013-05-23 13:58

Re: Grub Rescue - error: file not found

#3 Post by janusz »

If you mean CD/DVD then no. My drive hasn't worked for a while.

The USB drive is being seen since when I do ls in Grub Rescue it shows up (hd1) (hd1,msdos1) and the Bios was able to see it when I installed Debian so I think its more of a Grub issue.

dibl
Posts: 528
Joined: 2009-10-13 19:50
Location: Dayton, Ohio, USA

Re: Grub Rescue - error: file not found

#4 Post by dibl »

Assuming there is in fact a problem with grub, it could be reinstalled in a chroot, but you can't chroot into your system unless you can boot a linux operating system. That's why you need to figure out what it would take to boot a Live USB stick (if you can't boot a Live CD).
Debian sid / siduction KDE

patrick013
Posts: 84
Joined: 2013-02-07 19:08

Re: Grub Rescue - error: file not found

#5 Post by patrick013 »

This is how I booted the other day from grub rescue

grub rescue> insmod linux.mod
grub rescue>set root=hd3,msdos1 (has to be the right one)
grub rescue>linux /boot/vmlinuz root=/dev/sdd1 (needs the exact vmlinuz number)
grub rescue>initrd /boot/initrd.img (needs the exact initrd.img number)
grub rescue>boot

See if that boots.

Then run grub-install for /dev/sdX (the block device where grub2 should be)
Then run update-initramfs for all initrd's
Then run update-grub.

Then reboot.

Let me know if that works then.

janusz
Posts: 10
Joined: 2013-05-23 13:58

Re: Grub Rescue - error: file not found

#6 Post by janusz »

gryb rescue> insmod linux.mod
error: file not found.

patrick013
Posts: 84
Joined: 2013-02-07 19:08

Re: Grub Rescue - error: file not found

#7 Post by patrick013 »

ignore that and continue then

thx

edit: insmod (enter)
then: insmod normal (use that if boot doesn't work)

User avatar
dasein
Posts: 7680
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Grub Rescue - error: file not found

#8 Post by dasein »

Just for the record, even if you're feeling frustrated, posting the same question three times in less than two hours is considered very bad manners.

Triple-posting won't get you help three times faster, but it is three times more likely to result in folks ignoring your posts.

janusz
Posts: 10
Joined: 2013-05-23 13:58

Re: Grub Rescue - error: file not found

#9 Post by janusz »

Patrick,

I tried your advice but it seems that Grub cannot read the partitions with linux on them (hd0, msdos5) and (hd0, msdos6) ie unknown error: unknown filesystem..

I only know this since I can read (hd0, msdos2) and (hd0,msdos1) have windows files in them and I can list them using ls.

Even if I set 5 or 6 as root I still can't run
linux /boot/vmlinuz root=/dev/sdd1
I get
Unknown command 'linux'


To all,
Sorry for triple posting, my mistake.

patrick013
Posts: 84
Joined: 2013-02-07 19:08

Re: Grub Rescue - error: file not found

#10 Post by patrick013 »

hi,

you need to know the /dev/sdx number where grub.cfg is
and the corresponding number where grub.cfg is for root=

grub rescue> ls (enter) will give you a list for set root=

I know it's hard guessing those numbers, write them down
on a piece of paper.

also vmlinuz needs to be something like vmlinuz-3.2.0-4-686-pae
and initrd needs to be initrd-3.2.0-4-686-pae (from your /boot directory)
root= needs to be /dev/sdx (the partition where /boot is in linux)
try df (enter from a terminal when that partition is mounted) for a list
of /dev/sdx's

Don't give up yet, I'll try to think of a way to make it easier.
you're only an item or 2 away from booting that install.

janusz
Posts: 10
Joined: 2013-05-23 13:58

Re: Grub Rescue - error: file not found

#11 Post by janusz »

after ls:

(hd0) (hd0, msdos6) (hd0,msdos5) (hd0,msdos2) (hd0,msdos1)

where 1 and 2 have windows files
where 5 and 6 I cannot read

I tried :
grub rescue>set root=hd0,msdos5
grub rescue>linux /boot/vmlinuz-3.2.0-4-686-pae root=/dev/sdd5

OR

grub rescue>set root=hd0,msdos6
grub rescue>linux /boot/vmlinuz-3.2.0-4-686-pae root=/dev/sdd6

both cases I get Unknown command 'linux'

patrick013
Posts: 84
Joined: 2013-02-07 19:08

Re: Grub Rescue - error: file not found

#12 Post by patrick013 »

janusz wrote:after ls:

(hd0) (hd0, msdos6) (hd0,msdos5) (hd0,msdos2) (hd0,msdos1)

both cases I get Unknown command 'linux'
Well good so far. We need to know exact if 5 or 6 contain
the grub.cfg 5 is before 6 so is grub.cfg in 5 or 6

Try df (enter) from a livecd or other terminal, the one with debian s/b 5 or 6,
the right one is the lower or the higher number. That will help.

edit:

grub rescue> insmod (hd0,msdos5)/boot/grub/linux.mod
grub rescue> insmod (hd0,msdos6)/boot/grub/linux.mod

One of the above is needed to get linux.mod to work. That's where
grub.cfg is at. Which one works then ? Almost done if one works then.


With that info we should be able to do insmod linux.mod to allow the
"linux" command to work. linux.mod is in /boot/grub/linux.mod
you will see it there.

thx for your patience.

once you do this and write it down it will be easy :D

janusz
Posts: 10
Joined: 2013-05-23 13:58

Re: Grub Rescue - error: file not found

#13 Post by janusz »

First off, Thank you for being so patient with me....you're helping me :)

I ran a live USB copy of the same Debian I installed (but on a different computer since I can't get it to run on mine)...

df

Code: Select all

root@debian:/home/user# df
Filesystem     1K-blocks    Used Available Use% Mounted on
rootfs           1546872   14580   1532292   1% /
udev               10240       0     10240   0% /dev
tmpfs             309376     756    308620   1% /run
/dev/sdb1        7806930 1454774   6352156  19% /lib/live/mount/medium
/dev/loop0       1056256 1056256         0 100% /lib/live/mount/rootfs/filesystem.squashfs
tmpfs            1546872       0   1546872   0% /lib/live/mount/overlay
tmpfs            1546872       0   1546872   0% /lib/live/mount/overlay
aufs             1546872   14580   1532292   1% /
tmpfs               5120       0      5120   0% /run/lock
tmpfs             618740      84    618656   1% /run/shm
/dev/sr1            6828    6828         0 100% /media/U3 System
root@debian:/home/user# 
so I tried:
grub rescue> insmod (hd0,msdos5)/boot/grub/linux.mod
OR
grub rescue> insmod (hd0,msdos6)/boot/grub/linux.mod

and get error: unknown filesystem

patrick013
Posts: 84
Joined: 2013-02-07 19:08

Re: Grub Rescue - error: file not found

#14 Post by patrick013 »

long story short,

msdos5 or msdos6 have debian, so.....

grub rescue>set root=hd0,msdos5
grubrescue>insmod /boot/grub/linux.mod
grub rescue>linux /boot/vmlinuz-3.2.0-4-686-pae root=/dev/sda5
grubrescue>initrd /boot/initrd.img-3.2.0-4-686-pae
grubrescue>boot

or:

grub rescue>set root=hd0,msdos6
grubrescue>insmod /boot/grub/linux.mod
grub rescue>linux /boot/vmlinuz-3.2.0-4-686-pae root=/dev/sda6
grubrescue>initrd /boot/initrd.img-3.2.0-4-686-pae
grubrescue>boot

One of the above has to boot.

Sometimes syntax changes and debian recently upgraded grub2 so...

But that linux.mod is needed, try tomorrow then. See Ya'

Keep exact notes which commands did work with the grub2 rescue prompt

THX

janusz
Posts: 10
Joined: 2013-05-23 13:58

Re: Grub Rescue - error: file not found

#15 Post by janusz »

I tried all of the commands even though I get that the commands won't work without the loading of the module using insmod, just to be thorough.

Code: Select all

grub rescue>set root=hd0,msdos5                                    Works
grubrescue>insmod /boot/grub/linux.mod                             Does not work => error: unknown filesystem.
grub rescue>linux /boot/vmlinuz-3.2.0-4-686-pae root=/dev/sda5     Does not work => Unknown command 'linux'
grubrescue>initrd /boot/initrd.img-3.2.0-4-686-pae                 Does not work => Unknown command 'initrd'
grubrescue>boot                                                    Does not work => Unknown command 'boot'

or:

grub rescue>set root=hd0,msdos6                                    Works
grubrescue>insmod /boot/grub/linux.mod                             Does not work => error: unknown filesystem.
grub rescue>linux /boot/vmlinuz-3.2.0-4-686-pae root=/dev/sda6     Does not work => Unknown command 'linux'
grubrescue>initrd /boot/initrd.img-3.2.0-4-686-pae                 Does not work => Unknown command 'initrd'
grubrescue>boot                                                    Does not work => Unknown command 'boot'

I'm going to keep trying, let me know if anything else comes to mind.

patrick013
Posts: 84
Joined: 2013-02-07 19:08

Re: Grub Rescue - error: file not found

#16 Post by patrick013 »

janusz wrote: I'm going to keep trying, let me know if anything else comes to mind.
Those are all the commands I know and that do work on my computer.

You might consider a reinstall in a few days. Write those commands down
tho, they do work.

HELP ! Maybe it's just a syntax problem.

take care,

Patrick

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 13 times
Been thanked: 66 times

Re: Grub Rescue - error: file not found

#17 Post by dilberts_left_nut »

janusz wrote:

Code: Select all

error: unknown filesystem
This would appear to be the issue.
What does 'fdisk -l' show?
AdrianTM wrote:There's no hacker in my grandma...

User avatar
kiyop
Posts: 3983
Joined: 2011-05-05 15:16
Location: Where persons without desire to improve themselves fear to tread, in Japan
Been thanked: 3 times

Re: Grub Rescue - error: file not found

#18 Post by kiyop »

Excuse that I have not read through this thread thoroughly.

Can you boot any linux on your problematic PC?
If you can, try what dilberts_left_nut suggested: 'fdisk -l', and further (of course, with root privilege):

Code: Select all

fsck -f /dev/sda5
fsck -f /dev/sda6
blkid
mkdir mnt
mount -t auto /dev/sda5 ./mnt
ls ./mnt/
umount -l ./mnt
mount -t auto /dev/sda6 ./mnt
ls ./mnt/
umount -l ./mnt
and post the result.

If you cannot, at "grub rescue" command prompt, execute the following and post the results:

Code: Select all

ls (hd0,msdos5)
ls (hd0,msdod6)
set prefix="(hd0,msdos5)/boot/grub"
insmod ext2
set root="(hd0,msdos5)"
ls /
ls (hd0,msdos6)/
First and second commands are to show detail information on /dev/sda5 and /dev/sda6, such as filesystem. Do not add extra "/" at the end.

Did you apply encryption, raid, lvm or so when you installed debian?

I wonder if /dev/sda5=(hd0,msdos) is debian / partition and if /dev/sda6=(hd0,msdos6) is swap.

I wonder if files in grub directory are corrupted or filesystem of /dev/sda5 or /dev/sda6 is corrupted.
Maybe installation of some package failed. Maybe there is no space in the partition.

Can you change BIOS setting of the PC so that the PC can boot from an USB stick?

What is the filesystem of the installed debian /(root) partition? ext3 ? ext4? or ... ?
Openbox, JWM: Jessie, Sid, Arch / Win XP (on VirtualBox), 10
http://kiyoandkei.bbs.fc2.com/

janusz
Posts: 10
Joined: 2013-05-23 13:58

Re: Grub Rescue - error: file not found

#19 Post by janusz »

I managed to get a boot going from a usb key finally and re-installed Debian (turns out for some reason I needed to press "Esc" to get a selection of booting from USB, something I've never had before on this computer, not even at install).

Even though I ended up solving it, I'm just going to add a couple of comments to see maybe you guys will see my mistake:

- During my initial install, from a USB, I noticed I could not do the install until I installed the Debian-Installer loader on Windows 7 (never had to do this before when doing a dual boot with linux before).

-
dilberts_left_nut wrote:
What does 'fdisk -l' show?
I didn't get a chance to try this as I saw it after I re-installed.

-
kiyop said:

Code: Select all

ls (hd0,msdos5)
ls (hd0,msdod6)
set prefix="(hd0,msdos5)/boot/grub"
insmod ext2
set root="(hd0,msdos5)"
ls /
ls (hd0,msdos6)/
I could not do ls on those partitions or set prefixes. The only command I didn't try is "insmod ext2"...

-
kiyop wrote:
Did you apply encryption, raid, lvm or so when you installed Debian?
I created my partitions in an empty part of the drive, and didn't change any settings for such things, so unlikely.

-
kiyop wrote:
I wonder if /dev/sda5=(hd0,msdos) is debian / partition and if /dev/sda6=(hd0,msdos6) is swap.
Yes it was and the same was created by default when I re-installed.

-
kiyop wrote:
I wonder if files in grub directory are corrupted or filesystem of /dev/sda5 or /dev/sda6 is corrupted.
Maybe installation of some package failed. Maybe there is no space in the partition.
I think this might have been the culprit. I started having trouble after I started the updates and then noticed I was having problems with the dpkg. I restarted and that's when I ended up in "grub rescue".

-
kiyop wrote:
Can you change BIOS setting of the PC so that the PC can boot from an USB stick?
I had the settings on booting from USB stick, turns out I needed to press Esc to boot from the stick, like I mentioned above its never happened before.

-
kiyop wrote:
What is the filesystem of the installed debian /(root) partition? ext3 ? ext4? or ... ?
sda5 -> ext3 sda6 - > swap

-
kiyop wrote:

Code: Select all

fsck -f /dev/sda5
fsck -f /dev/sda6
blkid
mkdir mnt
mount -t auto /dev/sda5 ./mnt
ls ./mnt/
umount -l ./mnt
mount -t auto /dev/sda6 ./mnt
ls ./mnt/
umount -l ./mnt
I didn't do this exactly since I saw your suggestion after I re-installed my system.
Just before my re-install, I ran Debian live and tried to make sure the mount points were OK but I couldn't get access to sda for some reason.


It looks like it may just have been that something got corrupted during the re-install.

Thank you all again!

User avatar
kiyop
Posts: 3983
Joined: 2011-05-05 15:16
Location: Where persons without desire to improve themselves fear to tread, in Japan
Been thanked: 3 times

Re: Grub Rescue - error: file not found

#20 Post by kiyop »

Thanks for your report. Congratulations on your reinstall :)
To enter into BIOS and/or UEFI configuration menu, the following keys may be of help:
Esc
F2
DEL
F10
F12

Please add "[Solved]" or so to the title of the first post of yours http://forums.debian.net/viewtopic.php? ... 46#p498486 in this thread by clicking "EDIT".
Openbox, JWM: Jessie, Sid, Arch / Win XP (on VirtualBox), 10
http://kiyoandkei.bbs.fc2.com/

Post Reply