You are not logged in.

#1 2018-05-27 17:21:05

bushy3
Member
Registered: 2017-06-09
Posts: 20

Failed boot Panic mode

I have a laptop with three versions of Linux.  Everything worked fine until an update to one of them. I'm sure this is due to Grub pointing to the wrong kernal or something but don't know how to correct it and prevent it in the future.

Offline

#2 2018-05-27 18:07:15

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: Failed boot Panic mode

The first step is identifying the problem, can you describe it in more detail please?

The output of this command may be useful but only if you have a UEFI system:

sudo efibootmgr v

^ That command can be run from our "live" environment on the BL ISO image.


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#3 2018-05-27 18:36:44

sleekmason
Member
Registered: 2018-05-22
Posts: 210

Re: Failed boot Panic mode

You can re-install grub on your current distro, making sure to install to the mbr, then sudo update-grub on the other two. 
This will insure you will at least be able to get into the distro you are currently in, and after updating the other two, update grub again in the distro you just re-installed grub.
This will allow your current system to pick up any new kernels in the other two as well.

Whichever system was the last to install to mbr will have control over the boot prompt. The other partitions should be picked up automatically.

Last edited by sleekmason (2018-05-27 18:39:20)

Offline

#4 2018-05-27 18:39:25

bushy3
Member
Registered: 2017-06-09
Posts: 20

Re: Failed boot Panic mode

Apparently I don't uefi system, message after executing the above command:"EFI Variables are not supported on this system"

Offline

#5 2018-05-27 18:46:00

bushy3
Member
Registered: 2017-06-09
Posts: 20

Re: Failed boot Panic mode

I am going to re-install, how do I prevent this in the future?

Offline

#6 2018-05-27 18:51:21

hhh
Meep!
Registered: 2015-09-17
Posts: 10,582
Website

Re: Failed boot Panic mode

bushy3 wrote:

I am going to re-install, how do I prevent this in the future?

Stop, this is probably fixable. And even if you do reinstall one of the operating systems, we can't tell you how to prevent a problem that you've barely given any information about.

Can you boot into anything? What OS is the primary one, and what are the other two? Which OS had the update you think caused the problem?

Anyway, once you can boot into something, post back and we can see how you have things arranged and give advice from there.

Offline

#7 2018-05-27 18:53:18

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: Failed boot Panic mode

bushy3 wrote:

I am going to re-install

You shouldn't need to re-install, the fine advice provided by @sleekmason has every chance of working for you.

how do I prevent this in the future?

It's best to only allow one of the distributions to install the GRUB bootloader to the MBR of your disk but you must remember to update the bootloader configuration[1] in the "controlling" distribution immediately after any kernel upgrades or initramfs rebuilds in the other distributions.

As an alternative you could disintermediate grub-mkconfig, write your own grub.cfg instead and point GRUB to the root symlinks that Debian-based systems maintain to the current running kernel & initramfs, these would continue to work even after kernel updates — post back if you want me to explain how to do that.

[1] This should work with most distributions:

sudo grub-mkconfig -o /boot/grub/grub.cfg

“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#8 2018-05-27 19:21:42

sleekmason
Member
Registered: 2018-05-22
Posts: 210

Re: Failed boot Panic mode

sudo grub-mkconfig -o /boot/grub/grub.cfg

  Filed.
Any more info would be very much appreciated. I understand update-grub points to grub-mkconfig, but not the concept.  In other words, What does it do? Is this my new fixall for grub problems? (nothing is ever that easy:) 

Also, is there a way to automatically update the mbr from the non core distribution? Even if it was on logout, it would save a step or two.
My present example would be (and is) distro on sda1 has current control of mbr, forcing me to boot into that distro to update the mbr grub file every time I change kernels. Updating grub on sda5 won't show until then.
Doing so from sda5 would take care of business nicely.

Offline

#9 2018-05-27 19:53:55

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: Failed boot Panic mode

sleekmason wrote:

sudo grub-mkconfig -o /boot/grub/grub.cfg

  Filed.
Any more info would be very much appreciated. I understand update-grub points to grub-mkconfig, but not the concept.  In other words, What does it do? Is this my new fixall for grub problems? (nothing is ever that easy:)

The `update-grub` command is a wrapper script supplied by Debian that calls `grub-mkconfig` which is another shell script that scans the partitions for any bootable kernel images and adds them to /boot/grub/grub.cfg

And yes, updating the configuration does fix most boot problems.

sleekmason wrote:

distro on sda1 has current control of mbr, forcing me to boot into that distro to update the mbr grub file every time I change kernels.

No, you are not updating the MBR, you are updating /boot/grub/grub.cfg on the "controlling" distribution.

You could mount the partition that holds the grub.cfg read by the bootloader and direct the `grub-mkconfig` output there, that might work.

