[SOLVED] Clean up grub

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
nonno13
Level 2
Level 2
Posts: 55
Joined: Mon Feb 06, 2017 1:21 pm

[SOLVED] Clean up grub

Post by nonno13 » Mon Feb 04, 2019 10:06 am

I have a dual boot system with linux mint and Windows 10. I needed to update some software in windows 10 and while I was there it indicated that my HP 260 needed some important updates. So, I downloaded and installed the updates. Unfortunately, one of the updates changed the BIOS. So, afterwards it booted directly into windows 10.

The only thing I could think of was to reinstall linux mint. So, I created a 50GB partition, installed the linux mint dvd with 18.1 on it and reinstalled linux mint while keeping other operating sysems. I worked -- kinda.

I now have a boot with the new linux mint installation, my original linux mint (with all of my important files) and windows 10 and everything works fine. So, now I need to clean up the mess.

What is the best way to get rid of the new linux mint installation, restore my 50GB partition and clean up the grub so that it only contains my original linux mint and windows 10?
Last edited by nonno13 on Tue Feb 05, 2019 11:44 am, edited 1 time in total.

puddleglum
Level 1
Level 1
Posts: 37
Joined: Fri Dec 22, 2017 12:03 pm

Re: Clean up grub

Post by puddleglum » Mon Feb 04, 2019 10:49 am

Boot into your original Linux Mint. Bring up a terminal and reinstal grub from the there by typing:

Code: Select all

sudo grub-install
sudo update-grub
Now reboot to make sure this Linux is now first in the GRUB boot menu list. After that you can use a tool like GParted or the Disc Image Tool to delete the new 50GB Partition. If you are using GParted you can add it back to where ever it came from. Finally run update-grub again and the new linux should be gone from your boot menu.

nonno13
Level 2
Level 2
Posts: 55
Joined: Mon Feb 06, 2017 1:21 pm

Re: Clean up grub

Post by nonno13 » Mon Feb 04, 2019 5:34 pm

Puddlegum,

Thank you very much for your suggestion. i have run the grub update as you suggested. However, I hesitate to go ahead with the next steps because in the grub menu the original linux mint is first, windows is second and my new linux mint is third. I am concerned that after I delete the 50GB linux partition 2 things may happen. One, windows will be first in the grub menu and may automatically go straight right into windows 10 and I am back where I started. Two, the grub will have windows first and I will have to arrow down to get into my original linux every time that I bootup.

Is there something that I can do to be assured that either of these 2 things won't happen?

User avatar
MrEen
Level 15
Level 15
Posts: 5568
Joined: Mon Jun 12, 2017 8:39 pm

Re: Clean up grub

Post by MrEen » Mon Feb 04, 2019 5:48 pm

Hi nonno13.

Puddleglum's instructions are just what you want.

Boot to your original Mint, and issue those commands. That will make your original Mint the default choice in grub. Windows will be either the second or third choice after that. You can then wipe the 50GB partition followed by sudo update-grub which will remove the new Mint entry from grub and leave Windows as the second choice.

Good luck.

EDIT: Oops, we forgot the device. The first command should probably be sudo grub-install /dev/sda. You can confirm by looking at the cat /etc/fstab output. Here's mine for reference:

Code: Select all

scott@scott-HP ~ $ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda5 during installation
UUID=39f1aa54-8767-49b9-a5ad-c38527cc6063 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda6 during installation
UUID=cc062969-3321-40a3-80b0-9d740ae15748 none            swap    sw              0       0
# Mount DATA partition under /mnt/DATA
UUID=05a33f05-3f5c-4f58-b28c-b41af4494de6  /mnt/DATA     ext4     defaults     0     2
scott@scott-HP ~ $
Notice I did not say /dev/sda5 for the command. You install grub to the device, not the partition (generally.)

nonno13
Level 2
Level 2
Posts: 55
Joined: Mon Feb 06, 2017 1:21 pm

Re: Clean up grub [SOLVED]

Post by nonno13 » Mon Feb 04, 2019 6:45 pm

thank you all,

I did exactly as Puddlegum recommended in his initial post. Everything worked great. That is: I ran sudo grub-install (without /dev/sda) and sudo update grub from the terminal of my original linux. This made my original linux firt in grub. I used gparted to delete the new linux partition and moved the 50GB back to its original partition. I rebooted and again ran sudo update-grub to get rid of the new linux in grub.

Everything is back to normal. i DON'T KNOW WHAT i WOULD DO WITHOUT THIS FORUM. Thank you again.

User avatar
MrEen
Level 15
Level 15
Posts: 5568
Joined: Mon Jun 12, 2017 8:39 pm

Re: Clean up grub

Post by MrEen » Mon Feb 04, 2019 6:53 pm

Very nice, nonno13. I was a little worried as I haven't seen grub-install used without giving it something to install to before. Makes sense it would know where to install to in your case.

Post Reply

Return to “Installation & Boot”