LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-10-2012, 08:55 PM   #1
ExemptOA
LQ Newbie
 
Registered: May 2012
Posts: 13

Rep: Reputation: Disabled
Changing OS Boot Order in GRUB2


So i have 2 operating systems on my machine right now (backtrack5 and ubuntu 12.04)

currently backtrack5 is at the top of the list of the GRUB boot loader and is automatically selected after 9 seconds (default)

ive looked all over saw things saying change the file /etc/boot/grub. so i went to "/etc/boot/grub" and changed "GRUB_DEFAULT=4" to select the 5th option in the list (starts at 0 and goes up)

the second option i tried
/boot/grub/menu.lst (this file i dont have)


Well the first option didnt work and the second one couldnt be done for obvious reasons, so im wondering if anyone has any idea how i can do it.


I want this so i can reboot my server via SSH client remotely, and have the server boot back up so i can continue using it.

Thanks.
 
Old 05-10-2012, 09:48 PM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,263

Rep: Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358
Are you using Grub2 from Backtrack? In Ubuntu, the file to edit for this purpose is /etc/default/grub/ and that line is at the top of the file. I would be surprised if Backtrack has the file in a different location but I've never used it so I don't know. After making the change you would need to run sudo update-grub in Ubuntu. I don't know if Backtrack uses sudo. Take a look at this page, use grub-mkconfig:

http://www.gnu.org/software/grub/man...dmkconfig.html
 
Old 05-10-2012, 10:01 PM   #3
ExemptOA
LQ Newbie
 
Registered: May 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
Yes i am using GRUB2, and i looked at that web page you posted but it didnt really tell me much other than what i tried.

i guess i havent looked to see if it is in a different location on BT, but it shouldnt matter because this is dealing with the bootloader, not the OS.
 
Old 05-10-2012, 11:11 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,619

Rep: Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088
Actually it matters quite a lot. You (and we if we are going to help) need to know which system "owns" the grub in the MBR, where it stores its files, and how it updates its (internal) pointers.
Updating the "wrong" system will have zero effect on proceedings.
 
1 members found this post helpful.
Old 05-11-2012, 02:40 AM   #5
clocker
Member
 
Registered: Sep 2011
Distribution: fedora, redhat, mint
Posts: 87

Rep: Reputation: Disabled
The bootloader is automatically generated by /usr/sbin/grub-mkconfig.
if you vi or gedit this file
Quote:
#vi /boot/grub/grub.conf
which makes a reference to menu.lst. You will see these two important lines
Quote:
default=0
timeout=10
default=0 will boot your first OS in the boot order changing the value to 1 boot the second one and so on kind of like an array.
timeout=10 is the number of seconds it will take for the default OS to boot a
automatically you can change it to say 20.

OR you can manually cut and interchange the entries, then save the changes as root. this is best for redhat distos
You can also go to chapter 1 of comptia linux+ study guide.
 
Old 05-11-2012, 09:42 AM   #6
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,263

Rep: Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358
Both Bactrack5 and Ubuntu 12.04 use Grub2 so there is not grub.conf or menu.lst file. And as stated above, you need to do the edit to the /etc/default/grub file on the system which has part of its Grub2 bootloader in the master boot record or it won't work. The code in the mbr points to that partition and if you edited a different partition...?
 
1 members found this post helpful.
Old 05-11-2012, 07:33 PM   #7
ExemptOA
LQ Newbie
 
Registered: May 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
Well i booted into backtrack and edited /etc/default/grub. then ran "sudo update grub" and it worked, but now when i boot, my Ubuntu 12.04 partition is listed twice in the list. anybody know what that you be from?
 
Old 05-11-2012, 08:04 PM   #8
ExemptOA
LQ Newbie
 
Registered: May 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
This is what it looks like in the grub.cfg file

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Ubuntu, with Linux 3.2.0-24-generic-pae (on /dev/sda1)" {
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set ac6af384-a419-4a04-8891-f514c2a7e103
linux /boot/vmlinuz-3.2.0-24-generic-pae root=UUID=ac6af384-a419-4a04-8891-f514c2a7e103 ro
initrd /boot/initrd.img-3.2.0-24-generic-pae
}
menuentry "Ubuntu, with Linux 3.2.0-24-generic-pae (recovery mode) (on /dev/sda1)" {
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set ac6af384-a419-4a04-8891-f514c2a7e103
linux /boot/vmlinuz-3.2.0-24-generic-pae root=UUID=ac6af384-a419-4a04-8891-f514c2a7e103 ro recovery nomodeset
initrd /boot/initrd.img-3.2.0-24-generic-pae
}
menuentry "Ubuntu, with Linux 3.2.0-23-generic-pae (on /dev/sda1)" {
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set ac6af384-a419-4a04-8891-f514c2a7e103
linux /boot/vmlinuz-3.2.0-23-generic-pae root=UUID=ac6af384-a419-4a04-8891-f514c2a7e103 ro
initrd /boot/initrd.img-3.2.0-23-generic-pae
}
menuentry "Ubuntu, with Linux 3.2.0-23-generic-pae (recovery mode) (on /dev/sda1)" {
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set ac6af384-a419-4a04-8891-f514c2a7e103
linux /boot/vmlinuz-3.2.0-23-generic-pae root=UUID=ac6af384-a419-4a04-8891-f514c2a7e103 ro recovery nomodeset
initrd /boot/initrd.img-3.2.0-23-generic-pae
}
### END /etc/grub.d/30_os-prober ###
 
