I’ve recently added a second disk to my server, created a single partition
/dev/sdb1 and put a ReiserFS filesystem on it. After system reboot I was presented with the grub rescue shell.
Grub Rescue Shell
That was a bit unexpected, as no GRUB2 related changes were made on the
/dev/sda disk that day.
GRUB loading. Welcome to GRUB! error: unknown filesystem Entering rescue mode...
If you get a rescue shell, this usually means that GRUB2 failed to load the “normal” module. Live CDs are good, but a rescue shell is sometimes all we need. Sometimes.
Let’s see what disks and partitions are accessible:
grub rescue> ls (hd0)(hd0,msdos1)(hd1)(hd1,msdos4)(hd1,msdos3)(hd1,msdos2)(hd1,msdos1)
Since I have just one partition created on the new disk, it must be (hd0,msdos1).
In this case hd1 should be my primary disk. Having figured out that, the rest becomes more of less straightforward. My
/boot partition is on (hd1,1), and
/ is on (hd1,2). Other partitions include
/var and swap.
Let’s check if kernel and initrd images are visible:
grub rescue> ls (hd1,1)/ ./ ../ lost+found/ System.map-3.2.0-4-686-pae config-3.2.0-4-686-pae grub/ vmlinuz-3.2.0-4-686-pae initrd.img-3.2.0-4-686-pae
Set prefix and root to the correct values and load linux module:
grub rescue> set prefix=(hd1,1)/grub grub rescue> set root=(hd1,2) grub rescue> insmod (hd1,1)/grub/linux.mod grub rescue> normal
Once booted into the OS, I mounted my
/boot partition and re-installed GRUB2:
# grub-install /dev/sda # update-grub
However, after system reboot I was returned to the same rescue grub shell with “unknown filesystem”.
It turned out to be a BIOS boot order setting, which was set to boot from the second disk. Having changed the boot order in BIOS, the problem disappeared.
Note to myself: drive ordering in an operating system may not be the same as the boot drive ordering used by a firmware.