update-grub

Archived topics about LMDE 1 and LMDE 2
Locked
tec_wiz

update-grub

Post by tec_wiz »

Hello,

I have a quick question. I have deleted a partition on my hard drive and needed to update grub so that it would remove that linux install from the list. I was pretty sure I knew how to do that, so in the terminal I ran sudo update-grub. I've done this before and I don't remember having to do anythign else. The terminal gave no errors, and everything seemed fine.

I rebooted to test the chagnes and no it boots into the grub recovery console.

Can someone help me out here. I'm assuming I have to use a live cd to correct, but I've never run into this problem before. I have found a few guides on google, but they all pertain to Grub2 and I thought LMDE is still using Grub.

Thanks for your help.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
CiaW

Re: update-grub

Post by CiaW »

LMDE uses grub2, not 'legacy grub', so if you have a good tutorial or 2 for grub2 I'd go with those. I know when I booted this morning I got a kernel panic, but after a hard reboot it booted up fine.(no changes to grub in the last couple of days though.)
lmintnewb

Re: update-grub

Post by lmintnewb »

Coupla things you might want to consider here.

If the partition you deleted had an install of some distro of linux installed on it. Then it had a kernel associated with that distro too. When you get rid of a kernel or update your kernel you need to mark the old one's and one's you no longer want to appear in grub's menu for complete removal in synaptic.

Then do the sudo update-grub command. Just deleting the partition won't do it. Otherwise that kernel is still no doubt there and grub would still have record of it. Particularly if that older kernel were set to be your default boot partition. Am not familiar with the grub recovery console or what options it gives you to repair your system. Might try booting with the livecd and see what you can do with that.

Could also reinstall grub. There's many free utilities and tools to do that. But afterwards would still make sure you mark all the old kernels on your system for complete removal and then update grub again.

Here's the tute I used when I recently updated my Mint's kernel. Worked perfectly for me in showing me how to properly get rid of older kernels.

http://www.howtogeek.com/howto/17787/cl ... boot-menu/


And here's a recent Mint forum thread about a guy having some issues when upgrading his kernel somehow corrupted grub2. Which the answer was reinstalling grub in his case. There's a tool mentioned that he used to reinstall grub. Though should be a couple terminal commands to do it if you feel like learning how to reinstall grub via terminal.

http://forums.linuxmint.com/viewtopic.php?f=46&t=70749

Plus there are tons of other tools and util to reinstall/repair etc grub. You can find them either searching the forum for "reinstall grub" and similar or on google.
Aging Technogeek

Re: update-grub

Post by Aging Technogeek »

Another method to reinstall Grub is this

https://help.ubuntu.com/community/Grub2 ... m%20LiveCD

All you need is the live CD/DVD you used to install Mint and a few minutes.

I have used this method quite often and it has always worked.
lmintnewb

Re: update-grub

Post by lmintnewb »

^ This guy knows what he's talking about. Would listen to him for sure. Plus hey looks like you don't need any utility other than the livecd you used. I'm going to look that guide in the link over too. So I'll know how to fix grub when/if it gets messed up in the future. Thanks Techno ...

Still OP, remember the thing about getting rid of older kernels too. That still applies o course. ( edit ) Also I advise you to listen to kenny rogers ... Don't fall in love with a dreamer. Errrr ... won't help your tech issues. But it's a good song, lol.
User avatar
Roken
Level 5
Level 5
Posts: 737
Joined: Fri Nov 19, 2010 4:55 pm
Location: Newport, S Wales

Re: update-grub

Post by Roken »

The link appears to be overkill, IMO. This will do it:

Boot the live CD, mount your linux partition and open a terminal. The mount point if you do it via nautilus will be /media/UUIDofDisk

In the terminal:

sudo mount --bind /sys /media/UUID/sys
sudo mount --bind /proc /media/UUID/proc
sudo mount -bind /dev /media/UUID/dev
sudo chroot /media/UUID
apt-get remove grub-pc grub-common
apt-get install grub-pc grub-common
update-grub

Then reboot. This has worked for me every time I've had to reinstall grub2 with no problems. It also retains any grub customisations that you've made (BG pic, screen resolution, savedefault etc.
Kernel Linux Tex 5.12.14-zen1-1-zen, XFCE
Arch
Dual GTX1070 8Gb
AMD Ryzen 1800X
32Gb RAM
lmintnewb

Re: update-grub

Post by lmintnewb »

Just my opinion on it. But it's better to know too much, than not enough. Didn't look over the link TG provided yet. Bookmarked it for later. But seems like people run into problems with grub so often. It's not a bad idea for them to know for sure how to do it from the livecd/dvd.

And spend some time getting familiar with grub2. I'm going to learn TG's tech myself. That way I know I'm covered. Again better to have more info about something than ya need. Than too little to get the job done or your OS fixed.


:D
Aging Technogeek

Re: update-grub

Post by Aging Technogeek »

That's one of the good things about Linux. There is almost always more than one way to get something done. In a topic like this I really like to see multiple options listed. The OP or anyone else looking for help can then read all the different methods and chose the one he/she is most comfortable using.
tec_wiz

Re: update-grub

Post by tec_wiz »

Thak you all for the replies. i will give these a try when I get home.
Locked

Return to “LMDE Archive”