Re: Grub configuration

Top Page
Attachments:
Message as email
+ (text/plain)
+ dual-booting.txt (text/plain)
Delete this message
Reply to this message
Author: Mark Jarvis
Date:  
To: plug-discuss
Subject: Re: Grub configuration

My earlier reply apparently was bumped because of a too-large attached
doc file. (It WAS large--sorry.) Here's the same content, but in a much
smaller text file.

There's a good discussion of boot techniques in chapter 4 of O'Reilly's
"Linux in a Nutshell". The attached doc file discusses using the
NT/2K/XP boot loader & boot.ini to multi-boot in a mixed Windows/Linux
environment. It's based on the O'Reilly chapter and reflects my own
experience. My current boot.ini allows me to choose between NT, 2
different XPs, and 4 different Linux installations. I've not tried using
it with a removable.

You may email me direct if you have any questions.

-mj-

Mark Jarvis


Bryce C wrote:

> Grub's not going to work in this setup. Its configuration is read when
> it loads and if its configuration (on the removable, linux drive) isn't
> readable, it will just stop.
> I can't help with M$ bootloader, though I did get the win2k bootloader
> to boot linux once, just to see how its done. There are plenty of
> tutorials to do this on the internet and your situation shouldn't
> provide any difficulties with them at all.
> My recommendation for this setup would be to use lilo. lilo writes its
> config to the MBR whenever `lilo` is run. This makes it self-sustaining,
> free from any support.
> I will also point out there are many other great bootloaders out there.
> I can't remember the name of my favourite "alternative" bootloader, but
> I'll post later when I find it. Something like Boot Manager i think.
>
> Good luck
>
> On Thu, 2004-07-15 at 14:28, Stephen Wiebelhaus wrote:
>
>>I'm setting up a system to dual boot WinXP and Linux. Linux is
>>installed on the secondary hard drive, which is a removable
>>drive(problem). I can't get either the WinXp boot loader to work, or
>>grub.
>>
>>Using grub, it works fine as long as the removable drive is installed.
>>But, if I remove the drive with Linux, Grub locks up on boot, and
>>won't do anything, won't boot windows either. Grub is installed on the
>>master boot record, primary drive. I want to be able to run WinXP with
>>a 3rd drive in the removable slot. How can I configure Grub so that it
>>will boot WinXp when the second drive(Linux) is not present.
>>
>>So I tried to do things with WinXP's bootloader. It doesn't care if
>>that second drive is in or not, it can still boot WinXP. For this I
>>installed Grub on the boot partition of the linux drive. The Linux
>>drive is partitioned: hdb1 swap 200MB, hdb2 /    4gigs. When
>>installing Suse linux, it gave me two options for where to place Grub,
>>master boot record or hdb2. So I choose option hdb2. I setup WinXP
>>boot config to either boot WinXP, or boot from the second partition of
>>the secondary harddrive, should be hdb2. But, when I select linux, it
>>just stops.

>>
>>So, how can I get this to work, either using Grub or WinXp bootloader
>>is fine.
>>
>>Hompage www.public.asu.edu/~swiebel/index.html
>>
>>
>>______________________________________________________________________
>>Do you Yahoo!?
>>Yahoo! Mail is new and improved - Check it out!


                Dual Booting Linux and NT/2K/XP
                 Using Windows MBR and boot.ini


I started dual booting NT and Linux when the reference books I had said
that Windows NT/2000/XP expected to use the Windows boot loader. (I
understand that newer versions of grub and maybe even lilo CAN handle
NT/2K/XP.) The following steps are based on material in the "Booting"
chapter in O'Reilly's "Linux in a Nutshell"--AND they work!

The following assumes that you are installing Linux into partition
three on the second disk or, in Linux terms, hdb3. Obviously, modify
as required.


1. When installing, two things are critical:
   a. Do NOT allow the installation program to write a boot manager 
      which will overwrite the MBR of your boot disk. Depending on 
      your distro you can choose 
      1) no boot manager (Red hat & Fedora), 
      2) write boot manager to fd0 (Mandrake), 
      3) write the boot manager to the partition you’re installing to, 
         rather than to the mbr of the disk (Mepis), etc. 
   b. Be sure to have the installation program create a boot floppy.
2. Using the boot floppy, boot into the just-installed Linux, open a 
   terminal window, and su - to root.
   a) On occasions when creating a boot floppy failed, I have been able to continue, but it was a bit flaky.  Basically, I had to boot into rescue mode from the installation CD and chroot to the mount point of the new Linux partition.


3. If you are using lilo:
   a. If /etc/lilo.conf exists, rename it--you may need it later.
   b. Create /etc/lilo.conf with more or less the following content:
       boot=/dev/hdb3
       map=/boot/map
       root=/dev/hdb3
       install=/boot/boot.b
       lba32
       image=vmlinuz
       read-only


         Modify both hdb3 entries to match the partition you're installing 
         Linux on.


   c. cd to /boot
   d. If there is not a "vmlinuz" entry as a symbolic link to the real 
      vmlinuz, create one.
   e. Run lilo. This will install lilo on the Linux root partition.


4. If you are using grub:
   a. If /boot/grub/grub.conf exists, rename it--you may need it later.
   b. Create /boot/grub/grub.conf with content similar to the following.  
      (Note: grub labels disks and partitions starting with zero.)  It 
      is not necessary to run grub.
       title Red Hat Linux (2.4.18-14)
       root (hd1,2)
       kernel /vmlinuz-2.4.18-14 ro root=LABEL=/ hdc=ide-scsi
       initrd /initrd-2.4.18-14.img


5. Run the dd comand to make a copy of the just created Linux boot sector.
                   dd if=/dev/hdb3 of=/bootsect.lnx bs=512 count=1
          Modify "hdb3" as necessary. Use any name you like instead of 
          "bootsect.lnx"

    
6. Copy /bootsect.lnx to a DOS formatted floppy disk.
        umount /dev/fd0
        mkdir /mnt/floppy
        mount -t msdos /dev/fd0 /mnt/floppy
        cp /bootsect.lnx /mnt/floppy
        umount /mnt/floppy


7. Boot into windows.

8. Copy bootsect.lnx from the floppy to the C: drive.

9. Make C:\boot.int editable (no system or read-only attributes).

            attrib -a -r c:\boot.ini


Add a line similar to the following to "c:\boot.ini".

        c:\bootsect.lnx="My Linux Installation"


The following is my "boot.ini". As you can see, my system is "a little
different". (Note: Some lines may be folded.)

[boot loader]
timeout=10
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Pro on 75 GB G Drive" /fastdetect
c:\whitebox.lnx="WBEL: White Box Enterprise Linux"
c:\fedora_s.lnx="Small Fedora Linux (Yarrow)"
c:\mepis.lnx="Mepis Linux"
c:\knoppix.lnx="Knoppix Linux"
c:\fedora_b.lnx="Fedora Linux--Everything (Yarrow)"
multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="Microsoft Windows XP Pro on 15 GB F Drive" /fastdetect
scsi(0)disk(0)rdisk(0)partition(1)\WINNT="Windows NT4 Workstation on SCSI Drive (D)"