Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Convert from lilo to Grub
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
ckwall
Apprentice
Apprentice


Joined: 31 May 2002
Posts: 163

PostPosted: Wed Nov 06, 2002 9:54 pm    Post subject: Convert from lilo to Grub Reply with quote

Is there any bennefit to staying with lilo?
Otherwaise I would like to change to using grub.
If there is no bennefit to stay with lilo, can someone direct me to instructions on how to do this, or possibly walk me through this?

Thank you.
Back to top
View user's profile Send private message
boyo
n00b
n00b


Joined: 02 Nov 2002
Posts: 53
Location: MI

PostPosted: Thu Nov 07, 2002 1:42 am    Post subject: Reply with quote

I'd recommend GRUB. I doubt you'll ever regret making the switch. LILO seems to have more options for graphical menus, but that's about the only signifigant advantage I've seen. Even if you switch and hate it it's a piece of cake to switch back.
Back to top
View user's profile Send private message
guero61
l33t
l33t


Joined: 14 Oct 2002
Posts: 811
Location: Behind you

PostPosted: Thu Nov 07, 2002 1:56 am    Post subject: Reply with quote

I used to use LILO, and I find GRUB much easier to use and much more flexible. Some of the things I like about GRUB that I didn't know about/couldn't do in LILO:

1. Simply edit the config file and reboot; no need to run 'lilo' to make sure it parses your file! That also means no editing the boot config when you recompile your kernel, as long as you rename the new kernel the same as the old
2. Boot-time editing of parameters -- what if you screw up your config file? In GRUB, you can simply edit your config file right then and there, and get a solid boot.
3. Easier to understand config file -- just makes more sense to me.
4. GRUB is also available as a command line interpreter: You can call it up on a terminal and experiment with commands before you even write them to your config file.
5. It has a very cool name!
6. Incredibly simple M$ OS loading.
7. GRUB can be used as a rudimentary recovery tool. Not very powerful, but a whole lot more so than LILO
8. Great menu/background/color support.
9. How can you go wrong with something with "Grand Unified" in it's name? :D

