grub trouble

Kernels & Hardware, configuring network, installing services

grub trouble

Postby clarknova » 2019-02-10 03:43

I have just installed debian 9.7 on a Soekris net5501-70 with a CF card. The install went well enough, but the system is unable to boot without intervention. Each time I power on or reboot the hardware, I see a grub error on the serial console:

Code: Select all
error: no such partition.
Entering rescue mode...
grub rescue>


With a bit of searching I have discovered that I can make it boot wit the following series of commands:

Code: Select all
grub rescue> set root=(hd0,msdos1)
grub rescue> set prefix=(hd0,msdos1)/boot/grub
grub rescue> insmod normal
grub rescue> normal


I have not yet figured out how to repair grub such that the system will boot on its own. I have tried running 'grub-install /dev/sda' and 'update-grub' more than once, to no avail. Some users recommend installing and running boot-repair, but this appears to be a GUI tool, and this particular system is necessarily minimal, so that doesn't appear to be an option.

Any suggestions?
clarknova
 
Posts: 2
Joined: 2019-02-10 03:32

Re: grub trouble

Postby p.H » 2019-02-10 10:26

What is the output of "fdisk -l" ?
In the grub rescue shell, what is the output of "ls" and what are the values of cmdpath, prefix and root printed by the command "set" before you modify them ?
grub-install should have set the correct values. update-grub is useless for this kind of trouble.
p.H
 
Posts: 1039
Joined: 2017-09-17 07:12

Re: grub trouble

Postby clarknova » 2019-02-10 22:37

Code: Select all
grub rescue> ls
(hd0) (hd1) (hd2) (hd3) (hd4) (hd5) (hd6) (hd7) (hd8) (hd9) (hd10) (hd11) (hd12)
 (hd13) (hd14) (hd15)
grub rescue> set
cmdpath=(hd0)
prefix=(hd0,msdos1)/boot/grub
root=hd0,msdos1


Code: Select all
# fdisk -l
Disk /dev/sda: 3.8 GiB, 4017807360 bytes, 7847280 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
Disklabel type: dos
Disk identifier: 0x8b85e344

Device     Boot   Start     End Sectors  Size Id Type
/dev/sda1  *       2048 6799359 6797312  3.2G 83 Linux
/dev/sda2       6801406 7845887 1044482  510M  5 Extended
/dev/sda5       6801408 7845887 1044480  510M 82 Linux swap / Solaris
clarknova
 
Posts: 2
Joined: 2019-02-10 03:32

Re: grub trouble

Postby p.H » 2019-02-11 08:46

Now I am puzzled. fdisk shows one "disk" /dev/sda (the CF card, I assume), but GRUB shows 16 "disks" (hd0) to (hd15) and no partition. Any idea of what these could be ?
"set" shows that the initial values of $root and $prefix are the same as the ones you set manually, so it should not be necessary to set them.
Also, I don't understand how these values can work if grub does not see the (hd0,msdos1) partition.
p.H
 
Posts: 1039
Joined: 2017-09-17 07:12

Re: grub trouble

Postby sickpig » 2019-02-28 10:00

clarknova wrote:I have not yet figured out how to repair grub such that the system will boot on its own. I have tried running 'grub-install /dev/sda' and 'update-grub' more than once, to no avail.


I had similar issue once, what helped me was apt-get purge grub grub-pc grub-common
then
apt-get install grub-common grub-pc
it should then give you the option to install grub to a disk/partition of your nomination
I think you can select multiple partitions
i went with just one sda and it worked for me
it will then display a confirmation message saying it has identified linuz and initrid
if you see that message then you are golden
haven = Sir P.G. Wodehouse's books. U havent lived unless u have read one :)
User avatar
sickpig
 
Posts: 314
Joined: 2019-01-23 10:34


Return to System configuration

Who is online

Users browsing this forum: No registered users and 11 guests

fashionable