update-grub

Questions about Grub, the liveCD and the installer
Forum rules
Before you post please read how to get help

update-grub

Postby tec_wiz on Mon Apr 18, 2011 11:03 am

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.
tec_wiz
Level 1
Level 1
 
Posts: 38
Joined: Tue Oct 12, 2010 8:43 am

Linux Mint is funded by ads and donations.
 

Re: update-grub

Postby CiaW on Mon Apr 18, 2011 11:15 am

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.)
CiaW
Level 3
Level 3
 
Posts: 170
Joined: Fri Sep 10, 2010 11:39 am
Location: Spokane Wash, USA

Re: update-grub

Postby lmintnewb on Mon Apr 18, 2011 11:59 am

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.

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.
lmintnewb
Level 7
Level 7
 
Posts: 1574
Joined: Fri Apr 01, 2011 5:13 pm

Re: update-grub

Postby Aging Technogeek on Mon Apr 18, 2011 12:05 pm

Another method to reinstall Grub is this

https://help.ubuntu.com/community/Grub2?action=show&redirect=GRUB2#Reinstalling%20from%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.
Image

Registered Linux User 483387
User avatar
Aging Technogeek
Level 13
Level 13
 
Posts: 4604
Joined: Sun Jan 11, 2009 9:54 am
Location: Right about here

Re: update-grub

Postby lmintnewb on Mon Apr 18, 2011 12:07 pm

^ 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.
lmintnewb
Level 7
Level 7
 
Posts: 1574
Joined: Fri Apr 01, 2011 5:13 pm

Re: update-grub

Postby Roken on Mon Apr 18, 2011 12:26 pm

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 3.2.2-1 (64 bit) xfce , burg
Arch
ATI Radeon HD 4670, 1GB
OSS4
AMD Phenom II X4 (965BE) @ 3.6 Ghz (Overclocked)
8Gb RAM
Image
User avatar
Roken
Level 5
Level 5
 
Posts: 747
Joined: Fri Nov 19, 2010 4:55 pm
Location: Oldham, UK

Re: update-grub

Postby lmintnewb on Mon Apr 18, 2011 12:34 pm

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
lmintnewb
Level 7
Level 7
 
Posts: 1574
Joined: Fri Apr 01, 2011 5:13 pm

Re: update-grub

Postby Aging Technogeek on Mon Apr 18, 2011 12:51 pm

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.
Image

Registered Linux User 483387
User avatar
Aging Technogeek
Level 13
Level 13
 
Posts: 4604
Joined: Sun Jan 11, 2009 9:54 am
Location: Right about here

Re: update-grub

Postby tec_wiz on Mon Apr 18, 2011 3:08 pm

Thak you all for the replies. i will give these a try when I get home.
tec_wiz
Level 1
Level 1
 
Posts: 38
Joined: Tue Oct 12, 2010 8:43 am

Linux Mint is funded by ads and donations.
 

Return to Installation & Boot

Who is online

Users browsing this forum: No registered users and 2 guests