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 trouble

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
clarknova
Posts: 7
Joined: 2019-02-10 03:32

grub trouble

#1 Post by clarknova »

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?

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: grub trouble

#2 Post by p.H »

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.

clarknova
Posts: 7
Joined: 2019-02-10 03:32

Re: grub trouble

#3 Post by clarknova »

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

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: grub trouble

#4 Post by p.H »

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.

User avatar
sickpig
Posts: 589
Joined: 2019-01-23 10:34

Re: grub trouble

#5 Post by sickpig »

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

Post Reply