PDA

View Full Version : GRUB bootloader



Mirddes
28-06-2005, 11:04 PM
hi.
earlier today i installed Ubuntu 5.04 which installed GRUB 0.9(?)
my dad is quitebackwards when it comes to computers, he wants windows to boot when he turns it on, and expects to see nothign else, which is fine.
currently (by default?) the boot choices are listed alphabeticly with ubuntu at the top, and windows at the bottem.
after 20 seconds has passed it will boot the selected option.
is there a way i coudl alter this so after 3seconds it boots the selected option, with windows being at teh top?

johnd
28-06-2005, 11:16 PM
Edit the /boot/grub/menu.lst file. YOu will find two relevant lines:

timeout=5
default=0

The first one is the timeout in seconds.
The second one in this example boots the first OS in the list in the same file.

Jen
28-06-2005, 11:17 PM
Yes, you can do this. As root, go to /etc/grub.conf and open it in a text editor.

You need to change the follow two entries (this is my grub.conf as an example)


# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hda3
# initrd /initrd-version.img
#boot=/dev/hda
default=0 <---- change to 1
timeout=5 <---- change this to 3 (time in seconds)
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.11-1.1369_FC4)
root (hd0,0)
kernel /vmlinuz-2.6.11-1.1369_FC4 ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.11-1.1369_FC4.imgThe "default=0" line indicates which OS (or kernel version) is to be the default. The first title line is 0, the second title line (not shown in my example) is 1, the third title line is 2 and so on.

Myth
29-06-2005, 09:15 AM
One thing you should be aware of:

If you upgrade the kernel (the main core file) in Ubuntu after making this change, you MAY have to re-edit the above file.
I know that when you upgrade the Fedora kernel, the new kernel goes to the top of the list by default... however in Mandrake it stays at the bottom. I am not sure about Ubuntu.

Mirddes
29-06-2005, 03:55 PM
i relise this will make me sound extremely noob, but how do i 'get root'

FoxyMX
29-06-2005, 04:06 PM
In a terminal window type in: su

Mirddes
29-06-2005, 04:15 PM
/boot/grub/menu.lst file is readonly =(

this is my first linux install, in the past ive only every played around with the knoppix linux live CDs

FoxyMX
29-06-2005, 04:20 PM
Try this:

su -

Press Enter, type in password

gedit /etc/grub.conf

Press Enter

Mirddes
29-06-2005, 04:39 PM
(gedit:8449): GnomeUI-WARNING **: While connecting to session manager:
Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed.


----
edit

i think the reason it failed was because /etc/grub.conf doesnt seem to exist

FoxyMX
29-06-2005, 04:57 PM
Darn it, I have led you down the wrong path. Sorry. :blush:

You need to log on as root before typing the gedit bit. There will be a quick and dirty way to do this but my notes are a bit of a mess at the moment and my memory is like a sieve so just log out of your normal account and log back on as root. To do this type in the root name and password that you created when you first set Linux up.

If that doesn't work then you will have to wait for a Linux guru to pop in.

Mirddes
29-06-2005, 05:02 PM
should the name of the root account be 'root'?
im downloading the quake3 demo for linux right now, so ill have to wait till its done before i try that method

Graham L
29-06-2005, 05:07 PM
rootis the user name for the root account. There is no other.;)

su - should cause a "password:" prompt. The hyphen "-" means run as root, with root's PATH (which includes paths to some system commands). The password prompt requires the root password. The prompt character will change from "$" to "#" when you are running as root.

I don't know where ubuntu puts grub.conf ; Mandrake has it in /boot/grub . ;)

Try the highly useful locate command. "locate grub.conf". If it doesn't give an answer, you might need to build its database: updatedb &, and have a cup of coffee. Then come back and try the locate command again.

Mirddes
29-06-2005, 05:12 PM
i see what im doing wrong, i forgot to put the -
im such a noob =|
but i am learning, at that is the most important thing

what do i put after 'updatedb &'

Chilling_Silence
29-06-2005, 05:44 PM
Nothing, just run updatedb

It'll index your HDD

Then use locate :)

Mirddes
29-06-2005, 05:47 PM
i only installed ubuntu thismorning
and it still didnt find it

thanks for all the help sofar everyone =D
i would still be clicking root terminal over and over

ILikeLinux
29-06-2005, 06:02 PM
The grub config file is normally kept in /boot/grub as grub.conf
so to edit it in an terminal as root:


su -
<passwd>
mount /boot
nano /boot/grub/grub.conf

If the mount part doesnt work, don't worry, i'm just putting it in there because some people have a seperate /boot partition, and others dont.

Mirddes
29-06-2005, 06:13 PM
im such a noob, how do i save?

ILikeLinux
29-06-2005, 06:15 PM
Ctrl + X
Then press Y <enter>

Then it should be saved, or alternative:

Ctrl + O, Ctrl + X
Done.

Jen
29-06-2005, 06:17 PM
Are you using nano? If you are, then to save it is just CRTL-O (letter O) and then Y to confirm and then CTRL-X to exit.

