Results 1 to 10 of 13
Dear Linux users,
I just wanted to make sure that my menu.lst looks good for grub. I wouldn't want it to fail and not be able to load any operating ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 12-05-2002 #1Linux Engineer
- Join Date
- Nov 2002
- Location
- Queens, NY
- Posts
- 1,319
Grub config
Dear Linux users,
I just wanted to make sure that my menu.lst looks good for grub. I wouldn't want it to fail and not be able to load any operating system. I have two questions in the comments so please be sure to read them.
I've got four partitions on my primary IDE hard drive
hd0,0 - Windows
hd0,1 - Boot
hd0,2 - Swap
hd0,3 - root
My /boot/grub/menu.lst looks like this:
==============================
default 0
timeout 5
# Windows OS
title Windows 2000
# Can I skip the next two lines if I use this? [ rootnoverify (hd0,0) ]
root (hd0,0)
makeactive
chainloader +1
# Linux OS
title Linux
root (hd0,1)
kernel /vmlinuz-2.4.18-bf2.4 root=/dev/hda1 ro
===============================
So that's my initial step to boot windows and debian. When this file was generated, this is the last thing on the file
==============================
title Debian GNU/Linux, kernel 2.4.18-bf2.4
# Shouldn't this be hd0,1 ?
root (hd0,0)
kernel /vmlinuz-2.4.18-bf2.4 root=/dev/hda1 ro
===============================
Why is the second line(root) designated to hd0,0? Shouldn't it be hd0,1 since /boot resides in that partition?
Finally, what safety cautions can I take if this fails?
As always, any help or suggestion is greatly appreciated.
bpThe best things in life are free.
- 12-06-2002 #2Just Joined!
- Join Date
- Nov 2002
- Location
- USA
- Posts
- 99
Re: Grub config
How are you booting currently? Are you using lilo and then you plan to overwrite it with grub? First, make a boot floppy. Then you have a backup in case grub is configured incorrectly.
Originally Posted by bpark
What tool did you use to generate this menu.lst?
Originally Posted by bpark
Yes, it should be hd0,1
Originally Posted by bpark
Not sure why this second menu item is in your file since it is exactly the same as the other line except for the partition number.
Sometimes, people like to have a menu item for booting linux as a single user if there are problems. Just add the word 'single' to the end of the line. And change the title of course.
If you need more help, I found two more doc sites:
http://www.gnu.org/software/grub/grub.html
http://www.ibiblio.org/pub/Linux/doc...RUB.html#ss2.3
The second site is a howto on dual booting Win2000 and Linux!
- 12-06-2002 #3Just Joined!
- Join Date
- Nov 2002
- Location
- USA
- Posts
- 99
Oh, one more thing. I'm assuming from the way that you listed the partitions on your hard drive that you have four primary partitions. None of them are in extended partitions, correct?
- 12-06-2002 #4Linux Engineer
- Join Date
- Nov 2002
- Location
- Queens, NY
- Posts
- 1,319
Error
OK,
I'm currently using a floppy to boot with GRUB. Lilo is in MBR.
Forget Windows. I got that down. Let's try linux.
As always boot resides in hd0,1 and Linux root resides in hd0,3. For simplicity, I will leave lines.
1 title Linux
2 root (hd0,1)
3 kernel /vmlinuz root=/dev/hda4 ro
When I used this, it works. What's weird is I don't understand why it works. Line 2 indicates that GRUB's root now mounts hd0,1 which is my boot partition. In this partition, I have no file called vmlinuz. I have a file called vmlinuz-2.4.18-bf2.4. In the Linux root partition, there is a file called vmlinuz but it's a symlink to /boot/vmlinuz-2.4.1.bf2.4. I don't know HOW that file can possibly load. As weird as it may seem, it loads. However, it loads the wrong kernel and I can't start X.
bpThe best things in life are free.
- 12-06-2002 #5Linux User
- Join Date
- Nov 2002
- Posts
- 420
If I'm following you correctly, you have two kernels in your /boot partition:
vmlinuz-2.4.18-bf2.4
and
vmlinuz-2.4.1.bf2.4
Are you booting to kernel 2.4.1?
If so, it sounds like all you would have to do is change the symbolic link in your root partition to point to the other vmlinuz file.
If you try that at least you could boot the kernel that you are after. It sounds like you'll have to do something different to have a choice to boot between several kernels, but I'd just try to get the one that you want working for now.
- 12-06-2002 #6Just Joined!
- Join Date
- Nov 2002
- Location
- USA
- Posts
- 99
Oops, I forgot to log in.
Anyway, I was also thinking that you might want to look at the lilo configuration to see how that is set up since you already have that working. That may make it easier to set up grub if you use it as a base. I think it's lilo.conf
- 12-06-2002 #7Linux Engineer
- Join Date
- Nov 2002
- Location
- Queens, NY
- Posts
- 1,319
one file
Slant
My mistake. That was a typo. In /boot, there is only ONE file called vmlinuz-2.4.18-bf2.4.
In the Linux root directory /, there is a symlink vmlinuz which points at /boot/vmlinuz-2.4.18-bf2.4.
I load the boot partition(hd0,1) to grub so I'm thinking that the next line with the kernel command is going to look for a vmlinuz in the boot partition. As I stated, there is no such file. However vmlinuz-2.4.18-bf2.4 resides in that partition. That's what I'm not understanding. How is this loading?
bpThe best things in life are free.
- 12-06-2002 #8Just Joined!
- Join Date
- Nov 2002
- Location
- USA
- Posts
- 99
Re: one file
I believe the root command sets the root device for 'grub' not for the linux operating system, since you can use grub to load multiple operating systems. So, when you are calling the kernel command you specify your device as /dev/hda4 and it considers that the root and attempts to look for vmlinux in /. That's my take on things after reading the docs. What is your problem again with X Windows not working with the kernel?
Originally Posted by bpark
- 12-06-2002 #9Linux Engineer
- Join Date
- Nov 2002
- Location
- Queens, NY
- Posts
- 1,319
hmm
Slant,
I'm reiterating my grub file:
1 title linux
2 root (hd0,1)
3 kernel /vmlinuz root=/dev/hda4 ro
My understanding is that line 2 loads the boot partition into Grub's root partition. Therefore all other lines now have (hd0,1) as a prefix. I'm thinking that line 3 is really:
kernel (hd0,1)/vmlinuz root=/dev/hda4/ ro
Perhaps I am wrong on this but I thought by specifiying the root directory in line 3 specifies the next mount point which is NOT related to the kernel. Grub needs to find the initial vmlinuz file THEN it must mount the Linux root partition. I'm thinking that 'root='/dev/hda4' in line 3 is what achieves this. Looking at my old grub.conf from redhat:
============== REDHAT ==============
1 title Red Hat Linux
2 # back then boot was still hd0,1
3 root (hd0,1)
4 #back then Linux root was hd0,3
5 kernel /vmlinuz-2.4-18.3 root=/dev/hda3
6 initrd /initrd-2-4-18.3.img
====================================
Originally I had this as line 3 in my Debian grub file like this:
kernel /vmlinuz root=/dev/hda2 ro
This too didn't work.
bpThe best things in life are free.
- 12-07-2002 #10Just Joined!
- Join Date
- Nov 2002
- Location
- USA
- Posts
- 99
Um ... Didn't you get it working with:
1 title Linux
2 root (hd0,1)
3 kernel /vmlinuz root=/dev/hda4 ro
Check your kernel when it starts. Is it version 2.4.18?
Isn't this the kernel that you want to load?
Now what kernel is it loading here?I have a file called vmlinuz-2.4.18-bf2.4. In the Linux root partition, there is a file called vmlinuz but it's a symlink to /boot/vmlinuz-2.4.1.bf2.4. I don't know HOW that file can possibly load. As weird as it may seem, it loads. However, it loads the wrong kernel and I can't start X.
Is this kernel 2.4.18? I'm confused.
Just for curiousity's sake:
I was wondering which docs you are using as a reference so that we are on the same page so to speak.


Reply With Quote