So if your "controlling" system has the /boot folder located on /dev/sda1 you could do this from the distribution on /dev/sda5:

# mount /dev/sda1 /mnt
# grub-mkconfig -o /mnt/boot/grub/grub.cfg

^ This would only work if the GRUB version was the same on both /dev/sda5 and /dev/sda1, and perhaps not even then, I've never tried it.


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#10 2018-05-27 20:52:32

sleekmason
Member
Registered: 2018-05-22
Posts: 210

Re: Failed boot Panic mode

This would only work if the GRUB version was the same on both /dev/sda5 and /dev/sda1, and perhaps not even then, I've never tried it.

Good point. It might not (probably shouldn't) allow grub to be overwritten.
I'll give it a go next time it arises and let you know, probably within a day or two.  Thank you for the detailed explanation.

Offline

#11 2018-05-27 20:53:01

bushy3
Member
Registered: 2017-06-09
Posts: 20

Re: Failed boot Panic mode

hhh wrote:
bushy3 wrote:

I am going to re-install, how do I prevent this in the future?

Stop, this is probably fixable. And even if you do reinstall one of the operating systems, we can't tell you how to prevent a problem that you've barely given any information about.

Can you boot into anything? What OS is the primary one, and what are the other two? Which OS had the update you think caused the problem?

Anyway, once you can boot into something, post back and we can see how you have things arranged and give advice from there.

Two of the three Linux OS work fine. The default boot was hydrogen. Linux Mint and Xenial Pup are the other two.  It may have been Puppy that caused the problem, I think it overwrote grub but not sure, could have been an update to Mint.

Regardless I want to now install Helium.

Offline

#12 2018-05-27 21:12:33

hhh
Meep!
Registered: 2015-09-17
Posts: 10,582
Website

Re: Failed boot Panic mode

bushy3 wrote:

Regardless I want to now install Helium.

Cool! If you have problems with grub or anything, I'd suggest opening a new thread with the specific issue in the thread title. Thanks!

Offline

#13 2018-05-27 21:15:50

hhh
Meep!
Registered: 2015-09-17
Posts: 10,582
Website

Re: Failed boot Panic mode

When you install any Linux OS, by default it will control grub and swap. Issues arising from that are easily fixed by editing fstab (for swap) and re-installing or OS-probing grub.

Offline

#14 2018-05-27 23:47:57

bushy3
Member
Registered: 2017-06-09
Posts: 20

Re: Failed boot Panic mode

@TESTING!!!!!:Thanks for information, I re-installed, everything boots as it should.
Should I mark this thread as SOLVED?

Offline

#15 2018-05-28 13:52:15

sleekmason
Member
Registered: 2018-05-22
Posts: 210

Re: Failed boot Panic mode

# mount /dev/sda1 /mnt
# grub-mkconfig -o /mnt/boot/grub/grub.cfg

Wild.

This switched the default grub to sda5, updated, and now shows the BunsenLabs boot. Not what I expected, but, it seems that it may be updating the grub file on sda1 as well, making the whole big process of updating grub for dual boot one easy step.

Will know more after kernel compile.  This time was for something different.  Don't know yet if it is picking up the kernels automatically in sda1 or not.

Offline

#16 2018-05-28 20:56:27

sleekmason
Member
Registered: 2018-05-22
Posts: 210

Re: Failed boot Panic mode

oh man! oh man!

# mount /dev/sda1 /mnt
# grub-mkconfig -o /mnt/boot/grub/grub.cfg

Here is what this does:
I have antiX installed on sda1, with grub installed to the mbr through antiX, and BunsenLabs installed to sda5.
Running the above code will give BunsenLabs control over the boot screen (temporarily),
and WILL find the kernels on sda1.
This means if I know I have a corrupted grub to mbr on sda1, so long as I am booted into this distro, I run the above command, mbr control is transferred over to BunsenLabs until grub-update is run on sda1. Until then BunsenLabs retains control boot after boot.

So basically it is kind of a fix all.
 
Grub screwed up?

re-install grub here if need be, and then run the above to transfer control to BunsenLabs for the boot menu, allowing it to register sda1's kernels, and show them on boot as well.

switch into sda1 and run grub update and it will take back control of the boot menu if you want.

Offline

#17 2018-05-28 20:58:09

bushy3
Member
Registered: 2017-06-09
Posts: 20

Re: Failed boot Panic mode

Nice

Offline

#18 2018-05-29 13:14:23

sleekmason
Member
Registered: 2018-05-22
Posts: 210

Re: Failed boot Panic mode

So, one caveat so far.  Upon installing a new kernel in BunsenLabs after running

# mount /dev/sda1 /mnt
# grub-mkconfig -o /mnt/boot/grub/grub.cfg

The grub menu will not show your new kernel version unless the above code is run again, because BunsenLabs now controls the mbr.

This is absolutely still a boon because there is no more need to update the mbr by rebooting into the other distro. The only downside I see is that the command must be entered manually, but you would have to do the same anyway from the other distro.

Thanks to Head_on_a-Stick for coming up with a near perfect fix for dual boot grub problems:) 
The ability to use this may change in the future, but for now, works very well.
Both of the systems involved are using Grub2.  I've no idea if grub-legacy will allow for this. Use with caution.

