Correcting the Boot Menu
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Correcting the Boot Menu
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?
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?
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.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Democracy is two wolves and a sheep discussing what's for dinner. Freedom is a well armed sheep contesting the decision.
Re: Correcting the Boot Menu
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 . 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
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
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
Re: Correcting the Boot Menu
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.....
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.
Re: Correcting the Boot Menu
Run this command in a terminal
input your user password when requested
Code: Select all
sudo update-grub
Re: Correcting the Boot Menu
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-)
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.
Re: Correcting the Boot Menu
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
--and can be edited with root privilege under any text editor you use
- nano
gedit
leafpad
Re: Correcting the Boot Menu
Run this command in a terminal to edit it directly.jimisbell wrote:I am an old programmer and can fix the menu if I can just get into it and 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
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
Code: Select all
sudo lshw -C disk
Code: Select all
sudo sfdisk -l
Code: Select all
inxi -plu
Code: Select all
sudo apt-get install inxi
Oh, and jimisbell it's not you, GRUB2 is a b*tch.
PS ---- Copy and paste the above commands to ensure accuracy.
Re: Correcting the Boot Menu
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
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
in terminal and edit the file that is displayed. You need to change this line
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
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,.
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
( emphasis mine,AT)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.
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
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
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
Reason: Improve clarity of instructions
Re: Correcting the Boot Menu
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.
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.
Re: Correcting the Boot Menu
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.
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.
Re: Correcting the Boot Menu
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
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
Re: Correcting the Boot Menu
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!!!!!
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.
Re: Correcting the Boot Menu
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
Angel