FIXED: Bootloader fix needed after installing MX

When you run into problems installing MX Linux XFCE
Message
Author
Huckleberry Finn

Re: Bootloader fix needed after installing MX

#11 Post by Huckleberry Finn »

That's right. Because Win 7 can boot directly from its partition (where it's installed).

So, on MX Live-Session, Menu => GParted

Rigt-click on /dev/sda2 "Manage Flags".. tick "boot" ... "Apply" .

After you see /dev/sda2 (159GB) has the boot flag ; close , Reboot , select Windows on Grub menu ...

TOTAL
Posts: 29
Joined: Thu Nov 07, 2019 8:33 pm

Re: Bootloader fix needed after installing MX

#12 Post by TOTAL »

Thank you All

I will address your replies in free order.

Huckelberry
This sounds like a quick win, but would that not prevent the current installation of MXLinux booting, at least as an option? Academic question now that the system has been deleted (see below), but worth knowing for the future.


All
To clarify what is and what I would hope to achieve

what is
MXL v19 installed recently - and works
Windows 7 partition now cleared of the system because it had malfunctioned

what I would hope to achieve
I would hope to install windows 7 on now cleared sd2 partition and have it bootable as an additional option next to the currently installed MXL.
Also, I would like to have the boot record enable booting from pendrive - proves very useful in emergency

what I have tried
It turns out that when I downloaded the clear MXL19 iso and used mx live usb maker, read only option, it does boot!
Still, when I tried to boot a working windows 7 pendrive, the system response was about a missing bootmgr.
Also, when I previously tried booting my distributionof MXL19, the system would not notice the pendrive and would just reboot the system on harddrive.


fehlix
Sorry, windows not booting was about the pendrive with windows not booting.
also , was entirely unclear about nothing not booting. Apologies for this; I meant that no pendrive would boot, now with the exception of the original MXL19 installer, as described above.

Code: Select all

sudo update-grub
Done that, thank you. It is good to know this is another way of selecting regenrate grub.cfg menu.


To sum up, I am happy about the installation of MXL, and using it now, by the way. Windows is deleted. I would like to install it from a pendrive that I know to work and to boot anything else, functionality which appears to be broken after installing MXL.

Thank you All. I hope this is all clear now and we come up with the solutions.

Huckleberry Finn

Re: Bootloader fix needed after installing MX

#13 Post by Huckleberry Finn »

If I'm not wrong the "pendrive" is the Win7 "installation" usb .. , right?. And if so, as in post #9, it won't start as long as there's "grub" on mbr..

If "no" , "that's just a pendrive Win7 is installed on" .. Then again, it needs to be "repair"ed using another Wİn7 installation media and again mbr (on hdd) needs to be erased (or replaced with Win. mbr) for it to start.

In fact "bootmgr" is the "nagging" of Windows.. Grub already knows where Win. is, and starts it and Windows itself doesn't want to start and says "Can't find this, can't find that ! Who changed my place !?!.. blah blah blah !!!"

(cry-baby) :)

But imho, even when you "repair" the pendrive that way and make it bootable again, it may soon do the same, because "bootmgr" occurs when Win. partition / place is changed (or when it thinks so) etc.. and, say, next time when you attach it in a different usb port ... or so ...
_______________________________________________________________________________________

So, if you need to first re-install Win7 then go on using all (like me).. First need to "erase" grub from there, then Win7 installation can start .. After installation of Win. is complete (Finally) start MX "Live-session" Menu => MX Boot Repair.. Reinstall Grub..

(This time all will be there and working: MX, Windows , and/or others..)

If so, I / we will tell how to erase mbr simply..

(If you like you can backup the current one on MX Boot repair , selecting "backup mbr.. " option there, from now..)

P.S. As you might already know: you can also copy the "Users" directory on Win partition (sda2) to somewhere, when you're on MX, Thunar. .. Most of customizations will be saved..

Meanwhile, if you're decided not to ever return to Win10 , you can delete the sda1 in Gparted and merge them..

(if you like)

I.e. Right-click on sda1 "delete" , then on sda2 "delete" .. Then on the new "unallocated" space right-click "new" partition "Primary" .. ntfs .. Apply .. then again on that new partition right-click .. flag .. "boot".. Apply..
____________________________________________________________________

I forgot to answer your question which is the most important:

Linux doesn't need the boot flag (nor cares). Also it doesn't need the partition type be "Primary", it can be installed also on "Logical" partitions in an "extended" partition ..

Therefore, always keep "boot" flag on Windows partition.. (Windows needs both : the flag and the "Primary" to be bootable.. Only additional ntfs partitions , say, to be used as D: , G: etc. can be "logical" and without flag)

TOTAL
Posts: 29
Joined: Thu Nov 07, 2019 8:33 pm

Re: Bootloader fix needed after installing MX

#14 Post by TOTAL »

Huckleberry wrote: Mon Nov 11, 2019 7:53 am If I'm not wrong the "pendrive" is the Win7 "installation" usb .. , right?. And if so, as in post #9, it won't start as long as there's "grub" on mbr..
Yes, one pendrive is windows 7 installation (ie. an installation disk that was first iso'ed and then USB'ed with rufus), and does not boot. I tend to think the pendrive is a working one because it has not been changed since I used it last time. My thinkpad x200 lacks a dvd drive, so I have always used a pendrive for installing windows.
The other pendrive is my snapshot of MX Linux - and does not boot
The third one is the clean install of MX Linux 19 - the one I used for installing MXL - and it is booting, thus, adding slight confusion in the face of snapshot not booting.


Huckleberry wrote: Mon Nov 11, 2019 7:53 am
So, if you need to first re-install Win7 then go on using all (like me)..
OK, so this is the requirement: windows must be installed first? If I can not avoid that, that's okay.
Huckleberry wrote: Mon Nov 11, 2019 7:53 am
First need to "erase" grub from there, then Win7 installation can start .. After installation of Win. is complete (Finally) start MX "Live-session" Menu => MX Boot Repair.. Reinstall Grub..

(This time all will be there and working: MX, Windows , and/or others..)

If so, I / we will tell how to erase mbr simply..

(If you like you can backup the current one on MX Boot repair , selecting "backup mbr.. " option there, from now..)
I have tried backing up, and here is the error message I got.

Code: Select all

/bin/dd: unrecognized operand ‘backup/mbr’
Try '/bin/dd --help' for more information.
Huckleberry wrote: Mon Nov 11, 2019 7:53 am
P.S. As you might already know: you can also copy the "Users" directory on Win partition (sda2) to somewhere, when you're on MX, Thunar. .. Most of customizations will be saved..

Meanwhile, if you're decided not to ever return to Win10 , you can delete the sda1 in Gparted and merge them..


(if you like)

I.e. Right-click on sda1 "delete" , then on sda2 "delete" .. Then on the new "unallocated" space right-click "new" partition "Primary" .. ntfs .. Apply .. then again on that new partition right-click .. flag .. "boot".. Apply..
So the first partition of 500MB is a relic of someone's windows 10?
I have been on windows 7 previously, too - never on w10, so the first partition can, indeed, be re-used.
Huckleberry wrote: Mon Nov 11, 2019 7:53 am
____________________________________________________________________

I forgot to answer your question which is the most important:

Linux doesn't need the boot flag (nor cares). Also it doesn't need the partition type be "Primary", it can be installed also on "Logical" partitions in an "extended" partition ..

Therefore, always keep "boot" flag on Windows partition.. (Windows needs both : the flag and the "Primary" to be bootable.. Only additional ntfs partitions , say, to be used as D: , G: etc. can be "logical" and without flag)
OK, good to know, thank you.

To sum up, if I can't install windows 7 without ruining the present installation of MX Linux, I are ready to restart the process by installing windows 7 and then MX.
In any case, when the dust settles, I would hope to be able to boot from pendrive other things, such as utilities, my snapshots of MX, next versions of MX when they show up.

Huckleberry Finn

Re: Bootloader fix needed after installing MX

#15 Post by Huckleberry Finn »

