MX-15/16 Tutorial Restore grub in EFI or Legacy mode

Topics relating to MX Docs and MX Videos
Post Reply
Message
Author
asinoro
Posts: 152
Joined: Mon Feb 22, 2016 12:26 pm

MX-15/16 Tutorial Restore grub in EFI or Legacy mode

#1 Post by asinoro »

Fast Fix MX Grub From MX
If you want to have the MX Grub, then from MX for Legacy Mode:
Boot repair from MX Tools,

Or open the terminal:

Code: Select all

sudo su
Then:

Code: Select all

grub-install /dev/sda ; update-grub
For Uefi Mode

Find first your Uefi partition to mount.

Code: Select all

sudo su

Code: Select all

parted -l
Where sdaX your EFI partition and run the command.

Code: Select all

mount /dev/sdaX /boot/efi ; grub-install /dev/sda ; update-grub
If for some reasons it doesn’t work follow steps 1.7 to 1.10. for Uefi or Legacy.


Method Reinstall broken Grub
Reinstall broken Grub from Live Medium, DVD, USB
When you run the MX Live Medium, DVD, USB, open the terminal.

Step1

1.1. Run the command,

Code: Select all

sudo su
1.2. Then the command, to see which partition has your OS.

Code: Select all

lsblk -f
1.3. After the command, where X is your OS partition.

Code: Select all

mount /dev/sdaX /mnt
1.4. Now you have to mount, bind and chroot mnt, with the follow command,

Code: Select all

mount --bind /dev /mnt/dev && mount --bind /sys /mnt/sys && mount --bind /proc /mnt/proc && chroot /mnt
1.5. To verify that you are in the right partition run the command.

Code: Select all

lsb_release -a
1.6. If for any reason something went wrong run exit command to execute again the procedure.

Code: Select all

exit
Fix Grub on Uefi mode

1.7. Reinstall grub-efi it will ask you to remove grub-pc and mx-bootrepair you will say yes because both are for legacy mode and you don't need them.

Code: Select all

apt-get install --reinstall grub-efi
1.8. Next is to find where is the EFI partition, run the command:

Code: Select all

parted -l
It would look like:
2 1050MB 1322MB 273MB fat32 EFI system partition boot, hidden, esp

1.9. Replace the command sdaX with yours and run.

Code: Select all

mount /dev/sdaX /boot/efi ; apt-get install --reinstall grub-efi-amd64 ; grub-install /dev/sda ; update-grub
Fix Grub on legacy mode

1.10. The most pc, laptop have the grub installed on sda where Windows are, and it is the correct way if you are dual boot with Windows. Enter the following command.

Code: Select all

apt-get install --reinstall grub ; grub-install /dev/sda ; update-grub

If you run from live medium you can restart to find again you OS.


If you like to remember your grub the last operating system you have used then:

1.11.

Code: Select all

sudo leafpad /etc/default/grub
Modify or add the missing commands:

Code: Select all

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
Save and Close the document and next:

Code: Select all

sudo update-grub
Next time your PC or laptop will start with last OS you used.

Enjoy MX Linux.
Last edited by asinoro on Sat Oct 28, 2017 2:00 am, edited 40 times in total.
If your case is solved, edit [Solved] to your initial post title to help other users.

Fix your Grub

User avatar
Jerry3904
Administrator
Posts: 21881
Joined: Wed Jul 19, 2006 6:13 am

Re: MX-15 Linux Tutorial Restore grub into EFI or Legacy mod

#2 Post by Jerry3904 »

That's great, thanks. I hope someone will run it through so we can verify it.
Production: 5.10, MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox and Windows 10
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin

User avatar
kmathern
Developer
Posts: 2402
Joined: Wed Jul 12, 2006 2:26 pm

Re: MX-15 Linux Tutorial Restore grub into EFI or Legacy mod

#3 Post by kmathern »

I don't see a reason for downloading Super Grub2 Disk, I think you can pretty much do the same from the MX-15 LiveUSB/LiveDVD. That would eliminate steps 1 thru 3.

And in step 6.2 you can run the partition-info command to show which one is the EFI System Partition (ESP)

Code: Select all

sudo partition-info all

asinoro
Posts: 152
Joined: Mon Feb 22, 2016 12:26 pm

Re: MX-15/16 Tutorial Restore grub in EFI or Legacy mode

#4 Post by asinoro »

This tutorial has been updated and includes how to fix grub from live DVD, USB.
Last edited by asinoro on Tue Sep 19, 2017 1:30 am, edited 1 time in total.
If your case is solved, edit [Solved] to your initial post title to help other users.

Fix your Grub

Post Reply

Return to “Documentation and videos”