Offline

#19 2018-05-29 18:06:12

unklar
Member
Registered: 2015-10-31
Posts: 1,263

Re: Failed boot Panic mode

^ sleekmason,

if this is the ultimate solution for dual or multi-boot problems, it would be in every wiki and chroot would not have had to be "invented".  lol

Why don't you use for your setup the intended
40_custom ?

e.g. my

...
menuentry 'Chainload antiX17 (auf /dev/sdb1)' {
	set root='hd1,msdos1'
	configfile /boot/grub/grub.cfg
}
...

This also ensures that this kernel boots when you upgrade the kernel, because it always boots in grub.cfg (from sdb1) above stands.  wink

Offline

#20 2018-05-29 18:58:18

sleekmason
Member
Registered: 2018-05-22
Posts: 210

Re: Failed boot Panic mode

@nklar - lol! I am just now learning about grub.  The last time I dual booted was around 2007 or so:)
I have not had need to mess with it until recently when I decided to install BunsenLabs on my extra 10gb partition. Everything concerning grub is new to me. Just a boot prompt before this:)

I will take all the help and advice I can get. Learning is good.

So, If antiX for my setup is on sda1, Is my correction for auf /dev/sdb1 -> auf /dev/sda1 enough?  This looks like one of those things ya better be sure about before proceeding.

menuentry 'Chainload antiX17 (auf /dev/sda1)' {
	set root='hd1,msdos1'
	configfile /boot/grub/grub.cfg
}

Looking here: https://help.ubuntu.com/community/Grub2/CustomMenus
I see example of a custom menu, but different enough I need to be sure.  I'm still pouring over the Arch grub wiki for 40 custom, but havent located it yet.

Last edited by sleekmason (2018-05-29 18:59:27)

Offline

#21 2018-05-29 19:03:48

hhh
Meep!
Registered: 2015-09-17
Posts: 10,582
Website

Re: Failed boot Panic mode

sleekmason wrote:

So, one caveat so far.  Upon installing a new kernel in BunsenLabs after running

# mount /dev/sda1 /mnt
# grub-mkconfig -o /mnt/boot/grub/grub.cfg

The grub menu will not show your new kernel version unless the above code is run again, because BunsenLabs now controls the mbr.

This is absolutely still a boon because there is no more need to update the mbr by rebooting into the other distro. The only downside I see is that the command must be entered manually, but you would have to do the same anyway from the other distro.

Set up a terminal alias if you don't want to enter long commands you repeatedly use. Open ~/.bash_aliases and add your alias with the format...

alias name='command'

... where "name" is what you want to use as an alias and "command" is the command the alias should call. So something like...

alias grubfix='sudo mount /dev/sda1 /mnt && sudo grub-mkconfig -o /mnt/boot/grub/grub.cfg

Logout so the new alias is loaded

Offline

#22 2018-05-29 19:05:42

sleekmason
Member
Registered: 2018-05-22
Posts: 210

Re: Failed boot Panic mode

couldn't this be used?

set root=(sda1)

chainloader +1

}

Offline

#23 2018-05-29 19:11:45

sleekmason
Member
Registered: 2018-05-22
Posts: 210

Re: Failed boot Panic mode

Sorry hhh - Didn't see your response.  I guess I need some feedback. Is this command okay to use regularly?

# mount /dev/sda1 /mnt
# grub-mkconfig -o /mnt/boot/grub/grub.cfg

If this could wind up unstable in the future, the 40_custom would be better to use, yes?

Offline

#24 2018-05-29 19:39:11

unklar
Member
Registered: 2015-10-31
Posts: 1,263

Re: Failed boot Panic mode

sleekmason wrote:

So, If antiX for my setup is on sda1, Is my correction for auf /dev/sdb1 -> auf /dev/sda1 enough?

No!
sda(1) cannot be 'hd1'!


Grub2 counts:
1. HDD/drive = 0
1. Partition = 1

so your sda1 = hd0,msdos1


Correct would be

menuentry 'Chainload antiX17 (auf /dev/sda1)' {
	set root='hd0,msdos1'
	configfile /boot/grub/grub.cfg
}

Offline

#25 2018-05-29 19:52:24

unklar
Member
Registered: 2015-10-31
Posts: 1,263

Re: Failed boot Panic mode

Which Grub did you first install in the MBR? BL or antiX?

Offline

Board footer

Powered by FluxBB