LinuxQuestions.org
Review your favorite Linux distribution.
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 01-15-2008, 02:01 PM   #1
Sifonelle
LQ Newbie
 
Registered: Jan 2008
Posts: 7

Rep: Reputation: 0
Unhappy How can I change default OS on grub system?


Hi I installed both Windows XP and Linux Debian in my mother notebook and i setted linux as default as i wanted to learn to use it.
Now she got it back, but even if I tried I cannot change default OS; I looked for help in forums and online guides, but nothing I tried worked: it says "Permission Denied", and I was logged as root.
I also tried to reinstall XP, but obviously it doesn't change grub's settings...
Can u help me change it, or solve it someway?

Thanks a lot for attention

 
Old 01-15-2008, 02:22 PM   #2
jakefolger
LQ Newbie
 
Registered: Nov 2007
Location: NJ
Distribution: Debian
Posts: 7

Rep: Reputation: 0
I know that you can select which linux version you boot to in your grub.conf file. That file is located in /boot/grub. I'm not sure if this works with windows though.

Once you're in the grub.conf file I think it's as simple as changing the default=0 line.

Good luck, and let us know if that works out for you.
 
Old 01-15-2008, 02:36 PM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,805

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
There are two ways to change the default; both involve editing /boot/grub/menu.lst.

Near the top of the file, there is a line: default 0. Since grub numbering begins with 0, that means that the first OS listed is the default. To change that default,
a) count down to the OS you want to be the default (counting from zero) and change the default line to that number.
b) cut and paste the one you want as default to the top of the list, and leave the default at 0.

You must be root to edit menu.lst, and the write permission bit must be set.
 
Old 01-16-2008, 04:24 AM   #4
Sifonelle
LQ Newbie
 
Registered: Jan 2008
Posts: 7

