On Tue, 29 Nov 2022 at 05:12, Andrew Wood <andrewjamesw...@ymail.com> wrote:

> Hi Can someone help me with a Grub problem please.
>
> I have 2 disks in a RAID1 mirrror with 2 partitions. sda1 & sdb1 = md0
> swap parition and sda2 & sdb2 = md1 root parition. The disks are MBR
> style partitiions.
>
> For some reason Grub has got corrupted on both and it wont boot.
>
> Ive tried running the following at the grub prompt
>
> ls (hd0,msdos2)
>
> which says file system is ext2
>
> set boot=(hd0,msdos2)
>
> set prefix=(hd0,msdos2)/boot/grub
>
> insmod normal
>
> error: file /boot/grub/i386-pc/normal.mod not found
>
> Can anyone please help me restore the MBR to both disks?

Hi,

Restoring the MBR requires running 'grub-install', which needs a running
system.  You could try using some external rescue filesystem to boot.
Alternatively, you can try booting its internal file system, as below.

Can you confirm that you are entering commands at the prompt that looks
like:

  grub rescue>

That identifies the GRUB rescue shell, which is different to the normal
GRUB shell.

The first command that I would use is a bare 'set' with no arguments.

  grub rescue> set

which will show GRUB's initial configuration that it uses when it first
fails to read the disk. Can you show us that output?

Do not use any other 'set' commands before trying the following.

The GRUB rescue shell supports tab completion, which can be used to
interactively explore what GRUB is able to read off the disk at any time.

For example, at the 'grub rescue>' prompt, you only need to type
  ls (
followed by a TAB, and GRUB will display the list of drives.

You should be able to use tab completion 3 times (once for drive,
partition, directory) to get to this:
  grub rescue> ls (hd0,msdos2)/boot/
What happens then when you press the TAB key?

You should expect that GRUB offers '(hd0,msdos2)/boot/grub'
before you try to use that string to 'set' the 'prefix' value.

This method can be used to explore what GRUB is able to see inside the file
systems that are available to it.

'prefix' value is what you would have to 'set' correctly so that the
'insmod normal' command will work, which is what you would need to progress
you out of the GRUB rescue shell and into the normal GRUB shell.

If you can't do that, the GRUB rescue shell also accepts 'linux', 'initrd',
and 'boot' commands.  You can also use TAB completion to assist with
getting those correct and be sure that GRUB can find any file paths you
specify. You will also need to specify whatever other kernel commandline
parameters are needed.

'root' value is just to save typing. It just specifies what a leading '/'
means in any file path that does not begin with a device.

I expect that this method can also be used to explore the second disk in
your RAID. Use 'hd1' instead of 'hd0'.

I wrote this from memory and some personal notes, I hope it helps.

Reply via email to