Does MX MBR repair erase GRUB?

When you run into problems installing MX Linux XFCE
Message
Author
danielson

Does MX MBR repair erase GRUB?

#1 Post by danielson »

Dual boot scenario here...

Say a user dislikes MX (or any other distro) while dual-booting with Windows, can he/she use MX MBR repair to wipe GRUB and just boot back with Windows alone?

Pardon my ignorance.

User avatar
dolphin_oracle
Developer
Posts: 19926
Joined: Sun Dec 16, 2007 1:17 pm

Re: Does MX MBR repair erase GRUB?

#2 Post by dolphin_oracle »

no, it will not restore the windows boot loader.

there are ways to do that. I usually use a windows boot disk recovery console for that. I forget the exact requirements, but instructions are available on the interwebs.
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.

Huckleberry Finn

Re: Does MX MBR repair erase GRUB?

#3 Post by Huckleberry Finn »

Hi Danielson,

... But if mbr is left erased, with nothing in, it can start neither linux nor Win or something else.. So we need to write something in the first 512 bytes (in fact 446 ... (+64+2) ).

That's to say we need to write NT (Windows') mbr on its place... (But yours is a good suggestion to place such an option in MX Bootrepair to make it one click..)

It's easy to do it with dd command (not telling right now for new friends not to make terrible mistakes :) )

And simply write the mbr.bin in /usr/lib/syslinux/mbr/ there (generally sda) and then say, when you insert the installation cd of Win. to repair etc. it can start.. Otherwise (with grub or with nothing in the mbr) neither Windows nor the installation cd will start...
Last edited by Huckleberry Finn on Mon Jun 24, 2019 10:07 am, edited 1 time in total.

User avatar
dolphin_oracle
Developer
Posts: 19926
Joined: Sun Dec 16, 2007 1:17 pm

Re: Does MX MBR repair erase GRUB?

#4 Post by dolphin_oracle »

Huckleberry wrote: Mon Jun 24, 2019 9:51 am Hi Danielson,

... But if mbr is left erased, with nothing in, it can start neither linux nor Win or something else.. So we need to write something in the first 512 bytes (in fact 446 ... (+64+2) ).

That's to say we need to write NT (Windows') mbr on its place... (But yours is a good suggestion to place such an option in MX Bootrepair to make it one click..)

It's easy to do it with dd command (not telling right now for new friends not to do terrible mistakes :) )

And simply write the mbr.bin in /usr/lib/syslinux/mbr/ there (generally sda) and then say, when you insert the installation cd of Win. to repair etc. it can start.. Otherwise (with grub or with nothing in the mbr) neither Windows nor the installation cd will start...
the windows installation cd/dvd/usb can absolutely start without anything at all in the Hard Drive's MBR. Its how you do an install on new builds afterall...
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.

Huckleberry Finn

Re: Does MX MBR repair erase GRUB?

#5 Post by Huckleberry Finn »

Yes, sorry, that's true for the installation cd.. but without grub... with nothing.. right?

User avatar
jackdanielsesq
Posts: 244
Joined: Sun Apr 21, 2019 9:02 am

Re: Does MX MBR repair erase GRUB?

#6 Post by jackdanielsesq »

Greetings

GRUB2 is beta, nay, alpha software - it is no day at the beach, like legacy GRUB
Leave well enough alone - perhaps try MX Tools, point to booting Wxx as default
If you are selling the machine, install a new instance of Wxx, and move on.
Tomorrow you/person will tire of Wxx and hit MX again.... enjoy

Regards
Jack

User avatar
penguin
Posts: 260
Joined: Wed Jan 04, 2017 3:15 pm

Re: Does MX MBR repair erase GRUB?

#7 Post by penguin »

I am not very sure if the method described on the follow links can resolve your problem (first I think that MBR should be wiped (create a backup first) and after that, re written/installed )

Code: Select all

https://www.cyberciti.biz/faq/linux-clearing-out-master-boot-record-dd-command/

Code: Select all

https://windowsreport.com/windows-10-bootloader-linux/

Code: Select all

https://www.maketecheasier.com/fix-windows-mbr-from-ubuntu/
Anyway. By Windows CD , DVD or bootable Windows USB the MBR ( Windows) can be restored as follow :

Code: Select all

https://neosmart.net/wiki/fix-mbr/

User avatar
fehlix
Developer
Posts: 10310
Joined: Wed Apr 11, 2018 5:09 pm

Re: Does MX MBR repair erase GRUB?

#8 Post by fehlix »

danielson wrote: Mon Jun 24, 2019 9:08 am Say a user dislikes MX (or any other distro) while dual-booting with Windows, can he/she use MX MBR repair to wipe GRUB and just boot back with Windows alone?
Currently "MX Boot Repair" can save and restore saved MBR's (that's the first 446bytes of the 512 byte MBR record)

But if we have not saved the original Win-MBR before we had installed MX Linux, we appear to be stuck and would need a WinCD/USB to recover. (as D_O pointed out.)

OTOH, MX Linux provides ways to restore the MBR itself. This could be done either as mentioned by @Huckleberry with help of Syslinux provided MBR (which is with a 440byte MBR) or just with Debian's provided mbr-package, which both mentioned are preinstalled in MX Linux.

The manual way to restore the MBR.
First find the device name winOS is installed on, e.g. check with Gparted.
( or from command line run "lsblk -f" )
The device name can be /dev/sda but maybe also /dev/sdb, depending how the boot order is defined within bios.

The Syslinx MBR recovery would go this way:

Code: Select all

sudo dd bs=440 count=1 if=/usr/lib/syslinux/mbr.bin of=/dev/sdX 
The Debian-MBR recover would look like:

Code: Select all

sudo install-mbr --interrupt n  --partition  D  --timeout 0 /dev/sdX
where /dev/sdX is the windows boot device (e.g. /dev/sda or /dev/sdb)

In addition to restore the MBR it self, it is important for Windows to boot properly to have the boot-flag set on the Windows boot partitions, otherwise BIOS would complain and winOS not boot. So simply check within Gparted the first Windows partition (system partition) is marked with a boot-flag.

And, yes, that's potentially a nice enhancement for "MX Boot Repair" to restore the WinOS-MBR (and fix/check the boot flag), but potentially also an enhancement for "MX Installer" to save an existing Win-MBR before installing.
:puppy:
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

danielson

Re: Does MX MBR repair erase GRUB?

#9 Post by danielson »

Appreciate your feedback folks!
Will re-read to have it sock into me a bit more...

In the meantime, adding your suggestion to the MX Boot Repair would surely be a huge bonus to non-geeks like me.

Huckleberry Finn

Re: Does MX MBR repair erase GRUB?

#10 Post by Huckleberry Finn »

fehlix wrote: Mon Jun 24, 2019 11:53 am ...that's potentially a nice enhancement for "MX Boot Repair" to restore the WinOS-MBR (and fix/check the boot flag), but potentially also an enhancement for "MX Installer" to save an existing Win-MBR before installing.
That's it ! Once I thought to make such a suggestion but I felt lazy to register first .. :)

So, no need to make it a separate wishlist and I say "thank you in advance" :number1:

That would be one of the most handy features of MX like : "Edit as Root" , "Ownership to User", "MX Snapshot" and Bootrepair itself now ..

I began to use MX as a first-aid tool more than other things for it starts quickly (so that only Puppy is a bit faster) and almost everything is ready (photorec & testdisk saved my life ) in your customized style (snapshot). This would make things in just two clicks for especially novices and when using MX as an emergency tool...

Post Reply

Return to “Installation”