Welcome!
Important information
-- Spectre and Meltdown vulnerabilities
-- Change in MX sources

News
-- MX Linux on social media: here
-- Mepis support still here

Current releases
-- MX-17.1 Final release info here
-- antiX-17 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

Reinstall Grub (MX + win7 on hybrid uefi laptop)

Post Reply
Message
Author
Mich-C
Forum Novice
Forum  Novice
Posts: 48
Joined: Tue Nov 21, 2017 1:11 pm

Reinstall Grub (MX + win7 on hybrid uefi laptop)

#1 Post by Mich-C » Sun Jul 29, 2018 11:54 am

Hi guys, so here's my problem.
Last month I completed formatted my laptop HDD and I successfully installed MX 17.1
Then my brother asked me to install Windows 7 alongside MX because he needed to use a particular software.
First I had to convert my HDD from gpt to mbr (I used a live version of Minitool partition wizard) and then I successfully installed also Windows 7.
The problem is that grub has been overwritten this way... :(
So I downloaded from internet a software that allows the installation of grub from windows, for being sure I installed both the legacy and efi version of this software (my laptop can boot OSs both in legacy, efi and hybrid mode)
Now when I boot the pc I get this :

Code: Select all

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.

giving the exit command I can only boot into Windows
To solve this problems once for all I booted the same version of MX from a pendrive and I tryed to use the boot repair tools but the situation only got worse.
Can you help me? I' ve attached my configuration
P.S. MX tools also tells me I don't have an efi partition :confused:
You do not have the required permissions to view the files attached to this post.

User avatar
fehlix
Forum Guide
Forum Guide
Posts: 2055
Joined: Wed Apr 11, 2018 5:09 pm

Re: Reinstall Grub (MX + win7 on hybrid uefi laptop)

#2 Post by fehlix » Sun Jul 29, 2018 12:13 pm

Mich-C wrote:
Sun Jul 29, 2018 11:54 am
..I had to convert my HDD from gpt to mbr
..
legacy and efi version of this software (my laptop can boot OSs both in legacy, efi and hybrid mode)
Yes, and you are confusing also the OS's installed.
1st stick with one: Only UEFI or BIOS-mode ( execpt you are going to become an expert ;=)
the grub-installed for MX is certainly the UEFI-version, which connot boot the MBR-BIOS partion any longer.

So if you have already now a MBR-partion: stick with BIOS-mode
2nd: having WinOS partition after linux partion will sooner or later bring you into trouble.
My tipp of the day: keep the WinOS partion as the first partions after that have the ext4 Linux partions

Easiest: Recover the data from MX-partiton e.g. with help of a LiveStick and start from scratch

You might try to boot from LiveMedia MX-17 in legacy boot and try the repair grub (legacy)
using MX-BootRepair. Not sure it will work as you installed grub an MX is Grub-efi.

Anyother expert way: Try to boot the MX-partion with help of Supergrub2
and reinstall grub2 (leagacy) and recreate the grub (legacy) by this.

+++
EDIT: After you transformed the gpt to mbr partition, you need also to check the UUID's within /etc/fstab,
as I assume they have been changed due to this transformation. good luck
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

Mich-C
Forum Novice
Forum  Novice
Posts: 48
Joined: Tue Nov 21, 2017 1:11 pm

Re: Reinstall Grub (MX + win7 on hybrid uefi laptop)

#3 Post by Mich-C » Mon Jul 30, 2018 10:17 am

Thanks for the reply
fehlix wrote:
Sun Jul 29, 2018 12:13 pm
having WinOS partition after linux partion will sooner or later bring you into trouble.
Yes, I knew that one day I'll need to reinstall also Windows here, so I tryed to be prudent leaving unformatted part of the HDD when installing MX, I think that at least it's a better solution than resizing at a later time. I didn't even know that Windows 7 refuses to install on gpt disks
fehlix wrote:
Sun Jul 29, 2018 12:13 pm
After you transformed the gpt to mbr partition, you need also to check the UUID's within /etc/fstab,
as I assume they have been changed due to this transformation
At the moment I don't know what you are talking about lol, after fixing the boot I'll search infos on the forum ;)
fehlix wrote:
Sun Jul 29, 2018 12:13 pm
You might try to boot from LiveMedia MX-17 in legacy boot and try the repair grub (legacy)
using MX-BootRepair. Not sure it will work as you installed grub an MX is Grub-efi.
Sorry maybe I didn't explain well, I already resulted to boot the same version of MX from a pendrive, I run the MX boot repair tool and I used its "reinstall grub" and "repair grub" functions. Actually this tool correctly detected win7 on sda1 and linux files on the other partition, the problem is that I couldn't replace the corruped grub because I'm not sure about the location... :confused: It will be awesome If someone can guide me through the boot repair tools

User avatar
fehlix
Forum Guide
Forum Guide
Posts: 2055
Joined: Wed Apr 11, 2018 5:09 pm

Re: Reinstall Grub (MX + win7 on hybrid uefi laptop)

#4 Post by fehlix » Mon Jul 30, 2018 3:52 pm

