Correcting the Boot Menu

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
jimisbell
Level 3
Level 3
Posts: 151
Joined: Fri May 07, 2010 7:15 pm
Location: The Third Coast

Correcting the Boot Menu

Post by jimisbell »

I am running Mint 8 (Helena) on a Dell Vostro 1500 laptop in dual boot with Win 7.

The boot menu lists Mint as the first selection and Win 7 as the last selection.

I would like to change the sequence of the boot menu so that Win 7 is the first line. My wife uses this computer most of the time and if she doesnt watch it, it will boot up in Linux, which she doesnt like.

In my old distro the file I needed to modify was menu.lst, but I have not been able to find that file on Mint.

Where is the file I need to modify and what is it called?

What program should I use to edit the file?
Democracy is two wolves and a sheep discussing what's for dinner. Freedom is a well armed sheep contesting the decision.
User avatar
Aging Technogeek
Level 13
Level 13
Posts: 4578
Joined: Sun Jan 11, 2009 9:54 am
Location: Right about here

Re: Correcting the Boot Menu

Post by Aging Technogeek »

If you just want to set Win 7 as default boot without changing the order in the boot menu, there are acouple of easy ways to do it.

1. In terminal.
Boot into Mint and, when the boot menu is visible, count the number of entries to get to Win 7. Remember, Grub starts numbering at 0, not 1.
Open a terminal and enter

Code: Select all

 gksu gedit /etc/default/grub
. When the grub default menu comes up, change Grub Default from 0 to the number you got from counting the boot menu entries. Click "Save" and reboot to make sure you got the number right. If Win 7 is now the default boot, it will be in the same position in the menu but it will be highlighted.

2 GUI
Install "startupmanager" from Package Manager. This puts an entry in your menu that you can call and get a Gui method of editing Grub, including setting the default boot OS
Registered Linux User 483387
jimisbell
Level 3
Level 3
Posts: 151
Joined: Fri May 07, 2010 7:15 pm
Location: The Third Coast

Re: Correcting the Boot Menu

Post by jimisbell »

In the title of the file it states that if the file is changed then I have to "run update-grub" But I dont know how to do that since it apparently does NOT run in the terminal. At least nothing happens when I enter that phrase and hit cr.

Well, almost nothing. I discovered that by closing the terminal and reopening it that I could enter the phrase and it tells me I have to run it as root. I then typed in "root" and it suggested installing "root" which I did and then I ran it and then tried running "update-grub" and got a message that neither of the words was recognized.

Further up date...I now have figured out that "root" is apparently a programming tool related to C+ and not what the Terminal was telling me to do. Just the same name.....
Last edited by jimisbell on Mon May 17, 2010 12:08 am, edited 1 time in total.
Democracy is two wolves and a sheep discussing what's for dinner. Freedom is a well armed sheep contesting the decision.
User avatar
mick55
Level 6
Level 6
Posts: 1485
Joined: Fri Sep 25, 2009 2:47 am

Re: Correcting the Boot Menu

Post by mick55 »

Run this command in a terminal

Code: Select all

sudo update-grub
input your user password when requested
Things are more like they are now than they ever were before.

Dwight D. Eisenhower (1890 - 1969)
jimisbell
Level 3
Level 3
Posts: 151
Joined: Fri May 07, 2010 7:15 pm
Location: The Third Coast

Re: Correcting the Boot Menu

Post by jimisbell »

Ok, now I have tried both methods as proposed by AgingTechnogeek and both seem to work in the inplementation but in the end, the menu remains un changed.

With method #1 runing [sudo update-grub /boot/grub/grub.cfg] does not change the location of the highlight on the menu. it is still on the first line which is an new install of Mint (I need to get rid of it altogether because it doesnt work. When it failed I reinstalled Mint thinking it would overwrite the original. Instead it installed it AGAIN so I have three boot possibilities when including the Win 7. But I am not sure it didnt overwrite the original since the new install retained some of my added properties but the HD designations in the boot menu of the two Mint entry points are different ??? There are two different Mint boot lines, one works the other doesnt. but thats another problem)

With method #2 I can reset the boot OS to the Mint I want...but interestingly enough, NOT to Win 7....and then continue, but the end result of the menu after restarting is still the same...no change.

I am about to just do another install, BUT I dont want a menu with a THIRD entry point!!!!

Edit!
Well, its worse than I thought. There are TWO installs of Mint on the drive, one on SDA7 and one on SDA5. One is a virgin install...its the first line, followed by a recovery version and two memory test lines, then there is the Win 7 line and then the old Mint install, which is also now working. But I really need to clean this thing up because its wasting disk space and my wife cant handle the menu without freaking out.

