topic title: re-installing grub
Posts: 903
plvera
Joined: 11 Oct 2008
#1
Hello,
Battery power in my laptop reached zero and turned off.
It seems to have messed up Grub, windows 10 boot is still ok..
I have tried updating grub and install-grub and get a message about not liking blocklists and won't reinstall so I'm using a grub2 boot disk to boot manually.
Any suggestions on how to reinstall grub? Again it's a dual sytem boot with Antix and windows 10.

thanks.
Posts: 4,164
rokytnji
Joined: 20 Feb 2009
#2
With weird Windows barriers on certain laptops.

I have had good luckk with the live cd I made of

========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://sourceforge.net/projects/boot-repair-cd/"
linktext was:"https://sourceforge.net/projects/boot-repair-cd/"
====================================


You might get other suggestions using a MX cd maybe also.
Posts: 903
plvera
Joined: 11 Oct 2008
#3
Roky,
thanks for suggestion. I'll give it a try.

P.S. The boot-repair-disk did not like that I was running legacy, wanted me to switch to EFI. When I do that. I can't see the cd drive to boot the disk.
So, I"m still still stuck.
I had to fix this once but I forgot how, something about set root(hd0,gpt5) and then reinstall grub
Been trying to find the right instructions with no luck
Posts: 1,139
masinick
Joined: 26 Apr 2008
#4
plvera wrote:Roky,
thanks for suggestion. I'll give it a try.

P.S. The boot-repair-disk did not like that I was running legacy, wanted me to switch to EFI. When I do that. I can't see the cd drive to boot the disk.
So, I"m still still stuck.
I had to fix this once but I forgot how, something about set root(hd0,gpt5) and then reinstall grub
Been trying to find the right instructions with no luck

A few sites to consider as resources:


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://wiki.archlinux.org/index.php/Master_Boot_Record"
linktext was:"https://wiki.archlinux.org/index.php/Master_Boot_Record"
====================================


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://www.linuxjournal.com/magazine/hack-and-when-disaster-strikes-restoring-master-boot-record"
linktext was:"http://www.linuxjournal.com/magazine/ha ... oot-record"
====================================


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://www.sorgonet.com/linux/grubrestore/"
linktext was:"http://www.sorgonet.com/linux/grubrestore/"
====================================
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#5
plvera wrote:I had to fix this once but I forgot how, something about set root(hd0,gpt5) and then reinstall grub
Yep, this is perfect example of why it's important for folks to followup by posting a solution they've found
testers-with-windows-os-needed-t4406-15.html?hilit=grub

howabout
plvera wrote:
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"antix.freeforu ms.org/post30250.html?hilit=boot#p30250"
linktext was:"antix.freeforu ms.org/post30250.h ... oot#p30250"
====================================

Hello everyone:

I have a new HP envy 17 laptop that came with windows 8. I tried booting up antix 13 and was unable. The disk boots fine in other laptops.
Grub did not come up. I set the bios settings to disable secure boot; enable legacy and nothing seems to work so far.

Any suggestions?

thanks.

Pedro

EDIT: Figured it out! I had to press escape key (even after I had changed device boot order) in order to pick cd/dvd so that it would not go straight to win8. Now antix13 (64 edition) booted up; ceni picked up wireless and everything is running great!
Posts: 903
plvera
Joined: 11 Oct 2008
#6
@skidoo

Thanks for pointing that out yet it's a different problem. The legacy boot is ok and the dvd drive is picked up that's how I'm using a grub restore disk to bring up the grub boot options.

Restoring that grub menu to come up is what I'm struggling with.

@massinick:

Thanks for links. I'll follow up and see if I can fix this.
Posts: 903
plvera
Joined: 11 Oct 2008
#7
The solution was easier than I thought.

grub-install /dev/sda

was giving me the warning about blocklists not being recommended and not installling.

grub-install --force /dev/sda

did the trick.