Old 05-11-2012, 09:36 PM   #9
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,263

Rep: Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358Reputation: 1358
You have two different kernels:

Quote:
menuentry "Ubuntu, with Linux 3.2.0-24-generic-pae (on /dev/sda1)
menuentry "Ubuntu, with Linux 3.2.0-23-generic-pae (on /dev/sda1)"
Not 3.2.0-23 and 3.2.0-24. You did a kernel update. You don't need both. If you don't want one, you can remove the entry from the grub.cfg file but if you do a kernel update again it will show them. Check to see which one you use before doing anything, probably they both will start the system. If you don't want them showing up after an update-grub you will need to remove the kernel.
 
Old 05-02-2013, 05:40 AM   #10
vvvvv5
LQ Newbie
 
Registered: May 2013
Posts: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by ExemptOA View Post
This is what it looks like in the grub.cfg file

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Ubuntu, with Linux 3.2.0-24-generic-pae (on /dev/sda1)" {
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set ac6af384-a419-4a04-8891-f514c2a7e103
linux /boot/vmlinuz-3.2.0-24-generic-pae root=UUID=ac6af384-a419-4a04-8891-f514c2a7e103 ro
initrd /boot/initrd.img-3.2.0-24-generic-pae
}
menuentry "Ubuntu, with Linux 3.2.0-24-generic-pae (recovery mode) (on /dev/sda1)" {
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set ac6af384-a419-4a04-8891-f514c2a7e103
linux /boot/vmlinuz-3.2.0-24-generic-pae root=UUID=ac6af384-a419-4a04-8891-f514c2a7e103 ro recovery nomodeset
initrd /boot/initrd.img-3.2.0-24-generic-pae
}
menuentry "Ubuntu, with Linux 3.2.0-23-generic-pae (on /dev/sda1)" {
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set ac6af384-a419-4a04-8891-f514c2a7e103
linux /boot/vmlinuz-3.2.0-23-generic-pae root=UUID=ac6af384-a419-4a04-8891-f514c2a7e103 ro
initrd /boot/initrd.img-3.2.0-23-generic-pae
}
menuentry "Ubuntu, with Linux 3.2.0-23-generic-pae (recovery mode) (on /dev/sda1)" {
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set ac6af384-a419-4a04-8891-f514c2a7e103
linux /boot/vmlinuz-3.2.0-23-generic-pae root=UUID=ac6af384-a419-4a04-8891-f514c2a7e103 ro recovery nomodeset
initrd /boot/initrd.img-3.2.0-23-generic-pae
}
### END /etc/grub.d/30_os-prober ###
Just Change the order of options in /boot/grub/grub.conf
---
menuentry "Ubuntu, with Linux 3.2.0-24-generic-pae (on /dev/sda1)" {
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set ac6af384-a419-4a04-8891-f514c2a7e103
linux /boot/vmlinuz-3.2.0-24-generic-pae root=UUID=ac6af384-a419-4a04-8891-f514c2a7e103 ro
initrd /boot/initrd.img-3.2.0-24-generic-pae
}
---
Replace this with whatever you wants to be auto opted..
 
Old 05-02-2013, 06:07 AM   #11
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,651

Rep: Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911
Quote:
Originally Posted by vvvvv5 View Post
Just Change the order of options in /boot/grub/grub.conf
---
menuentry "Ubuntu, with Linux 3.2.0-24-generic-pae (on /dev/sda1)" {
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set ac6af384-a419-4a04-8891-f514c2a7e103
linux /boot/vmlinuz-3.2.0-24-generic-pae root=UUID=ac6af384-a419-4a04-8891-f514c2a7e103 ro
initrd /boot/initrd.img-3.2.0-24-generic-pae
}
---
Replace this with whatever you wants to be auto opted..
This is an old thread.
Besides, to configure GRUB2 you do not alter /boot/grub/grub.conf. GRUB2 is configured by editing /etc/default/grub then running update-grub.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
grub question changing boot order making windows boot first nfsutim Linux - Newbie 29 10-27-2012 12:53 PM
[SOLVED] GRUB2 Debian Squeeze change boot order? prudra Debian 9 10-07-2011 12:21 AM
Messed UP Boot Order on dual-boot, don't know GRUB2, need help -- another's PC hilyard Linux - Newbie 4 06-25-2011 12:57 AM
Changing boot order CornMaster Fedora 13 10-04-2005 10:13 AM
changing the boot order coopns Linux - Newbie 11 09-14-2004 07:20 AM


All times are GMT -5. The time now is 06:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration