help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grub-uninstall


From: Pascal Hambourg
Subject: Re: grub-uninstall
Date: Tue, 8 Nov 2022 21:12:38 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0

Le 08/11/2022 à 21:00, Narcis Garcia a écrit :
El 8/11/22 a les 20:43, Pascal Hambourg ha escrit:
Le 08/11/2022 à 12:00, Narcis Garcia a écrit :
My mistake was to do "grub-install /dev/sda" when I need to boot from /dev/sdb

Now I've done "grub-install /dev/sdb" but I don't want GRUB messages appear on /dev/sda when BIOS boot goes there. It's confusing.

I want to know how to revert actions done by grub-install on first disk sectors, without losing partitions.

AFAIK, grub-install does not back up copy the original contents of sectors the boot image and core image are written to. So the best you can do is overwrite GRUB's boot image in the MBR with another boot program, e.g. with install-mbr from package "mbr".

I wish at least to overwrite MBR program without wiping partition table AND clean (with zeroes) next sectors written by grub-install.

First save the MBR with

 dd if=/dev/sda of=sda.mbr bs=512 count=1

Then you can wipe the boot image in the first 440 bytes of the MBR and preserve the partition table with

 dd if=/dev/zero of=/dev/sda count=1 bs=440

IMO it is not worth wiping the core image sectors. They are useless without the boot image.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]