My best example was the time I compiled a new kernel -- removed the old one, then got distracted. (Okay, I'm already dumb at this point). Came back later, and tried to reboot. No such luck. I had no kernel, no boot disk, I thought I was SOL. Then I remembered that I could edit my GRUB parameters, and the newly compiled kernel was still on the disk -- just another partition and really deep. I just edited the kernel line in GRUB, and it booted like a charm. I've been a fan of GRUB ever since.
Back to top
View user's profile Send private message
ckwall
Apprentice
Apprentice


Joined: 31 May 2002
Posts: 163

PostPosted: Thu Nov 07, 2002 2:15 am    Post subject: Reply with quote

OK, so how do I go about making the switch?
Back to top
View user's profile Send private message
boyo
n00b
n00b


Joined: 02 Nov 2002
Posts: 53
Location: MI

PostPosted: Thu Nov 07, 2002 3:31 am    Post subject: Reply with quote

Way easy. Make sure you have GRUB merged. As root type grub. When you get the GRUB prompt...
Code:
root (hdN,N)
setup (hdN)
qui


Where (hdN,N) is the drive number starting at zero and (hdN,N) is the partition number starting at zero

After that GRUB owns the boot sector of whichever drive you boot from. From there you can boot using the GRUB prompt, but it's much more convenient to create a grub.conf and a symlink menu.lst to grub.conf inside the /boot/grub dir. Sample grub.conf contents from the gentoo install docs are quoted below.

Note: that the sample assumes the kernel is located on the first partition of the first drive.
Quote:
default 0
timeout 30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title=My example Gentoo Linux
root (hd0,0)
kernel /boot/bzImage root=/dev/hda3

#Below is for setup using hardware RAID
title=My Gentoo Linux on RAID
root (hd0,0)
kernel /boot/bzImage root=/dev/ataraid/discX/partY

# Below needed only for people who dual-boot
title=Windows NT Workstation
root (hd0,5)
chainloader +1


That's it! for details check out:
http://www.gnu.org/software/grub/grub.html
http://www.gentoo.org/doc/build.html#doc_chap16
Back to top
View user's profile Send private message
ckwall
Apprentice
Apprentice


Joined: 31 May 2002
Posts: 163

PostPosted: Sun Nov 10, 2002 9:09 pm    Post subject: Reply with quote

This is the first result that I get:

grub> root (hda,1)

Error 23: Error while parsing number

grub>

What did I do wrong?
Back to top
View user's profile Send private message
guero61
l33t
l33t


Joined: 14 Oct 2002
Posts: 811
Location: Behind you

PostPosted: Sun Nov 10, 2002 9:20 pm    Post subject: Reply with quote

Grub's drive ordering system is numeric, not letters. That should be
Code:

root(hd0,1)

Of course, if you're trying to boot from the first partition, that should actually be
Code:

root(hd0,0)


It's different from Linux; that's all I can say.
Back to top
View user's profile Send private message
ckwall
Apprentice
Apprentice


Joined: 31 May 2002
Posts: 163

PostPosted: Sun Nov 10, 2002 9:22 pm    Post subject: Reply with quote

ok, now what have I done?

grub> root (hd0,1)
Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... no

Error 15: File not found

grub>
Back to top
View user's profile Send private message
boyo
n00b
n00b


Joined: 02 Nov 2002
Posts: 53
Location: MI

PostPosted: Sun Nov 10, 2002 9:31 pm    Post subject: Reply with quote

Remember, GRUB only recognizes numerical references for for both disks and partitions. Your input
Quote:
grub> root (hda,1)
should be
Code:
root(hd0,1)
This will tell grub that your /boot partition is the second (1) partition on your first (0) hdd. After that use
Code:
setup (hd0)
if you want GRUB to take over you MBR on your first (0) hdd.

Lastly, unless you want to manually point it to your kernel and feed it the appropriate kernel parameters when GRUB boots make sure your grub.conf file is properly configured. It's also a good idea to symlink menu.lst to grub.conf.

Happy GRUBing!
Back to top
View user's profile Send private message
boyo
n00b
n00b


Joined: 02 Nov 2002
Posts: 53
Location: MI

PostPosted: Sun Nov 10, 2002 9:36 pm    Post subject: Reply with quote

So my reply was a tad late.... :wink:

If you emerged GRUB all of those files will be located at /boot/grub. If it's having trouble you're not pointing it to your /boot partition with the root command. If /boot is the first partition on (h0) it would be
Code:
root (hd0,0)
instead of
Quote:
grub> root (hd0,1)
Back to top
View user's profile Send private message
ckwall
Apprentice
Apprentice


Joined: 31 May 2002
Posts: 163

PostPosted: Sun Nov 10, 2002 9:38 pm    Post subject: Reply with quote

I am using the root (hd0,1) rather than the root (hda,1) like you suggested. that seems to work fine, then next line that I type setup (hd0) gives me the grief.

grub> root(hd0,1)

Error 27: Unrecognized command

grub> root (hd0,1)
Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... no

Error 15: File not found

grub>
Back to top
View user's profile Send private message
ckwall
Apprentice
Apprentice


Joined: 31 May 2002
Posts: 163

PostPosted: Sun Nov 10, 2002 9:39 pm    Post subject: Reply with quote

hang on... just got your other post./
Back to top
View user's profile Send private message
ckwall
Apprentice
Apprentice


Joined: 31 May 2002
Posts: 163

PostPosted: Sun Nov 10, 2002 9:45 pm    Post subject: Reply with quote

OK, let's back up a bit. I think Iresolved the setup error issue, but based on you most recent post i tried:

grub> root (hd0,0)
Filesystem type unknown, partition type 0x82

Where as if I use:
grub> root (hd0,1)
Filesystem type is ext2fs, partition type 0x83

grub>

is there a command that will display my partition info from terminal?
Back to top
View user's profile Send private message
ckwall
Apprentice
Apprentice


Joined: 31 May 2002
Posts: 163

PostPosted: Sun Nov 10, 2002 9:47 pm    Post subject: Reply with quote

Device Boot Start End Blocks Id System
/dev/hda1 1584 1653 562275 82 Linux swap
/dev/hda2 * 1 1583 12715416 83 Linux
Back to top
View user's profile Send private message
ckwall
Apprentice
Apprentice


Joined: 31 May 2002
Posts: 163

PostPosted: Sun Nov 10, 2002 9:51 pm    Post subject: Reply with quote

Just in case it matters, I am not using Gentoo anymore. I used to use it, and have found that this is one of the best forums available, so I have stayed here. I am currently using slackware which should not have too many differences. Grub was then obviously not emerged, rather compiled. This was the problem, I think with my setup command. I did not have the files in the right place.

Last edited by ckwall on Sun Nov 10, 2002 9:58 pm; edited 1 time in total
Back to top
View user's profile Send private message
ckwall
Apprentice
Apprentice


Joined: 31 May 2002
Posts: 163

PostPosted: Sun Nov 10, 2002 9:57 pm    Post subject: Reply with quote

So is this telling me that my boot partition is hda,2? That cant be right, can it?
Back to top
View user's profile Send private message
boyo
n00b
n00b


Joined: 02 Nov 2002
Posts: 53
Location: MI

PostPosted: Sun Nov 10, 2002 10:24 pm    Post subject: Reply with quote

Well, based on what you posted...
Quote:
Device Boot Start End Blocks Id System
/dev/hda1 1584 1653 562275 82 Linux swap
/dev/hda2 * 1 1583 12715416 83 Linux
hda2 is your boot partition. That shouldn't make a difference. GRUB is quite flexible. You'll need to point GRUB to (hd0,1) like you had in your earlier post and make sure that all the grub files are in /boot/grub. The setup command should still refernce (hd0). All of that should be distro independent.
Back to top
View user's profile Send private message
ckwall
Apprentice
Apprentice


Joined: 31 May 2002
Posts: 163

PostPosted: Sun Nov 10, 2002 10:29 pm    Post subject: Reply with quote

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... no

Error 15: File not found

grub>

Stage one does exist in /boot/grub:

Code:
root@amd1400:/boot/grub# ls
AUTHORS      NEWS          config.guess    depcomp*        stage1/
BUGS         README        config.h        docs/           stage2/
COPYING      THANKS        config.h.in     grub/           stamp-h
ChangeLog    TODO          config.log      install-sh*     stamp-h.in
INSTALL      acconfig.h    config.status*  lib/            stamp-h1
Makefile     acinclude.m4  config.sub      missing*        util/
Makefile.am  aclocal.m4    configure*      mkinstalldirs*
Makefile.in  compile*      configure.in    netboot/
root@amd1400:/boot/grub#
Back to top
View user's profile Send private message
ckwall
Apprentice
Apprentice


Joined: 31 May 2002
Posts: 163

PostPosted: Sun Nov 10, 2002 10:36 pm    Post subject: Reply with quote

not understanding how this works, Iam assuming that the stage1 that grub is looking for is not the directory, rather the stage1 that is in the stage1 directory. Is this correct?and would that also be true for stage 2?
Back to top
View user's profile Send private message
ckwall
Apprentice
Apprentice


Joined: 31 May 2002
Posts: 163

PostPosted: Sun Nov 10, 2002 10:42 pm    Post subject: Reply with quote

OK, I have run all of that:
Code:
grub> root (hd0,1)
 Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... no
 Running "install /boot/grub/stage1 (hd0) /boot/grub/stage2 p /boot/grub/menu.l
st "... succeeded
Done.

grub>


walk me through the config files and symlink?
Back to top
View user's profile Send private message
ckwall
Apprentice
Apprentice


Joined: 31 May 2002
Posts: 163

PostPosted: Sun Nov 10, 2002 10:43 pm    Post subject: Reply with quote

whoa... just noticed the stage5, is that bad?
Code:
Checking if "/boot/grub/e2fs_stage1_5" exists... no
Back to top
View user's profile Send private message
boyo
n00b
n00b


Joined: 02 Nov 2002
Posts: 53
Location: MI

PostPosted: Sun Nov 10, 2002 10:45 pm    Post subject: Reply with quote

Here's what I see at a glance...

All you appear to have in /boot/grub is the GRUB source code. stage1 and stage2 are actual files rather than directories.

You may have to run find to see where make install stuck those files. If slackware has a GRUB package I'd recommend using that for the sake of convenience and simply to get everything running. Once it's up you can complie a version from source and upgrade to it later.
Back to top
View user's profile Send private message
ckwall
Apprentice
Apprentice


Joined: 31 May 2002
Posts: 163

PostPosted: Sun Nov 10, 2002 10:47 pm    Post subject: Reply with quote

Thats what I thought after I posted my directory, so I did that, I installed the package. The results of which are in my posts just before this one?
Back to top
View user's profile Send private message
ckwall
Apprentice
Apprentice


Joined: 31 May 2002
Posts: 163

PostPosted: Sun Nov 10, 2002 10:49 pm    Post subject: Reply with quote

I guess this is a n00b question, but tell me real quick is there a switch for rmdir that will delete the content of a directory even if it is not empty? I am going to try this one more time from scratch with the slackware package and see what happens.
Back to top
View user's profile Send private message
boyo
n00b
n00b


Joined: 02 Nov 2002
Posts: 53
Location: MI

PostPosted: Sun Nov 10, 2002 10:53 pm    Post subject: Reply with quote

use
Code:
rm -rf directoryname
or
Code:
rm -rf directoryname/*
if you want to wipe the contents of the directory but keep the directory itself.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum