Page 1 of 1
FIXED: Bootloader fix needed after installing MX
Posted: Sat Nov 09, 2019 3:35 am
by TOTAL
Hello everyone
My first steps with Linux. System feels great - logical and neat.
I have a question, though, about the bootloader (please forgive me if I confuse some terminology).
After installing the system from a bootable pendrive, I can no longer get anything booted - and I wanted to add the windows that MX replaces - just for the drivers and for some music software.
It turns out that the booting functionality has gone. In some cases, this could be a matter of misuse of MX Live USB maker - maybe some option wrongly set as I tried to put my personalised MX installer on a pendrive.
Still, the windows 7 pendrive that used to work, no longer does. I think the system said something about missing mbr - but I might not remember correctly. Still, the system is not booting.
How could this bootloader be repaired. I would appreciate a link to instructions to some guidance for beginners.
Thank you.
Re: Bootloader fix needed after installing MX
Posted: Sat Nov 09, 2019 4:23 am
by JayM
Welcome to the forum.
Please run MX Tools/Quick System Info, then right-click paste into a reply. (Quick System Info automatically copies the information to your clipboard, already formatted properly for pasting into the forum so all you have to do is a right-click/ paste, not a copy/paste.)
Also please open a terminal and run
then copy the results and paste them within [
code] [/code] tags via the </> icon in the full forum editor.
Thanks.
Re: Bootloader fix needed after installing MX
Posted: Sun Nov 10, 2019 8:07 am
by TOTAL
Hi JayM
Thank you for your answer.
Here is the system info:
Code: Select all
System: Host: TOTAL Kernel: 4.19.0-6-amd64 x86_64 bits: 64 compiler: gcc v: 8.3.0
parameters: BOOT_IMAGE=/boot/vmlinuz-4.19.0-6-amd64
root=UUID=b033579d-3d5b-4d63-832a-7373259139be ro splash resume = /dev/sd6 quiet
Desktop: Xfce 4.14.1 tk: Gtk 3.24.5 info: xfce4-panel wm: xfwm4 dm: LightDM 1.26.0
Distro: MX-19_x64 patito feo October 21 2019 base: Debian GNU/Linux 10 (buster)
Machine: Type: Laptop System: LENOVO product: 7459H73 v: ThinkPad X200 serial: <filter>
Chassis: type: 10 serial: <filter>
Mobo: LENOVO model: 7459H73 serial: <filter> BIOS: LENOVO v: 6DET72WW (3.22 )
date: 10/25/2012
Battery: ID-1: BAT0 charge: 36.4 Wh condition: 42.5/84.2 Wh (50%) volts: 12.0/10.8
model: Panasonic 42T4650 type: Li-ion serial: <filter> status: Discharging
CPU: Topology: Dual Core model: Intel Core2 Duo P8600 bits: 64 type: MCP arch: Penryn
family: 6 model-id: 17 (23) stepping: A (10) microcode: A0C L2 cache: 3072 KiB
flags: lm nx pae sse sse2 sse3 sse4_1 ssse3 vmx bogomips: 9575
Speed: 1010 MHz min/max: 800/2401 MHz boost: enabled Core speeds (MHz): 1: 883 2: 880
Vulnerabilities: Type: l1tf mitigation: PTE Inversion
Type: mds status: Vulnerable: Clear CPU buffers attempted, no microcode; SMT disabled
Type: meltdown mitigation: PTI
Type: spec_store_bypass status: Vulnerable
Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
Type: spectre_v2 mitigation: Full generic retpoline, STIBP: disabled, RSB filling
Graphics: Device-1: Intel Mobile 4 Series Integrated Graphics vendor: Lenovo driver: i915
v: kernel bus ID: 00:02.0 chip ID: 8086:2a42
Display: x11 server: X.Org 1.20.4 driver: intel resolution: 1280x800~60Hz
OpenGL: renderer: Mesa DRI Mobile Intel GM45 Express v: 2.1 Mesa 18.3.6
direct render: Yes
Audio: Device-1: Intel 82801I HD Audio vendor: Lenovo driver: snd_hda_intel v: kernel
bus ID: 00:1b.0 chip ID: 8086:293e
Sound Server: ALSA v: k4.19.0-6-amd64
Network: Device-1: Intel 82567LM Gigabit Network vendor: Lenovo driver: e1000e v: 3.2.6-k
port: 1840 bus ID: 00:19.0 chip ID: 8086:10f5
IF: eth0 state: down mac: <filter>
Device-2: Intel Ultimate N WiFi Link 5300 driver: iwlwifi v: kernel port: 1c60
bus ID: 03:00.0 chip ID: 8086:4236
IF: wlan0 state: up mac: <filter>
Drives: Local Storage: total: 256.17 GiB used: 142.03 GiB (55.4%)
ID-1: /dev/sda vendor: Crucial model: CT275MX300SSD1 size: 256.17 GiB block size:
physical: 512 B logical: 512 B speed: 3.0 Gb/s serial: <filter> rev: R031 temp: 39 C
scheme: MBR
Partition: ID-1: / raw size: 39.87 GiB size: 38.99 GiB (97.80%) used: 32.03 GiB (82.1%) fs: ext4
dev: /dev/sda4
Sensors: System Temperatures: cpu: 51.0 C mobo: 43.0 C
Fan Speeds (RPM): fan-1: 3293
Repos: No active apt repos in: /etc/apt/sources.list
Active apt repos in: /etc/apt/sources.list.d/antix.list
1: deb http://iso.mxrepo.com/antix/buster buster main
Active apt repos in: /etc/apt/sources.list.d/atom.list
1: deb [arch=amd64] https://packagecloud.io/AtomEditor/atom/any/ any main
Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list
1: deb http://deb.debian.org/debian buster-updates main contrib non-free
Active apt repos in: /etc/apt/sources.list.d/debian.list
1: deb http://deb.debian.org/debian buster main contrib non-free
2: deb http://deb.debian.org/debian-security buster/updates main contrib non-free
Active apt repos in: /etc/apt/sources.list.d/google-chrome.list
1: deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
Active apt repos in: /etc/apt/sources.list.d/megasync.list
1: deb https://mega.nz/linux/MEGAsync/Debian_10.0/ ./
Active apt repos in: /etc/apt/sources.list.d/mx.list
1: deb http://mxrepo.com/mx/repo/ buster main non-free
Active apt repos in: /etc/apt/sources.list.d/skype-stable.list
1: deb [arch=amd64] https://repo.skype.com/deb stable main
No active apt repos in: /etc/apt/sources.list.d/various.list
Info: Processes: 209 Uptime: 16m Memory: 3.75 GiB used: 1.57 GiB (41.9%) Init: SysVinit
v: 2.93 runlevel: 5 default: 5 Compilers: gcc: 8.3.0 alt: 8 Shell: bash v: 5.0.3
running in: quick-system-in inxi: 3.0.36
And here is the terminal output
Code: Select all
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 256.2G 0 disk
├─sda1 8:1 0 500M 0 part
├─sda2 8:2 0 148.4G 0 part /media/sda2
├─sda3 8:3 0 1K 0 part
├─sda4 8:4 0 39.9G 0 part /
├─sda5 8:5 0 59.6G 0 part /media/sda5
└─sda6 8:6 0 7.8G 0 part
Greetings
Tom
Re: Bootloader fix needed after installing MX
Posted: Sun Nov 10, 2019 8:18 am
by fehlix
I guess it's boot flag issue. Please post the output of
( replace # with sudo )
Re: Bootloader fix needed after installing MX
Posted: Sun Nov 10, 2019 8:27 am
by TOTAL
Here it is:
Code: Select all
Number Start End Size Type File system Flags
1 1049kB 525MB 524MB primary ntfs boot
2 526MB 160GB 159GB primary ntfs
3 160GB 232GB 72.4GB extended lba
6 160GB 168GB 8392MB logical linux-swap(v1)
5 168GB 232GB 64.0GB logical ntfs
4 232GB 275GB 42.8GB primary ext4
Thank you.
Re: Bootloader fix needed after installing MX
Posted: Sun Nov 10, 2019 8:38 am
by fehlix
TOTAL wrote: Sun Nov 10, 2019 8:27 am
Code: Select all
Number Start End Size Type File system Flags
1 1049kB 525MB 524MB primary ntfs boot
2 526MB 160GB 159GB primary ntfs
3 160GB 232GB 72.4GB extended lba
6 160GB 168GB 8392MB logical linux-swap(v1)
5 168GB 232GB 64.0GB logical ntfs
4 232GB 275GB 42.8GB primary ext4
OK, the boot flag is fine.
So next step run MX Boot Repair from LiveUSB and select MBR as Grub-loader installation target.
And do also select regenrate grub.cfg menu.
Re: Bootloader fix needed after installing MX
Posted: Sun Nov 10, 2019 11:38 am
by TOTAL
I have run mx boot repair under root but while logged into linux. Selected option reinstall grub bootloader, install on mbr, location: the whole disk, root location: sda4.
windows is not booting.
the message returned upon trying to boot windows 7 is actually about missing bootmgr file.
Not sure where I can select regenrate grub.cfg menu.
Re: Bootloader fix needed after installing MX
Posted: Sun Nov 10, 2019 12:05 pm
by fehlix
TOTAL wrote: Sun Nov 10, 2019 11:38 am
I have run mx boot repair under root but while logged into linux.
Selected option reinstall grub bootloader, install on mbr, location: the whole disk, root location: sda4.
Not sure what this mean. Did you booted from LiveUSB. It better not to login as root into LiveSession.
TOTAL wrote: Sun Nov 10, 2019 11:38 am
windows is not booting.
Not clear: You first post was about.
TOTAL wrote: Sat Nov 09, 2019 3:35 am
I can no longer get anything booted
Can you now boot into MX Linux, or not?
TOTAL wrote: Sun Nov 10, 2019 11:38 am
Not sure where I can select regenrate grub.cfg menu.
That could be done from booted LiveUSB using MX boot Repair.
Or when booted into installed MX Linux with terminal like
Please describe better what you doing, otherwide it not easy to help.
Re: Bootloader fix needed after installing MX
Posted: Sun Nov 10, 2019 12:11 pm
by Huckleberry Finn
TOTAL wrote: Sun Nov 10, 2019 11:38 am
the message returned upon trying to boot windows 7 is actually about
missing bootmgr file.
Oh, I think you need to "repair" Win. ..
Just inserting the Win. installation Media and start "as if you were installing",set time & language, then click "repair" .. Something easy.
But when there's "grub" on mbr, the installation media will not boot, too.. Therefore first erasing the mbr or writing Windows mbr there (temporarily) then reinstalling Grub is needed imho.
Re: Bootloader fix needed after installing MX
Posted: Sun Nov 10, 2019 12:17 pm
by fehlix
Huckleberry wrote: Sun Nov 10, 2019 12:11 pm
TOTAL wrote: Sun Nov 10, 2019 11:38 am
the message returned upon trying to boot windows 7 is actually about
missing bootmgr file.
Oh, I think you need to "repair" Win. ..
Just inserting the Win. installation Media and start "as if you were installing",set time & language, then click "repair" .. Something easy.
But when there's "grub" on mbr, the installation media will not boot, too.. Therefore first erasing the mbr or writing Windows mbr there (temporarily) then reinstalling Grub is needed imho.
That might not needed, the boot flag might be on the wrong partition. OP can still try to boot in Windows to see that it booting with the Boot Rescue Menu from the LiveDVD/USB.
Re: Bootloader fix needed after installing MX
Posted: Sun Nov 10, 2019 12:25 pm
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 ...
Re: Bootloader fix needed after installing MX
Posted: Mon Nov 11, 2019 2:19 am
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.
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.
Re: Bootloader fix needed after installing MX
Posted: Mon Nov 11, 2019 7:53 am
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)
Re: Bootloader fix needed after installing MX
Posted: Mon Nov 11, 2019 2:43 pm
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.
Re: Bootloader fix needed after installing MX
Posted: Mon Nov 11, 2019 2:50 pm
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...
Re: Bootloader fix needed after installing MX
Posted: Mon Nov 11, 2019 9:11 pm
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.
Re: Bootloader fix needed after installing MX
Posted: Mon Nov 11, 2019 9:36 pm
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)
Re: Bootloader fix needed after installing MX
Posted: Fri Jan 10, 2020 10:20 pm
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.
Re: Bootloader fix needed after installing MX
Posted: Sat Jan 11, 2020 10:50 am
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