I am an old programmer and can fix the menu if I can just get into it and edit it directly. I did that frequently on my other distros. But "startupmanager" doesnt give me anything but minimal access. and the update-grub command doesnt seem to update it anyway. I need to edit the file with a full up editor. I havent the foggiest idea what to do about the two installs of Mint. It would be nice to get rid of the second one because it wastes disk space, but if I can make it invisible on the menu, I can live with it being there. After a few weeks I wont remember its there and it will be as good as gone...#8-)
Democracy is two wolves and a sheep discussing what's for dinner. Freedom is a well armed sheep contesting the decision.
User avatar
DrHu
Level 17
Level 17
Posts: 7522
Joined: Wed Jun 17, 2009 8:20 pm

Re: Correcting the Boot Menu

Post by DrHu »

In Grub2, the custom entries (your own menu selections) are located under /etc/grub.d/40_custom
--and can be edited with root privilege under any text editor you use
  • nano
    gedit
    leafpad
--etc..etc.
User avatar
mick55
Level 6
Level 6
Posts: 1485
Joined: Fri Sep 25, 2009 2:47 am

Re: Correcting the Boot Menu

Post by mick55 »

jimisbell wrote:I am an old programmer and can fix the menu if I can just get into it and edit it directly.
Run this command in a terminal to edit it directly.
After doing this do not run update-grub or you will overwrite your editing.

Code: Select all

gksudo gedit /boot/grub/grub.cfg
For a full tutorial on the intricacies of GRUB2 read this page.
http://www.dedoimedo.com/computers/grub-2.html

Editing GRUB2 will allow you to remove the entries from the menu but the
the Mint installations are still there. You can remove them and enlarge
your current Mint install through gparted. Install it with this command.

Code: Select all

sudo apt-get install gparted
To see the layout of your partititions run these commands in a terminal

Code: Select all

sudo lshw -C disk

Code: Select all

sudo sfdisk -l

Code: Select all

inxi -plu
If inxi is not installed on your PC, install it with this command

Code: Select all

sudo apt-get install inxi
If you need help interpreting any of the results, post the output here for analysis.

Oh, and jimisbell it's not you, GRUB2 is a b*tch. :mrgreen:

PS ---- Copy and paste the above commands to ensure accuracy. :wink:
Things are more like they are now than they ever were before.

Dwight D. Eisenhower (1890 - 1969)
User avatar
Aging Technogeek
Level 13
Level 13
Posts: 4578
Joined: Sun Jan 11, 2009 9:54 am
Location: Right about here

Re: Correcting the Boot Menu

Post by Aging Technogeek »

mick55 is right Grub 2 is tough. If you are interested, there are a great many good links collected here.

I'm a little surprised that Start Up Manager is not seeing Win 7. It should list every OS in the boot menu. I have used Start Up Manager On systems with up th 5 OS installed, both Linux and Windows, with no problems. It can be quirky though. I installed Mint 8 on two computers, dual booting with WindowsXP Pro in both cases. On one system, Start Up Manager ran fine, on the other it would not even launch.

jimisbell said
With method #1 runing [sudo update-grub /boot/grub/grub.cfg] does not change the location of the highlight on the menu. it is still on the first line which is an new install of Mint (I need to get rid of it altogether because it doesnt work.
( emphasis mine,AT)

The procedure is to first, reboot your computer and, when the Grub menu is on screen, press any key to stop the countdown. Count all the entries from the top down to the Win 7 entry. Start counting at 0, not 1, as this is how Grub numbers entries. Each entry for Mint 9 must be counted separately (including memtest) and the line about "Other Operating Systems" must be counted. When this is done, save the number and boot into Mint 9.

Enter

Code: Select all

gksu gedit /etc/default/grub
in terminal and edit the file that is displayed. You need to change this line

Code: Select all

GRUB_DEFAULT=0


to reflect the position of the Os you want to boot as default. Replace the 0 with the number you got from the boot menu entry count.

Save the changed file and, back in the terminal enter

Code: Select all

sudo update-grub
You should not need to enter your password because the sudo authorization from the edit command should still be active.

If this is done correctly, the next time you boot the computer, the default should be Win 7. Win 7 will be highlighted in the boot menu and will boot without any action on your part but it will not move to the first spot in the menu,.
Last edited by Aging Technogeek on Mon May 17, 2010 9:02 am, edited 2 times in total.
Reason: Improve clarity of instructions
Registered Linux User 483387
User avatar
Aging Technogeek
Level 13
Level 13
Posts: 4578
Joined: Sun Jan 11, 2009 9:54 am
Location: Right about here

Re: Correcting the Boot Menu

Post by Aging Technogeek »