Original Poster
Rep: Reputation: 0
permission denied... :(

Thx a lot for your answers , I already tried to change in /boot/grub/menu.lst, after "su root" and psw, it changes user but then it says "permission denied"... maybe I did something wrong with command line?
How must I set write permission? Sorry for ignorance
and thx again!
 
Old 01-16-2008, 05:09 AM   #5
jopu
LQ Newbie
 
Registered: Mar 2007
Posts: 8

Rep: Reputation: 0
use "su -l root"

for further info on su "man su"
 
Old 01-16-2008, 06:13 AM   #6
Sifonelle
LQ Newbie
 
Registered: Jan 2008
Posts: 7

Original Poster
Rep: Reputation: 0
again

Thank you.
I tried, but "Permission denied" again...
 
Old 01-16-2008, 09:41 AM   #7
tfugnitti
LQ Newbie
 
Registered: Jan 2008
Posts: 3

Rep: Reputation: 0
I would really hate to be a simple minded person, but couldn't you just chmod the grub.conf file? since there is a link from the /boot/grub/menu.lst to the grub.conf file.
 
Old 01-16-2008, 09:56 AM   #8
(00)
LQ Newbie
 
Registered: Jan 2008
Posts: 5

Rep: Reputation: 0
reply

depending on the distro you use....
I will usuall run

$sudo cp /boot/grub/menu.lst /home/*USERNAME*/Destop

this moves it to the desktop so you can edit it easily with gedit. Once your done run

$sudo cp /home/*USERNAME*/Destop/menu.lst /boot/grub/menu.lst

Note that if you are running fedora you will need add yourself to the sudoers list
 
Old 01-16-2008, 12:41 PM   #9
Sifonelle
LQ Newbie
 
Registered: Jan 2008
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by tfugnitti View Post
I would really hate to be a simple minded person, but couldn't you just chmod the grub.conf file? since there is a link from the /boot/grub/menu.lst to the grub.conf file.
thx but as I said, I can't have access to /boot/grub/menu.lst, even if logged as root user...
 
Old 01-16-2008, 12:42 PM   #10
Sifonelle
LQ Newbie
 
Registered: Jan 2008
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by (00) View Post
depending on the distro you use....
I will usuall run

$sudo cp /boot/grub/menu.lst /home/*USERNAME*/Destop

this moves it to the desktop so you can edit it easily with gedit. Once your done run

$sudo cp /home/*USERNAME*/Destop/menu.lst /boot/grub/menu.lst

Note that if you are running fedora you will need add yourself to the sudoers list
I run debian, I will try and tell you
thx a lot anyway
 
Old 01-16-2008, 12:55 PM   #11
Emerson
Senior Member
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~
Posts: 3,177

Rep: Reputation: Disabled
Quote:
Originally Posted by Sifonelle View Post
thx but as I said, I can't have access to /boot/grub/menu.lst, even if logged as root user...
Run 'ls -l /boot/grub/menu.lst' and post output for us.
 
Old 01-17-2008, 10:01 AM   #12
Sifonelle
LQ Newbie
 
Registered: Jan 2008
Posts: 7

Original Poster
Rep: Reputation: 0
to (00):
I did as you suggested, it opened for me a *menu.lst [sola lettura] ( /Desktop) - gedit , reading only....
What should I do?

to Emerson:
output is
--rw-r--r 1 root root 4135 1988-01-02 21:26 /boot/grub/menu.lst
 
Old 01-17-2008, 10:07 AM   #13
Emerson
Senior Member
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~
Posts: 3,177

Rep: Reputation: Disabled
Either your /boot partition (do you have separate /boot partition?) is mounted read-only or immutable flag is set.
Please show us output of 'lsattr /boot/grub/menu.lst'
 
Old 01-18-2008, 04:27 PM   #14
(00)
LQ Newbie
 
Registered: Jan 2008
Posts: 5

Rep: Reputation: 0
edit the menu.lst file you have on the desktop, (hightlight the operating system you want the system to default to first as well as all of its settings, cut and paste it to the top of the list)

For example, if I wanted Windows on top, the section might look like this >

title Windows
rootnoverify (hd1,0)
chainloader +

(It might look different, just make sure to get the whole thing)
Once it looks the way you want, run >

sudo cp /home/*USERNAME*/Desktop/menu.lst /boot/grub/menu.lst

reboot to test.
 
Old 01-19-2008, 12:39 PM   #15
Sifonelle
LQ Newbie
 
Registered: Jan 2008
Posts: 7

Original Poster
Rep: Reputation: 0
to Emerson:
------------------ /boot/grub/menu.lst

boot partitions should be separated, partion magic when I installed...

to (00)
I have after ## ## End Default Options ##

title Debian GNU/Linux, kernel 2.6.18-4-686
root (hd0,1)
kernel /boot/vmlinuz-2.6.18-4-686 root=/dev/hda2 ro
initred /boot/initrd.img-2.6.18-4-686
savedefault

again for single user, then

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below
from the Debian
# ones.
title Other Operating Systems:
root


# This ebtry automatically added by the Debian installer for
a non-linux OS
# on /dev/hdal
title Microsoft Windows XP Home Edition
root (hd0,0)
savedefault
makeactive
chainloader +1


Please tell me exactly what I should modify, could I copy and paste something so clearly set apart?
thx for the help...
 
  


Reply

Tags
boot, debian, grub, multibooting


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
How to change the default GRUB image ?????????? _ AsiF Linux - Desktop 1 01-24-2007 04:35 AM
How do you change the default Boot-up OS in Grub? buckwheat12 Fedora 3 05-08-2004 04:24 PM
How to change default boot for Grub? nano_electronix Linux - Software 4 09-01-2003 08:46 AM
how to change default os in Grub eye Linux - Software 3 05-16-2003 09:10 AM
hot to change default os in Grub jt1020 Linux - General 6 04-27-2003 12:52 AM


All times are GMT -5. The time now is 11:11 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration