Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Replacing LILO with grub on SCSI system.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
btimby
n00b
n00b


Joined: 08 Feb 2004
Posts: 8

PostPosted: Sun Feb 08, 2004 9:23 pm    Post subject: Replacing LILO with grub on SCSI system. Reply with quote

Hello, I am having fits installing Gentoo onto a desktop machine that previously ran Mandrake. I have four SCSI drives in this system. I followed the Gentoo installation guide, and I have installed Gentoo maybe four times, but always on a new system, and with IDE drives. I formatted all the partitions in the system, however, I am using the same partitions as were on the Mandrake install. Whenever I boot, LILO takes over, even though I have toggled the boot flag off for all except my first partition on my first drive. This partition I mount as /boot. I have installed Grub using:

grub
root (hd0,0)
setup (hd0,0)

and my /boot/grub/device.map seems correct:

(fd0) /dev/floppy/0
(hd0) /dev/scsi/host0/bus0/target0/lun0/disc
(hd1) /dev/scsi/host0/bus0/target1/lun0/disc
(hd2) /dev/scsi/host0/bus0/target2/lun0/disc
(hd3) /dev/scsi/host0/bus0/target3/lun0/disc

Here is the output of fdisk -l:

Disk /dev/scsi/host0/bus0/target0/lun0/disc: 18.3 GB, 18351959040 bytes
255 heads, 63 sectors/track, 2231 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/scsi/host0/bus0/target0/lun0/part1 * 1 14 112423+ 83 Linux
/dev/scsi/host0/bus0/target0/lun0/part2 15 2231 17808052+ 5 Extended
/dev/scsi/host0/bus0/target0/lun0/part5 15 216 1622533+ 83 Linux
/dev/scsi/host0/bus0/target0/lun0/part6 217 2231 16185456 83 Linux

Disk /dev/scsi/host0/bus0/target1/lun0/disc: 9105 MB, 9105018880 bytes
255 heads, 63 sectors/track, 1106 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/scsi/host0/bus0/target1/lun0/part1 1 1106 8883913+ 83 Linux

Disk /dev/scsi/host0/bus0/target2/lun0/disc: 4569 MB, 4569600000 bytes
142 heads, 42 sectors/track, 1496 cylinders
Units = cylinders of 5964 * 512 = 3053568 bytes

Device Boot Start End Blocks Id System
/dev/scsi/host0/bus0/target2/lun0/part1 1 1497 4462468+ 83 Linux

Disk /dev/scsi/host0/bus0/target3/lun0/disc: 4569 MB, 4569600000 bytes
255 heads, 63 sectors/track, 555 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/scsi/host0/bus0/target3/lun0/part1 1 555 4458006 82 Linux swap

I am at a loss, any help is greatly appreciated.
Back to top
View user's profile Send private message
plasmagunman
l33t
l33t


Joined: 07 Jun 2002
Posts: 604
Location: berlin

PostPosted: Sun Feb 08, 2004 9:54 pm    Post subject: Re: Replacing LILO with grub on SCSI system. Reply with quote

btimby wrote:
Whenever I boot, LILO takes over, even though I have toggled the boot flag off for all except my first partition on my first drive. This partition I mount as /boot. I have installed Grub using:

grub
root (hd0,0)
setup (hd0,0)

the boot flag isn't really important, in fact i didn't set it for two years..

the normal place for bootloaders is the master boot record of the disc, so try install grub with "setup (hd0)".
_________________
please, feel free to correct my english. - por favor, corrige mi español.
Back to top
View user's profile Send private message
btimby
n00b
n00b


Joined: 08 Feb 2004
Posts: 8

PostPosted: Sun Feb 08, 2004 10:05 pm    Post subject: You are the king! Reply with quote

That did the trick. Let me try to understand what is going on here...

the MBR exists on the DISK, NOT (or maybe AND) the partition. I was installing grub to the partition, when it should have gone on the DISK. Is this correct?

Thank you for the info!
Back to top
View user's profile Send private message
plasmagunman
l33t
l33t


Joined: 07 Jun 2002
Posts: 604
Location: berlin

PostPosted: Sun Feb 08, 2004 10:53 pm    Post subject: Re: You are the king! Reply with quote

btimby wrote:
the MBR exists on the DISK, NOT (or maybe AND) the partition. I was installing grub to the partition, when it should have gone on the DISK. Is this correct?

exactly. mbr is at the beginning of the disk, at the beginning of each partition is a boot record, too. unfortunately i don't know how they are called.

when a pc boots it loads the mbr into memory and executes it. the standard microsoft mbr says to the pc: goto the bootable partition and read the boot sector there.

lilo knows exactly where on the disk the kernel is, so it says: goto that position and read this amount of bytes. lilo doesn't know anything about filesystems. if you defrag your partition (or just move your kernel around) you have to perform "lilo", which rewrites the boot record. otherwise booting will fail.

grub knows about filesystems. at installing you have to tell it where its root-partition is. with "setup" it will copy some of it's code and a filesystem-driver into the boot record. have a look at grub-output:
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... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  16 sectors are embedded. succeeded
 Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,1)/boot/grub/stage2 /boot/grub/grub.conf"... succeeded
Done.

while booting grub kinda "mounts" it's root-partition and can read all files there. so it opens it's grub.conf, splashimage, etc. and is able to read all kernels on this partition. if you specify a kernel on another partition it will try to load the apropriate filesystem-driver. the stagenumbers of grub specify if it knows about filesystems, is in prefilesystem-mode and so on. actually i'm not very sure about these stage-things...

for other operating systems there's always the possibility to chainload, which means: goto the specified partition and load its boot sector. so you can boot windows, it won't even recognize that it was booted by a dirty, asocial open-source program.

what to do if you're going to install another os on a free partition, debian for example? of course you can tell grub to boot debian, but then you have to understand how debian boots. does it use a initial ramdisc? where is it? etc. debian will offer you to install it's own bootloader, which will run perfect. you can tell debian to install it into the boot sector of its own partition. then you only have to add the "debian: chainload this partition"-part to your grub.conf and you're done. that's the case when multiple boot sectors become handy.

i hope i explained what you asked for. actually i forgot your question, i just enjoyed writing about booting...
_________________
please, feel free to correct my english. - por favor, corrige mi español.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
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