Mich-C wrote:
Mon Jul 30, 2018 10:17 am
... I run the MX boot repair tool and I used its "reinstall grub" and "repair grub" functions. Actually this tool correctly detected win7 on sda1 and linux files on the other partition, the problem is that I couldn't replace the corruped grub because I'm not sure about the location...
Here what I would do:
- boot in BIOS-mode (not in UEFI mode) from LiveUSB perfarable latest MX17.1 June
- connect to the internet and make a update, to be sure you get the latest
- start Boot Repair
-> select Reinstall GRUB boot loader
-> Install on : MBR
-> Location : sda
-> Select /boot location: sda2 629 GB rootMX17

Now you should be able to start and get an Grub-menu.
But you might still no successfully boot into MX-Linux
as the UUID within fstab might still be wrong:

After you converted from GPT to MSDOS/BIOS partition scheme I do assume that all partitions do have new UUID.
If thats the case: Please post the output of the following command:

Code: Select all

lsblk -f
and the content of /etc/fstab on the partion /dev/sda2 ( rootMX17 )
Open Filemanager click on rootMX17 to mount and navigate to /media/username/rootMX17/etc/
and click on fstab to open with editor.
Post the content here.
:puppy:
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

Mich-C
Forum Novice
Forum  Novice
Posts: 48
Joined: Tue Nov 21, 2017 1:11 pm

Re: Reinstall Grub (MX + win7 on hybrid uefi laptop)

#5 Post by Mich-C » Tue Jul 31, 2018 11:54 am

fehlix wrote:
Mon Jul 30, 2018 3:52 pm
Here what I would do:
- boot in BIOS-mode (not in UEFI mode) from LiveUSB perfarable latest MX17.1 June
- connect to the internet and make a update, to be sure you get the latest
- start Boot Repair
-> select Reinstall GRUB boot loader
-> Install on : MBR
-> Location : sda
-> Select /boot location: sda2 629 GB rootMX17
Thanks again for the help felhix, I'm not sure If I followed exactly your steps because I tryed again before your reply, anyway I resulted to get back the working MX grub! :number1: Booting in lecacy mode I can use both MX and Windows, everything works also in hybrid mode but in this case I still have to bypass the corrupted grub typing exit... :(
----------

I don't know if it's just an impression (I haven't use MX for a while) but it's boot time seems increased during the "no irq handler..." loading. I thought about 2 causes
1)I don't have a swap partition anymore, but I don't think MX uses swap to speedup the boot in general... anyway my pc has 8gb of ram
2)booting in legacy mode is usally slower than efi/ hybrid efi mode
fehlix wrote:
Mon Jul 30, 2018 3:52 pm
the UUID within fstab might still be wrong:
After you converted from GPT to MSDOS/BIOS partition scheme I do assume that all partitions do have new UUID.
Please post the output of the following command: lsblk -f
here:

Code: Select all

NAME   FSTYPE LABEL    UUID                                 MOUNTPOINT
sda                                                         
├─sda1 vfat            9CB6-93CB                            /boot/efi
├─sda2 ext4   rootMX17 000b8288-8795-4f5a-82da-63bd350d5385 /
├─sda3 ntfs            14763C9A763C7F14                     
├─sda4                                                      
└─sda5 ntfs   Dati     8602242E022425A1                     
sr0            
fehlix wrote:
Mon Jul 30, 2018 3:52 pm
and the content of /etc/fstab on the partion /dev/sda2 ( rootMX17 )

Code: Select all

# /etc/fstab: static file system information
#
# Created by make-fstab on Wed May 23 16:15:13 EDT 2018

# <file system>                            <mount point>                               <type>     <options>                       <dump/pass>

#-> /dev/sda2  label=rootMX17
UUID=000b8288-8795-4f5a-82da-63bd350d5385  /                                           ext4       defaults                        1 1
#-> /dev/sda1
UUID=9CB6-93CB                             /boot/efi                                   vfat       defaults                        1 2
#-> /dev/sda3  label=MXswap
UUID=fa2ac698-0605-46d1-b82f-5585e5e6973a  swap                                        swap       defaults                        0 0

User avatar
fehlix
Forum Guide
Forum Guide
Posts: 2055
Joined: Wed Apr 11, 2018 5:09 pm

Re: Reinstall Grub (MX + win7 on hybrid uefi laptop)

#6 Post by fehlix » Tue Jul 31, 2018 12:30 pm

First, don't boot in UEFI mode, you will get more trouble otherwise.
You'r fstab does contains wrong entries, thats way legacy mode takes long.
To fix the /etc/fstab as follows:

Code: Select all

# /etc/fstab: static file system information
#
# Created by make-fstab on Wed May 23 16:15:13 EDT 2018

# <file system>               <mount point> <type> <options> <dump/pass>

#-> /dev/sda2  label=rootMX17
UUID=000b8288-8795-4f5a-82da-63bd350d5385  /   ext4 defaults    1 1
Now do update the initial boot-loader

Code: Select all

sudo update-initramfs -u -k all
And do also regenrate the grub again from command line:
re-generate the grub-menu:

Code: Select all

