grubrescue interview questions
Top grubrescue frequently asked interview questions
I have installed Ubuntu as dualboot with Windows 7. Now I'm no longer using Ubuntu so i removed the Ubuntu partition and added the unallocated space to my Windows 7 partition.
But after I restart my computer it goes directly to the error:
error: unknown filesystem
grub rescue >
I don't have the original Windows CD to fix the MBR.
Is there a way to fix this error without using the Windows CD?
Source: (StackOverflow)
I just installed quite a lot of 12.10 updates, was prompted to reboot, and then found that I couldn't boot.
Source: (StackOverflow)
I was dual-booting Windows 7 and Linux Ubuntu on my desktop, and today is the day they gave out free Windows 10 upgrades. How exciting! I got the update, and it was installing, and I left to go take a 30 minute nap. However, when I came back to my computer, it led me to the grub rescue prompt.
error: no such partition.
Entering rescue mode...
grub rescue>
I get the following when I type ls
:
grub rescue> ls
(hd0) (hd0,msdos5) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1)
After a quick look through of people who encountered the grub rescue prompt, I typed set
and got the following
grub rescue> set
cmdpath=(hd0)
prefix=(hd0,msdos6)/boot/grub
root=hd0,msdos6
I was still kind of lost after finding that certain commands like normal
didn't work, and then I found a video tutorial where you boot from a Linux image cd and run some commands on the terminal. Luckily, I had my CD with me, and booted from there. When I typed sudo fdisk -l
into the terminal however, this is what I got:
ubuntu@ubuntu:~$ sudo fdisk -l
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc03ede74
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 206847 102400 7 HPFS/NTFS/exFAT
/dev/sda2 206848 1547022335 773407744 7 HPFS/NTFS/exFAT
/dev/sda3 1547022336 1547943935 460800 27 Hidden NTFS WinRE
/dev/sda4 1547945982 1953521663 202787841 f W95 Ext'd (LBA)
/dev/sda5 1915731968 1953521663 18894848 7 HPFS/NTFS/exFAT
Says here none of my devices has the Linux system in them! And I couldn't follow the video tutorial any more than that...
I teased my brain a little and determined that sda2 contained my Windows system (since I remember my C: drive has around 700-ish GB of space). After thinking a little bit more, I remember assigning around 200-ish GB of my hard disk space to something that's Ubuntu related when installing Ubuntu. I don't exactly remember which, but I think it was basically Ubuntu "hard disk space", and it didn't have any boot files in them. I assigned two other things for linux, but they were very small in size (not breaking the 1 GB mark yet).
So, can anyone here help me out get my upgrade back on track? I won't mind if I end up having to completely remove the partitions that have Linux in them.
Source: (StackOverflow)
I did a dumb thing... I forgot that Ubuntu 10.04 (Lucid Lynx) switched to GRUB 2 which puts a ton of *.mod files (kernel modules) in /boot/grub
. I thought they were soundtrack files put there erroneously, and I moved them. Needless to say, the next reboot was traumatic. I was presented with something I had no memory of ever seeing... a 'grub rescue>' prompt.
With the help of Fixing GRUB error: “error: unknown filesystem” however, I was able to recover...
- I discovered that GRUB rescue does not have 'cd', 'cp' or any other filesystem commands except its own variation of 'ls'.
So first I had to find the partition with the /boot
directory containing vmlinuz
file and other boot image files... (approximation from memory of failed attempts, as well as blank lines for clarity, added 2014-07-10 by docsalvage)
grub rescue> ls
(hd0,4) (hd0,3) (hd0,2) (hd0,1)
grub rescue> ls (hd0,4)/boot
... some kind of 'not found' message
grub rescue> ls (hd0,3)/boot
... some kind of 'not found' message
grub rescue> ls (hd0,2)/boot
... grub ... initrd.img-2.6.32-33-generic ... vmlinuz-2.6.32-33-generic
I found a /boot
directory containing the vmlinuz
file vmlinuz-2.6.32-33-generic
on partition (hd0,2)
.
Then I manually booted from the 'grub rescue>' prompt. The following commands will...
- Set the
root
to use the /boot
directory on partition (hd0,2)
.
- Load kernel module
linux
.
- Set that module to use the kernel image
vmlinuz-2.6.32-33-generic
.
- Set initrd(initialize RAM disk) to use the image
initrd.img-2.6.32-33-generic
.
- Boot Linux.
grub rescue> set root=(hd0,2)/boot
grub rescue> insmod linux
grub rescue> linux (hd0,2)/boot/vmlinuz-2.6.32-33-generic root=/dev/sda2
grub rescue> initrd (hd0,2)/boot/initrd.img-2.6.32-33-generic
grub rescue> boot
This boots and crashes to the BusyBox prompt which DOES have some rudimentary filesystem commands.
Then I moved the *.mod files back to the /boot/grub
directory...
busybox> cd /boot
busybox> mv mod/* grub
busybox> reboot
The reboot was successful, but that was a lot of work.
Is there an easier way?
Source: (StackOverflow)
This question already has an answer here:
I recently repartitioned my hdd and I have damaged grub on my system. On boot I get the grub rescue prompt and I have to go through the following steps in order to boot normally:
set root=(hd0,msdos6)
set prefix=(hd0,msdos6)/boot/grub
insmod normal
normal
(Those steps were found on another post on here!).
I'm very tired of repeating this on every boot, how do I permanently fix grub?
Source: (StackOverflow)
After I deleted Ubuntu partition, I rebooted my computer and got grub rescue problem.
What I have tried so far is finding the right partition of ubuntu from grub rescue command
by ls
command.
It lists (hd0) (hd0,msdos5) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1) (hd1) (hd1,msdos1)
Then check them one by one:
ls (hd0,msdos5)/
ls (hd0,msdos1)/
But I cannot find the right partition.
I will appreciate any advice of you guys on help me to solve this.
Source: (StackOverflow)
I have installed Ubuntu 12.10 in a Western Digital external hard drive (320GB). This is a complete installation, not a live USB.
When I plug it in my HP desktop I go to the BIOS settings and boot off the hard drive, everything work perfectly as it should. Now this works on every single computer and laptop in my house (all HP), except for ONE. My HP ProBook 4530s.
When I select to boot of the USB I get the message:
error: attempt to read or write outside of disk 'hd0'
Now, I have removed the hard drive from my laptop and the external drive is the ONLY drive plugged in. Below is a screenshot of the message on the screen. After the message I navigate to ls /
(as shown below):
After here I try to acces other folders under ls /
, for example, I try to go to ls /boot
to get to the grub folder. Then I get the same message as before: as shown below:
grub rescue> ls /boot
error: attempt to read or write outside of disk 'hd0'
grub rescue> _
The only folders I can access without getting the message again are /home
, /run
and /usr
.
So how do I:
- Boot Ubuntu from GRUB2 (this screen) manually
- Set to automatically boot Ubuntu
- If possible an explanation for this problem
Thanks!
Source: (StackOverflow)
This question already has an answer here:
I have a big problemm with my computer...
I have reduced the windows partition and when I reboot then I have the grub rescue with the error message : no such partition.
Moreover, I don't have access to the bios and so it seems impossible to change the boot sequence to boot on my live usb or live cd.
The command line ls gives me :
(hd0) (hd0,1) (hd0,2) (hd0,3)
I have a recovery windows partition (1 I think), a windows partition and a linux partition.
Yet, the command lines ls (hd0,1), ls (hd0,2) and (hd0,3) gives me the error message : unknown filesystem and so I can't set a boot anymore.
Do you have any idea ?
BR,
Yannick
Source: (StackOverflow)
I am using ubuntu 14.04
and the Grub version is 2.02~beta2-9ubuntu1
. I've been trying this for a long time. I saw this question but couldn’t get it work that way. Anyway I have the solution but am not sure if it is correct or if it has any security risks. Please suggest.
I wanted to configure GRUB such that:-
- Authentication is required to edit the grub menu or enter rescue mode.
- Authentication is not required to boot the OS
I followed the Ubuntu Docs and also many other blogs but all are based on GRUB2 versions older than 2.02~beta2-9ubuntu1
so the grub script cannot be edited as suggested in the docs. Following the docs I tried to edit menuentries but each time the issue faced was that: Authentication was needed to boot the OS too
.
Source: (StackOverflow)
I have Ubuntu 12.04 installed through Wubi on my laptop. For some reason when i click on Ubuntu on start up (when you have to either select windows or Ubuntu) I get the following screen, the grub cursor keeps flashing.
Gnu grub version 1.99-21 Ubuntu 3.4
Minimal bash-like line editing is supported. For the first word, tab lists possible
command completions. Anywhere else tab lists possible device or file completions.
grub>
Could you tell me what I can do to fix this problem and to start Ubuntu normally?
Source: (StackOverflow)
I have a laptop which is partitioned with Windows 7 and Fedora 18. I tried to delete F18 in Partition Manager in Windows 7 and then when I restarted my computer it would still go to GRUB launcher and show Fedora, Fedora with Advanced Options and Windows 7. Then I installed Ubuntu and when I restarted the system it said:
GRUB loading..
Welcome to GRUB!
error: disk 'lvm/fedora-boot' not found.
Entering rescue mode...
grub rescue>
Source: (StackOverflow)
This question already has an answer here:
THE PROBLEM WAS IN FILESYSTEM, THIS IS NOT DUBLICATE TO GRUB RESCUE STANDARD TOPICS.
After laptop system crush (which was caused by hard restart), my ubuntu linux is not booting, it is showing now:
error: uknown filesystem
grub rescue>
Solutions that I tried:
1st solution:
I've read a lot about similar problems and I've tried to work with grub rescue from console:
grub rescue>ls
(hd0) (hd0,msdos5) (hd0) (hd0,msdos1)
grub rescue>ls (hd0,msdos5)
error: uknown filesystem
grub rescue>ls (hd0,msdos1)
error: uknown filesystem
So, I can't list/find my linux filesystem ,,,
- 2nd solution)
After all, I decide to try Boot Repair, I've installed it on UBUNTU live USB, but there is no "Recommended repair" button and there is no "Advanced options". There is only one button which is "Create a BootInfo summary" - I've created one, the link is http://paste.ubuntu.com/5609223/.
I tried BootRepair on latest UBUNTU and on Linux Secure Remix, they both are LIVE editions baked on USB - the same result, Boot Repair not working.
Also OS-Uninstaller on Linux Secure Remix states that there is not found/installed OS.
This is the log from Boot Repair:
http://paste.ubuntu.com/5609223/
I tried the same Linux Secure Remix on a different PC and at least there is button "Recommended repair". So I think the problem is in my HDD or MBR .. I don't know..
I am out of options... Please, HELP!
UPDATE 1:
Thank you guys for the reply:
I tried the solutions, they are pretty much the same but I cannot mount /dev/sda1.
I do some research, but it seems that it is some kind of damage.
Here what I done:
- fdisk
root@ubuntu:/home/ubuntu# sudo fdisk -l
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xebd671ce
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 302815231 151406592 83 Linux
/dev/sda2 302817278 312580095 4881409 5 Extended
/dev/sda5 302817280 312580095 4881408 82 Linux swap / Solaris
Disk /dev/sdb: 8021 MB, 8021606400 bytes
110 heads, 46 sectors/track, 3096 cylinders, total 15667200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x04030201
Device Boot Start End Blocks Id System
/dev/sdb1 * 10392 15667199 7828404 b W95 FAT32
- mount
root@ubuntu:/home/ubuntu# sudo mount /dev/sda1 /mnt
mount: you must specify the filesystem type
- blkid
root@ubuntu:/home/ubuntu# blkid
/dev/loop0: TYPE="squashfs"
/dev/sda5: UUID="ce99d1c7-16fd-4b60-b0af-af6a14b8bdbe" TYPE="swap"
/dev/sdb1: LABEL="DANAIL" UUID="4ED6-708D" TYPE="vfat"
- So I tried different types: ext3, ext4, vfat and auto, but the result is same for all of types:
root@ubuntu:/home/ubuntu# sudo mount -t ext4 /dev/sda1 /mnt
mount: wrong fs type, bad option, bad superblock on /dev/sda1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
root@ubuntu:/home/ubuntu# sudo mount -t auto /dev/sda1 /mnt
mount: you must specify the filesystem type
root@ubuntu:/home/ubuntu# sudo mount -t ext2 /dev/sda1 /mnt
mount: wrong fs type, bad option, bad superblock on /dev/sda1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
root@ubuntu:/home/ubuntu# sudo mount -t vfat /dev/sda1 /mnt
mount: wrong fs type, bad option, bad superblock on /dev/sda1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
root@ubuntu:/home/ubuntu#
- dmesg
root@ubuntu:/home/ubuntu# dmesg | tail
[ 2424.052221] SQUASHFS error: Can't find a SQUASHFS superblock on sda1
[ 2620.531816] EXT4-fs (sda1): VFS: Can't find ext4 filesystem
[ 2626.204025] EXT3-fs (sda1): error: can't find ext3 filesystem on dev sda1.
[ 2626.208650] EXT4-fs (sda1): VFS: Can't find ext4 filesystem
[ 2626.208938] FAT-fs (sda1): bogus number of reserved sectors
[ 2626.208943] FAT-fs (sda1): Can't find a valid FAT filesystem
[ 2626.209377] SQUASHFS error: Can't find a SQUASHFS superblock on sda1
[ 2635.692959] EXT2-fs (sda1): error: can't find an ext2 filesystem on dev sda1.
[ 2644.614887] FAT-fs (sda1): bogus number of reserved sectors
[ 2644.614894] FAT-fs (sda1): Can't find a valid FAT filesystem
- mount
root@ubuntu:/home/ubuntu# mount
/cow on / type overlayfs (rw)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
/dev/sdb1 on /cdrom type vfat (ro,noatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/loop0 on /rofs type squashfs (ro,noatime)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
gvfsd-fuse on /run/user/ubuntu/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=ubuntu)
Thank for your help.. Can't solve this for now..
UPDATE 2:
The solution is to run fsck on the broken /dev/sda1 system. The problem is in the filesystem, not in grub. That's why grub can't see the filesystem with LS. Thank you!
Source: (StackOverflow)
I made a really silly
sudo mv /* /some_folder
move command on my remote server vm ubuntu 12.04
that moved my boot folder to
/home/.../somefolder/boot
I can access this folder via a browser terminal that gives me grub rescue.
How can I move the entire folder back to root location so to boot normally?
If that is impossible then if I boot from this location , will I be able to traverse to folders higher than the boot folder, as to at least copy my files via ssh?
UPDATE
I manage to do the following
grub rescue> set prefix=(hd0,1)/home/path_to_boot/boot/grub
grub rescue> set root=(hd0,1)/home/path_to_boot/
grub rescue> insmod normal
grub rescue> normal
Which launches a menu with options in choosing Ubuntu boot.
I press c to enter console and get to grub mode to issue linux command.
grub> linux /home/path_to_boot/boot/vmlinuz-3.xx.x-67-generic
grub> initrd /home/path_to_boot/boot/initrd.img-3.xx.x-67-generic
grub> boot
After that I get stuck at
(initramfs)
At this point I have no access to /home folder, only to folders inside /home/path_to_boot/boot.
Any ideas how to proceed?
UPDATE 2
I contacted my servers company and got the option to boot via a live cd.
With it I did a
gksudo nautilus
And managed to copy my files.
Unfortunately though I wasn't able to save my system via grub, but so I got the files I needed.
Source: (StackOverflow)
I'm desperate. I have windows 7 home premium installed on my notebook and I decided to install ubuntu as usual. Nevertheless, I had several problems with the graphic card while installing and I got some problems and I couldnt run ubuntu properly, so I decided to uninstall ubuntu by formatting the partition and joining it to my data partition (where it originally came from). Afterthat, I cannot enter into any OS. Not even from the BIOS. But the partitions are there. There is no way, I have tried a Windows DVD to repair boot, but no repair option is offered just installation, also I tried "lilo" as this post said.
I tried Super Grub Disk with no luck. Even Boot-Repair from a live-CD where I could just obtain a report.
What can I do? I just want to have my windows boot as usual and then I will try again the linux installation. But I need to come back to my windows boot.
what I get when I boot is:
error: no such partition.
grub rescue> _
An ls
here get this:
(hd0) (hd1) (hd1, gpt5) (hd1, gpt4) (hd1, gpt3) (hd1, gpt2) (hd1,gpt1) (hd2) (hd2,gpt2) (hd2,gpt1)
It is a new computer (asus ux32vd) and the ubuntu version I deleted was 12.10. I don't want to reinstall Windows because i'll lost my license key. I don't know what else can I do.
Source: (StackOverflow)
I've installed ubuntu 13.10, but after rebooting I get the message:
GRUB loading:
Welcome to GRUB!
error: file '/grub/i386-pc/normal.mod' not found
Entering rescue mode...
grub rescue>
I have the following partitons setup:
/dev/sdb5: /boot ext4 500MB
/dev/sdb6: swap 4GB
/dev/sdb7: / ext4 60GB
/dev/sdb1: ntfs 900GB
I have already tried solution from "error: file '/grub/i386-pc/normal.mod' not found" and "Fix grub2 after installing ubuntu 12.04" but did not get success.
I am using 1TB external HDD for this and don't want to mess the windows on /dev/sdaXY .
i have acer travel mate with Intel i5 processor,4 GB RAM. I am using iso image of 64 bit ubuntu named "ubuntu-13.10-desktop-amd64.iso" .. Please help me, I have tried various solution but did not fix it for last 3 days.
Source: (StackOverflow)