[Edit: see I'm too slow :p]

Nano is a command line text editor, but there are GUI's ones (text editor, gedit etc) which may be more comfortable for you to use. :)

Mirddes
29-06-2005, 06:33 PM
tell me bout it, id much rather use a gui, but i cant get root for it, just for terminal.
but its all done now, =D, now my dad wont kill me each time he turns the computer on and it doesnt boot windows.

thanks for the help =D

i have got several other things i need help with though.
first id like to bump my resolution upto 1280x1024, but for whatever reason im limited to a max of 1024x768 which is far too small for what im usedto.

secondly i need to install the demo for quake3a which i just downloaded, keeps opening with gedit.

thanks for any further help in advance

Jen
29-06-2005, 06:46 PM
tell me bout it, id much rather use a gui, but i cant get root for it, just for terminal.A quick way of getting root with a GUI is to launch nautilus as root. Nautilus in Gnome is the equivalent of Windows Explorer, and Gnome is the desktop environment that Ubuntu uses. To get nautilus as root, just open up a terminal window and su - (su <space> - [hyphen]) to root and then enter in nautilus <push enter>. The window that opens will have full root powers so you can just navigate to / and then to whatever directory you need to go to. When you find the file you wish to edit, if you right-click on it there should be an option to open with a text editor (or there may even be that option in the left-hand panel if you just click on the file first). Just be aware that as root you can completely hose your system without any "are you sure" messages, so don't go making changes if you are not aware what the consequences of them will be. :)

Is your monitor correctly detected by Ubuntu and has the correct frequency settings/refresh rate?

Mirddes
29-06-2005, 07:44 PM
when i tried to run nautilus as you instructed, it came up with an error

(nautilus:7648): Gtk-WARNING **: cannot open display:

what does it mean?


abuot my display, in windows id run it at 1280x1024x32 @60hz
but it ubunto, currently, all the options it is listing are; 1024x768, 800x600, 640x480, 832x624. at various frequencies for each resolution.

would a driver update help fix this?
if so, how?

also how do i install stuff?

Mirddes
29-06-2005, 10:23 PM
Bump

Jen
29-06-2005, 10:55 PM
Just done a bit of reading on Ubuntu. It doesn't use root like most other distro's, but has set it up with sudo to gain admin powers. Basically you type sudo instead of su - followed by the command on the same line and then enter in your password (not roots). Example: sudo gedit. This *may* be behind your errors when you lauched something as root. Just out of interest, try sudo gedit.

I've found a what looks like an extensive userguide for Ubuntu that you may wish to check out - Unofficial Ubuntu 5.04 Starter Guide (http://www.ubuntuguide.org/). It should answer your question about installing new software and video drivers.

Regarding your screen resolution, browse to this location and paste the information from these parts from the Section to the EndSection here:

location: /etc/X11/xorg.conf

Sections:
Section "Monitor"
Section "Device"
Section "Screen"

This is what you are looking for as an example:
Section "Screen"
Identifier "Screen0"
Device "Videocard0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 16
Modes "800x600" "640x480"
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1280x1024" "1280x960" "1152x864" "1024x768" "800x600" "640x480"
EndSubSection
EndSection

Graham L
30-06-2005, 02:04 PM
Before changing the X Window settings, try the higher resolution. Crtl/Alt/+ (the "+" on the keypad) will change the resolution. Ctrl/Alt/- reduces the resolution. If you accidentally get too high a resolution for the monitopr and want to bail out before things explode, Ctrl/Alt/Backspace is an emergency exit for X Window.

Chilling_Silence
30-06-2005, 03:50 PM
xorgconfig should auto-generate you a new and more useful setup. Try that:
sudo xorgconfig


Chill.

Mirddes
01-07-2005, 01:10 PM
Just out of interest, try sudo gedit.


mirddes@home:~$ sudo gedit
mirddes is not in the sudoers file. This incident will be reported.


this is bad?


also ive noticed i cant see hda1 and hdb1 (my windows partitions)
i kinda really need them, music ect...
they were all visible when i was running the knoppix live CD (3.9) but i dunno if i could see them while runnign the ubuntu 5.04 live CD

ILikeLinux
01-07-2005, 04:46 PM
No, it just means that the sudo'ers file hasnt been setup right.

you could try this (no where near sudo though)


su -
export DISPLAY=":0"
gedit <file>

And if your computer is running only one Xsession, that should work.

Mirddes
01-07-2005, 06:57 PM
su -
export DISPLAY=":0"
gedit <file>

Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified


(gedit:9937): Gtk-WARNING **: cannot open display:



how do i get it so the default screen resolution is 1280x1024? everytime i log on it reverts to the orignal 1024x768. even if i check the box "Make defaulf for this computer (Home) only"

thanks again.
(my questions have moved past my orignal bootloader questions, but i think its best to keep my linux questions in one place, for my convenance)

ILikeLinux
01-07-2005, 08:59 PM
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified


(gedit:9937): Gtk-WARNING **: cannot open display:



how do i get it so the default screen resolution is 1280x1024? everytime i log on it reverts to the orignal 1024x768. even if i check the box "Make defaulf for this computer (Home) only"

thanks again.
(my questions have moved past my orignal bootloader questions, but i think its best to keep my linux questions in one place, for my convenance)

Could you please do "print $DISPLAY" and post back, then I can correct the command for you.

Btw: what winodow manager are you using?

Mirddes
01-07-2005, 09:37 PM
Error: no such file ":0.0"



and i dont know what one im using, just the default one in ubuntu

Chilling_Silence
02-07-2005, 04:13 AM
If you're going to run something like that, try just:
su

If you do:
su -
It appears to set certain variables etc, yada yadda.....

Give it a whirl :) I had the same problem in Slackware 9 ages back... except I had to work it out myself :p