Thanks for the suggestions.
Posts: 6
sxe
Joined: 19 Oct 2016
#8
plvera wrote: grub-install --force /dev/sda
my pc says command not found
anticapitalista
Posts: 5,955
Site Admin
Joined: 11 Sep 2007
#9
Do it as root
Posts: 6
sxe
Joined: 19 Oct 2016
#10
now at reboot.
"minimal bash-like line editing is supported. for the first word, tab lists possible command completions. anywhere else tab lists possible device or file completions.
grub>"
Posts: 45
hobbyist7890
Joined: 24 Apr 2016
#11
Try

Code: Select all

update-grub
so you will get a new /boot/grub/grub.cfg if you can boot your antix first.
That should remake your grub menu and reinstall to your sda.

.
Posts: 6
sxe
Joined: 19 Oct 2016
#12
Ok...
But now in the grub i have only windows... Where is antix?
Posts: 4,164
rokytnji
Joined: 20 Feb 2009
#13
sxe wrote:Ok...
But now in the grub i have only windows... Where is antix?
__{{emoticon}}__ Boot a live session and find out. `

Code: Select all

sudo fdisk -l
Posts: 1,139
masinick
Joined: 26 Apr 2008
#14
hobbyist7890 wrote:Try

Code: Select all

update-grub
so you will get a new /boot/grub/grub.cfg if you can boot your antix first.
That should remake your grub menu and reinstall to your sda.

.
update-grub will indeed perform the steps necessary to update the grub configuration file grub.cfg mentioned above. What
update-grub does not do is update the Master Boot Record (MBR). That task falls to other things.

The Debian Wiki at
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://wiki.debian.org/Grub"
linktext was:"https://wiki.debian.org/Grub"
====================================
describes what GRUB does and also provides some history between the previous version of GRUB, known as GRUB 1, also known as GRUB Legacy.

Wikipedia (
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://en.wikipedia.org/wiki/GNU_GRUB"
linktext was:"https://en.wikipedia.org/wiki/GNU_GRUB"
====================================
) gives a different perspective and implies that you will get the boot record updated. That may be true in many cases, but not in all cases, based on my experience. When UEFI is involved, whatever system is managing the boot block will handle it. If antiX or MX is handling it, then yes, it will continue to do so, but if not, the system controlling the Master Boot Record must be the system to update it.

The script grub-install, followed by the location of the MBR, such as grub-install /dev/sda will sometimes work, if your system manages the MBR, but even this doesn't work in all cases with UEFI.

If you are affected by this, let me know; I have a library of articles that I've read as I was dealing with this myself. If you're fortunate, update-grub will be all that you need (and this is nothing but extra noise and details for complex implementations). __{{emoticon}}__
Posts: 45
hobbyist7890
Joined: 24 Apr 2016
#15
masinick wrote: The script grub-install, followed by the location of the MBR, such as grub-install /dev/sda will sometimes work, if your system manages the MBR, but even this doesn't work in all cases with UEFI.
The first question to ask is whether this is a UEFI install with GPT or a Legacy install with GPT or MBR. This thread has two problems to choose from so there is some confusion about the real answer.

I have several systems both UEFI and MBR and each has several partitions for various OS installs. My Legacy boot has one OS controlling the MBR GRUB with the rest of the OS installs having boot / partition installs although they don't really do anything. The lead OS looks in every partition for an OS and creates the grub.cfg and updates the MBR GRUB when I enter 'update-grub'. The 'update-grub' in any of the other partitions just stays in the partition so doesn't change anything. I think some installations do not reinstall the GRUB to the MBR automatically so I am lucky there.

My UEFI system creates a separate bootloader for each OS and they are all available to the UEFI. I can choose any of the bootloaders and each bootloader contains all of the OS choices on the disk just in a different order. So the 'update-grub' on the UEFI just creates the grub.cfg for that partition and then I still need to install the grub into the ESP partition. I think some installations will reinstall the bootloader into the ESP automatically unlike my setup so I do this for antix:

Code: Select all

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=antix
Only a Legacy installation puts the GRUB in the /dev/sda MBR so anybody with questions should first explain if they have a UEFI or Legacy install or risk getting two answers to the question.