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 :scratch: :newbie: |
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. |
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. |
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 :confused: :) and thx again! |
use "su -l root"
for further info on su "man su" :) |
again
Thank you.
I tried, but "Permission denied" again... :cry: |
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.
|
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 |
Quote:
|
Quote:
thx a lot anyway :) |
Quote:
|
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 |
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' |
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. |
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... |
The method how you edit the file is irrelevant. You need write access to the file you want to alter and this is a must.
Since your /boot is a separate partition you have to check how it is mounted (or if it is mounted at all). Type mount and look at output, is /boot mounted rw? |
All times are GMT -5. The time now is 04:50 AM. |