[NTLUG:Discuss] Boot Loader

terry linux at cowtown.net
Fri Aug 8 00:11:48 CDT 2003


George Lass wrote:

>George Lass wrote:
>  
>
>>>>What he means is to open a terminal, su to root, and type the command:
>>>>grub --install
>>>>
>>>>It's just that simple.
>>>>        
>>>>
>>In order to verify what needs to be in my grub.conf file I
>>installed grub on a floppy:
>>
>>dd if=stage1 of=/dev/fd0 bs=512 count=1
>>dd if=stage2 of=/dev/fd0 bs=512 seek=1
>>
>>built the following grup.conf file:
>>
>>splashimage=(hd1,0)/grub/splash.xpm.gz
>>title DELL-DIAG
>>        rootnoverify (hd0,0)
>>        chainloader +1
>>title WIN-XP
>>        rootnoverify (hd0,1)
>>        chainloader +1
>>title CURRENT_LINUX
>>        root (hd1,0)
>>        kernel /vmlinuz-2.4.20-8 root=/dev/hdb2 ro
>>
>>booted from the floppy and at the grub prompt I entered:
>>
>>configfile (hd1,1)/etc/grub.conf
>>
>>everything worked just fine.  Now to actually install grub
>>on one of my hard drives.  can it really be as simple as
>>grub --install ?? 
>>

Yes.

>>I don't want to wipe out the loader for
>>WIN XP (not yet anyway). 
>>

Why not?  Ya gotta do it sooner or later, no time like the present...

>> Here is how Liunx fdisk sees things:
>>
>>   Device Boot    Start       End    Blocks   Id  System
>>/dev/hda1             1         5     40131    6  FAT16
>>/dev/hda2   *         6      7294  58548892+   7  HPFS/NTFS
>>
>>   Device Boot    Start       End    Blocks   Id  System
>>/dev/hdb1   *         1        13    104391   83  Linux
>>/dev/hdb2            14       905   7164990   83  Linux
>>/dev/hdb3           906      1035   1044225   82  Linux swap
>>/dev/hdb4          1036      4865  30764475   83  Linux
>>
>>and here is how I mount / and /boot:
>>
>>Filesystem           1K-blocks      Used Available Use% Mounted on
>>/dev/hdb2              7052496   2022600   4671648  31% /
>>/dev/hdb1               101089     25955     69915  28% /boot
>>
>>It should be noted that the only boot options in the PC's BIOS
>>are floppy, CD-ROM, and Hard-Disk c:
>>
>>George
>>
>>    
>>
>
>I've done some more digging and ran across these instructions for
>altering the XP boot configuration:
>

Again, your making this out to be much harder than it is.  You can use 
the MS Windows bootloader if you want to but it's just a more 
complicated affair.  If you'll just install grub into mbr of hda and be 
done with it, it'll be a much simpler, better system.

>
>ON LINUX
>#> grub-install /dev/dhb1
>#> dd if=/dev/hdb1 of=/mnt/floppy/linux.bin bs=512 count=1
>
>ON WINDOWS
>add the following line to c:\boot.ini
>
>c:\linux.bin="LINUX"
>
>copy linux.bin from the floppy to c:\
>
>
>Well I've done all of that, and sure enough, when I boot from the
>hard drive the NT Loader gives me the option to boot LINUX.  If I
>select LINUX though, all that happens is "GRUB " prints out on the
>monitor and then the system hangs.  Normally, this is an indication
>that the boot partition is beyond sector 1024, but as you can
>see from the above fdisk output, this does not appear to be the case.  
>
>*any* help would be welcome!
>

If you do it this way, you'd still have to install grub, but into hdb 
instead of hda. You still have to use grub [or lilo] either way you 
slice it, so in my opinion you should install it [grub] into the mbr of 
hda  and be done with it.  BUT, if you want to do it your way, just use 
command:

grub --install /dev/hdb

and it'll write grub into the mbr of hdb instead of hda.  ( into d: 
instead of c: )

But first you'd prolly want to take out the MS Windows boot section from 
/etc/grub.conf because you won't be using it any more.

----
Further explanation:
You see, the [grub] default is to write [grub] to mbr of hda, (c:). So 
when you issue command:
grub --install
it's the same as:
grub --install /dev/hda

SO, in this case, if you issue command:
grub --install /dev/hdb  
It'll write grub to the MBR of hdb instead of hda.  ( d: instead of c: )
---
You've taken the most difficult approach to this task, but either way 
will work.
See:
man grub
and
info grub
for more info.

-- 
Registered Linux User #188099
<><






More information about the Discuss mailing list