By the way, I deleted your duplicate topic.
Registered Linux User 483387
macd21
Level 1
Level 1
Posts: 3
Joined: Tue May 25, 2010 5:49 am

Re: Correcting the Boot Menu

Post by macd21 »

For those of you wanting your Windoz OS at the top of the list...

1. Open a terminal
2. Type
sudo ren /etc/grub.d/30_os-prober /etc/grub.d/01_os-prober
press "enter"
2. Type
sudo update-grub
press "enter"

This should move any entries found by the prober and put them just under the header at the top of the menu.

Want to find out why this works?
check: https://help.ubuntu.com/community/Grub2

The short version is that all the files in /etc/grub.d that are executable are run in alpha-numeric sequence.

Accepted practice is to use numbers that are not multiples of ten IE: (01..09) or (11..19) to place you custom scripts in between the standard ones.
jimisbell
Level 3
Level 3
Posts: 151
Joined: Fri May 07, 2010 7:15 pm
Location: The Third Coast

Re: Correcting the Boot Menu

Post by jimisbell »

Its been 4 months since I started this thread. I got the original problem solved...I convinced my wife to use Mint so she doesnt have to deal with the menu and neither do I

But now I am back in the middle of it as I am installing Mint 8 on my newest desktop AMD Athelon 64x2 Dual Core 5600+ running at 2.91ghz with 4 gb ram and two HDs, a 1TB and a 160GB. I am still not finding out how to re-make grub.cfg. I can modify etc/grub.d/40_Custom and then run /usr/sbin/grub-mkconfig and all looks well until I look at /boot/grub/grub.cfg and nothing has changed. Apparently the new make is placed somewhere else and is named differently since a search for the filename shows only the one instance at /boot/grub/grub.cfg

What is odd is that somewhere in the comments in the Mint 8 files I find the directions to use sudo update-grub rather than /usr/sbin/grub-mkconfig to make the new grub.cfg file. One of these must be incorrect and sudo update-grub gives an error message:

"Could not find /boot/grub/menu.lst file. Would you like /boot/grub/menu.lst generated for you? (y/N) "

which leads me to believe it is NOT GRUB2 since GRUB2 doesnt use menu.lst.

I would really prefer the old grub and menu.lst because I could manipulate it!!!

What I am trying to, ultimately, correct is to fix the menu so it will run on the 1tb drive, sdb, with the 160gb drive, sda, removed. Right now they are somehow dependent on each other. But not being able to make grub.cfg and get a change that is recognizable, I cant figure out which set of files the boot is using!!!

I have been keeping careful notes but just as I think I have it figured out, the notes dont work again!!

If I could just figure out how to manipulate grub.cfg I could get it fixed...I think...but that warning on the top of grub.cfg that says, IOW Dont Touch This Thing Directly, has me spooked.
Democracy is two wolves and a sheep discussing what's for dinner. Freedom is a well armed sheep contesting the decision.
User avatar
euthypro
Level 3
Level 3
Posts: 104
Joined: Wed Jan 17, 2007 12:10 pm
Location: Dumaguete, Philippines

Re: Correcting the Boot Menu

Post by euthypro »

jimisbell,

You may want to take a look at this thread, which is still active and more or less on the same subject.

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

Angel
jimisbell
Level 3
Level 3
Posts: 151
Joined: Fri May 07, 2010 7:15 pm
Location: The Third Coast

Re: Correcting the Boot Menu

Post by jimisbell »

Holy Key Rap. That is genius. The video is very dificult to follow because of all the exteraneous crap in it. But, the crux of the information is as follows:

First open the Terminal then enter these commands in sequence as shown:

1) Type sudo chmod +w /boot/grub/grub.cfg

2) enter your password when asked for it.

3) Type sudo gedit /boot/grub/grub.cfg

4) copy and save the grub.cfg file as grub.bak This is in case you screw up the original and need to restore it.

5) Edit to your hearts content

6) "save" the file.

7) You are done.

If you need to restore the original file, just erase the screwed up file and rename grub.bak to grub.cfg and you are home free.

This is the greatest thing since sliced bread!!!!!
Democracy is two wolves and a sheep discussing what's for dinner. Freedom is a well armed sheep contesting the decision.
User avatar
euthypro
Level 3
Level 3
Posts: 104
Joined: Wed Jan 17, 2007 12:10 pm
Location: Dumaguete, Philippines

Re: Correcting the Boot Menu

Post by euthypro »

So long as you don't do "sudo update-grub" anytime afterward, or the file will be overwritten and you'll be back to square one. Don't know if downloading grub updates will affect the file.

Angel
Post Reply

Return to “Installation & Boot”