MX can stay there, no need to reinstall. Just need to erase mbr, (to be able to start the Win Installation), then reinstall Win.. At the end, reinstall Grub.. (Because this time there'll be Win. bootloader in grub's place and it will ignore MX (in fact, anything other than MS) though it's still there, already installed..

Meanwhile; Windows re-installation is not required. I just say so for you wanted (if I'm not wrong).

The simplest way for now is to put the boot flag to sda2 (as in previous posts) then try to boot into Windows (to the installed one on disk) .. And in case that gives a similar error / blue screen, then repair only..

You can also write your snapshot with Rufus - that always works - .. Just let it do it simply -without selecting other things which can be wrong, like gpt etc..) .. Just attach usb, start Rufus hit ok ..

(By the way, I'm currently on my "installed" snapshot "written" by Rufus :)

Also it enables you to use the remaining space on usb...

TOTAL
Posts: 29
Joined: Thu Nov 07, 2019 8:33 pm

Re: Bootloader fix needed after installing MX

#16 Post by TOTAL »

I need to fresh install windows 7 - there is nothing left of the windows that was on partition 2, so I would like to reuse it.
How shall I delete the MBR?

It is good to know rufus pendrives prove reliable in linux context. Any chance to use a linux tool with as much success?

Thank you.

Huckleberry Finn

Re: Bootloader fix needed after installing MX

#17 Post by Huckleberry Finn »

This is not a must but a suggestion: On MX open a terminal and

To backup :

Code: Select all

sudo dd if=/dev/sda of=mymbrbackup.bin bs=512 count=1
Then copy paste it in a usb stick or so (to keep as a backup only) (you can give it any name in fact)
(Will find it in your home folder)

To erase the mbr

Code: Select all

sudo dd if=/dev/zero of=/dev/sda bs=446 count=1
As you might've noticed, when backing up: 512 (446 + 64 + 2 , partition table and signature are also backed up) but when writing, only 446, without touching the partition table not to destroy it.

( You can copy-paste these into the terminal then hit Enter ).

Of course this is specific to your case. New Linux users who read this should never apply directly without knowing the device name. Here we already know it's "sda" ..

If you like, you better be sure that bios is set to usb and cd/dvd at top 2 in boot sequence first. Because, the moment mbr is cleaned, neither Linux nor Win or something else on hdd will be able to boot, only from media; usb, dvd etc..

Also if possible, be sure the installation usb works (try on another pc or if you have the Win iso, re-write using Rufus...)
________________________________________________________________________

After you start with Win installation usb and finish installing, the mbr will be full with Windows bootloader. Then you'll start MX Live session => MX Boot Repair.. : "Reinstall GRUB Bootloader" =>

Install on: MBR
Location: sda
Select Boot Location: sda4 currently, installed MX's partition in fact, the numbering might change after playing with GParted.

... apply .. Then Grub will be back ..

https://2.bp.blogspot.com/-tWfUqZymN_o/ ... Repair.png

download/file.php?id=13736&mode=view (just for demonstration)

TOTAL
Posts: 29
Joined: Thu Nov 07, 2019 8:33 pm

Re: Bootloader fix needed after installing MX

#18 Post by TOTAL »

Hello again

I have followed the instruction to restart from live USB and make sd2 a boot disk.

Just to remind, Windows partition has long been empty, so what is needed is the ability to boot windows 7 installer pendrive. At present, the mx live does boot, whereas windows 7 pendrive does not - a prompt shows about missing BOOTMGR.

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

Re: Bootloader fix needed after installing MX

#19 Post by fehlix »

TOTAL wrote: Fri Jan 10, 2020 10:20 pm ... so what is needed is the ability to boot windows 7 installer pendrive. At present, the mx live does boot, whereas windows 7 pendrive does not - a prompt shows about missing BOOTMGR.
Hmm, normaly you would need to press a Fn-key (e.g. like F12 or F10 etc) to select a boot device to boot from.
OTOH, if MX-linux USB-stick starts and if the win7-boot stick is normaly working,
you migth use the MX Boot Rescue menu, which can also boot from an attached Win-USb stick.
Plugin MX-19 USb stick and boot to the menu now plugin
the Win7 USB-stick
EDIT: or perhaps start with having plugged in bothe USB-sticks MX-19 Linux and Win7
and select Switch to Grub Menu
switch-to-grub.png
and select Boot Rescue Menu:
boot-rescue-menu.png
Now select Find Windows bootloader:
find-windows-boot-loader.png
The Win7 stick should be found:
found-windows-boot-loader on-usb.png
Select to boot into Win7 installer .. windows is loading
windows-is-loading.png
And you might finally see the win7-installer
win7-installer.png
:puppy:
You do not have the required permissions to view the files attached to this post.

Post Reply

Return to “Installation”