sudo update-grub
and freshly re-install the grub-boot-loader:

Code: Select all

sudo grub-install /dev/sda
:puppy:
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

Mich-C
Forum Novice
Forum  Novice
Posts: 48
Joined: Tue Nov 21, 2017 1:11 pm

Re: Reinstall Grub (MX + win7 on hybrid uefi laptop)

#7 Post by Mich-C » Wed Aug 01, 2018 4:13 am

fehlix wrote:
Tue Jul 31, 2018 12:30 pm
You'r fstab does contains wrong entries, thats way legacy mode takes long.
Ok, first of all thanks. I have two curiosities
1) Could these wrong entires in the fstab slow down also Windows boot?
2) If one day I decide to create a new swap and/or ext partion, will my configuration corrupt again?
fehlix wrote:
Tue Jul 31, 2018 12:30 pm
To fix the /etc/fstab as follows:
sudo update-initramfs -u -k all
sudo update-grub
sudo grub-install /dev/sda
Followed each step but when I give the last command I get some errors :eek: (I'm italian)

Code: Select all

Installazione per la piattaforma i386-pc.
grub-install: avviso: L'area di embed è troppo piccola. Il file core.img non può esservi contenuto..
grub-install: avviso: L'embed non è possibile. GRUB può essere installato con questa configurazione solo usando blocklist. Le blocklist non sono comunque affidabili e ne viene sconsigliato l'uso..
grub-install: errore: impossibile procedere con le blocklist.
the translation is something like

Code: Select all

installing for the i386-pc platform
grub-install: warning: embed area is too small. core.img file can't be contained ..
grub-install: warning: embed is not possible. GRUB can't be installed with this configuration using just blocklists. Blocklists are anyway reliable and their use is discuraged
grub-install: warning: impossible to proceed with blocklists.

User avatar
fehlix
Forum Guide
Forum Guide
Posts: 2055
Joined: Wed Apr 11, 2018 5:09 pm

Re: Reinstall Grub (MX + win7 on hybrid uefi laptop)

#8 Post by fehlix » Wed Aug 01, 2018 9:01 am

Mich-C wrote:
Wed Aug 01, 2018 4:13 am

Code: Select all

installing for the i386-pc platform
grub-install: warning: embed area is too small. core.img file can't be contained ..
grub-install: warning: embed is not possible. GRUB can't be installed with this configuration using just blocklists. Blocklists are anyway reliable and their use is discuraged
grub-install: warning: impossible to proceed with blocklists.
That error seems related to the conversion you made from GPT to MBR-partition scheme.
The reason: The space between the first partition and the beginning of the drive was not big
enough to hold the full MBR-standard partition header( which is not only the MBR but some additonal space).
I need to look to find a way how to repair this, if possible.
As grub is very cautious, you need to convince grub to use the alternative blocklist sceme instead,
by running:

Code: Select all

sudo grub-install --force /dev/sda
re your other questions:
1) Could these wrong entires in the fstab slow down also Windows boot?
Don't think so, Windows ignores all ext4 partitions.

2) If one day I decide to create a new swap and/or ext partion, will my configuration corrupt again?
No, just enter a new line with fstab similar to the old one you had,
but with the correct UUID of the swap partition.
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

Mich-C
Forum Novice
Forum  Novice
Posts: 48
Joined: Tue Nov 21, 2017 1:11 pm

Re: Reinstall Grub (MX + win7 on hybrid uefi laptop)

#9 Post by Mich-C » Thu Aug 02, 2018 11:41 am

fehlix wrote:
Wed Aug 01, 2018 9:01 am

The space between the first partition and the beginning of the drive was not big
enough to hold the full MBR-standard partition header( which is not only the MBR but some additonal space).
I need to look to find a way how to repair this, if possible.
As grub is very cautious, you need to convince grub to use the alternative blocklist sceme instead,
by running sudo grub-install --force /dev/sda
Thank you. Operation completed without errors (despite we got a working grub even before doing this operation)
P.S. The time in Windows is wrong, I had to set it again 2 times but I think it's just a temporary problem ;)

User avatar
fehlix
Forum Guide
Forum Guide
Posts: 2055
Joined: Wed Apr 11, 2018 5:09 pm

Re: Reinstall Grub (MX + win7 on hybrid uefi laptop)

#10 Post by fehlix » Thu Aug 02, 2018 11:52 am

Mich-C wrote:
Thu Aug 02, 2018 11:41 am
Thank you. Operation completed without errors (despite we got a working grub even before doing this operation)
P.S. The time in Windows is wrong, I had to set it again 2 times but I think it's just a temporary problem ;)
The time in windows is "always" wrong as MS resist to accept usage of UTC time.
You can solve this by either change to locale time, so your bios-clock holds the local time!
With this you will get other problems with Linux.

Or
as I do this, I stick with the linux recommended way and keep BIOS-clock in UTC (=GMT),
and do change my WinOS-time/time zone to Europe/London, but change the display time to my home timezone.
Or
try to convince Windows to respect UTC time in bios, using some registry hacks.

See the manual for some more hints.
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

Post Reply

Return to “Installation”