Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Grub boot floppy HOWTO
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
SuperSheep
Tux's lil' helper
Tux's lil' helper


Joined: 06 Apr 2004
Posts: 133
Location: South London, England

PostPosted: Wed Jun 09, 2004 11:57 am    Post subject: Grub boot floppy HOWTO Reply with quote

Making a GRUB boot floppy

Sometimes you need a way to test your dualboot setup without hosing your Windows 98/ME/XP install by installing grub. Making a floppy with the GRUB on it will let you use the disk whenever you need to test a grub.conf.

If you've emerged grub already, but not set it up to run on your hard disk, its easy to make a bootloader floppy. I used mine to test the commands for booting XP.

Get a floppy, and put it in your drive. Now we're going to format the disk with ext2:

Code:
fdformat /dev/fd0
mke2fs /dev/fd0


Now we can mount the disk, and the boot partition, and copy some files to it that grub needs.

Code:
mount /boot
mkdir /floppy
mount /dev/fd0 /floppy
cp /boot/grub/stage* /floppy
umount /floppy


Now we run grub, and use its console to install it on the floppy.

Code:
grub


Now you should have a console up with the prompt "grub>". To install grub onto the floppy:

Code:
root (fd0)
setup (fd0)
quit


Right, now you've got a working grub floppy. When you reboot with it, you'll see a console that looks like the one you installed grub onto the floppy with. Now you can run commands that will let you boot linux. If you followed the tutorial, then your root partition is hda3, and your boot partition is hda1. Type the following in the grub console to boot Linux:

Code:
root (hd0,0)
kernel /<name of kernel> root=/dev/hda3
boot


Replace <name of kernel> with your kernel name. You can use tab-complete to find it.

If you want to boot Windows, you'll need to specify the partition its on. GRUB uses a naming system for disks and partitions that starts from zero, so the first partition of the first disk (/dev/hda1) is (hd0,0), then second disk, fourth partition (/dev/hdb4) is (hd1,3), etc. In my configuration, I have XP on /dev/hda1. We use rootnoverify as GRUB can't understand the NTFS filesystem.

Code:

rootnoverify (hd0,0)
chainloader +1
boot

_________________
http://www.bash.org/?65749
Back to top
View user's profile Send private message
tomthewombat
Apprentice
Apprentice


Joined: 29 Mar 2003
Posts: 244
Location: NY State

PostPosted: Wed Jun 09, 2004 3:43 pm    Post subject: Reply with quote

Thanks for the throrough guide. Making on of these is on my todo list, but i always seem to forget. :-/
Back to top
View user's profile Send private message
BlindSpy
Apprentice
Apprentice


Joined: 20 Mar 2004
Posts: 263

PostPosted: Wed Jun 09, 2004 7:05 pm    Post subject: Reply with quote

awesome guide =)
Back to top
View user's profile Send private message
dmitrio
Tux's lil' helper
Tux's lil' helper


Joined: 10 Dec 2002
Posts: 115
Location: Pago Pago

PostPosted: Mon Jun 28, 2004 3:08 pm    Post subject: :. copied to gentoo-wiki Reply with quote

I have copied this, with permission of SuperSheep, to gentoo-wiki.com
http://gentoo-wiki.com/HOWTO_Bootable_Floppy_with_GRUB
If you see anything that should be added or changed, feel free to do so.

Thank you for a great HOWTO.
_________________

... Leaving ground, destination is unknown,
into the darkness and far away from home,
Will your dream come true and what will you find,
when fate is your guide ...
Back to top
View user's profile Send private message
Bollenator
n00b
n00b


Joined: 12 Apr 2004
Posts: 44
Location: WA, USA

PostPosted: Mon Jun 28, 2004 6:38 pm    Post subject: Reply with quote

Sweet, this is exactly what I'm looking for!

One question, though. If I use a GRUB floppy to boot but I still have GRUB installed on my Gentoo drive (I have two separate hard drives for Windows and Gentoo), will it run GRUB again when it boots to my Gentoo drive? Do I need to uninstall GRUB or change the grub.conf (if I change the physical location of the drive)?

Brief explanation: I currently have Gentoo installed on the only hard drive connected to my PC while my Windows drive remains disconnected (so as not to kill it by typing a bad command). What I would like to do is put the Windows drive back in as master and my Gentoo drive as slave and only boot Gentoo from a GRUB floppy (i.e. no boot loader screen). This is for the benefit of my wife who is getting rid of her computer so we can share mine. This way, I will hopefully be able to continue playing with Gentoo when she doesn't want to use the computer, but she can start it up and have it go right into Windows. Therefore, will I need to change my grub.conf file to say:

Code:
root (hd1,0)  #as opposed to hd0,0 as it is now
... root=/dev/hdb3 ...  #as opposed to /dev/hda3 as it is now
?

Will that work from the floppy? Thanks for any feedback.
_________________
Bollenator

"This one's a mystery, wrapped in an enigma, baked in a conundrum, splashed with brain-twisters, diced, and served cold on a riddle roll with secret sauce."
Back to top
View user's profile Send private message
phate
Apprentice
Apprentice


Joined: 22 Mar 2004
Posts: 298
Location: Aachen, Germany

PostPosted: Mon Jun 28, 2004 6:53 pm    Post subject: Reply with quote

I get following error:
Code:
grub> setup (fd0)
 Checking if "/boot/grub/stage1" exists... no
 Checking if "/grub/stage1" exists... no

Error 15: File not found


but /boot/grub/stage1 exsists...
Code:
root@host / # ls -al /boot/grub/stage1
-rw-r--r--  1 root root 512 19. Jun 00:29 /boot/grub/stage1
Back to top
View user's profile Send private message
SuperSheep
Tux's lil' helper
Tux's lil' helper


Joined: 06 Apr 2004
Posts: 133
Location: South London, England

PostPosted: Thu Jul 01, 2004 1:47 pm    Post subject: Reply with quote

Phate: You need to make sure you copied the stage files onto the *floppy* - it does not matter if they are in your boot partition when you run the grub console and use the setup command.

Bollenator: You can only run one bootloader during bootup - so when you use your floppy to boot, it will boot an operating system and nothing else - no need to worry if grub will run twice.

Yes, you are essentially correct. In order to modify the bootloader's options, you need to fiddle with grub.conf. I'd make a grub.conf along the lines of the one you suggested and put it on the floppy with "timeout 0" at the top of grub.conf. That way, when the disk is in, Gentoo will boot with no pause - when the disk is out, then Windows will boot.

Hope that helps you guys, sorry about the slow reply.
_________________
http://www.bash.org/?65749
Back to top
View user's profile Send private message
phate
Apprentice
Apprentice


Joined: 22 Mar 2004
Posts: 298
Location: Aachen, Germany

PostPosted: Thu Jul 01, 2004 5:24 pm    Post subject: Reply with quote

I forgot to tell so, they are already there :D
But it's still not working

Code:
root@host / # ls -al /mnt/floppy/

drwxr-xr-x   3 root root   1024 28. Jun 20:44 .
drwxr-xr-x  10 root root   4096 30. Jun 18:43 ..
drwx------   2 root root  12288 28. Jun 20:43 lost+found
-rw-r--r--   1 root root    512 28. Jun 20:44 stage1
-rw-r--r--   1 root root 135148 28. Jun 20:44 stage2
-rwxr-xr-x   1 root root 196996 28. Jun 20:44 stage2.netboot
Back to top
View user's profile Send private message
Bollenator
n00b
n00b


Joined: 12 Apr 2004
Posts: 44
Location: WA, USA

PostPosted: Thu Jul 01, 2004 11:51 pm    Post subject: Reply with quote

phate wrote:
I forgot to tell so, they are already there :D
But it's still not working

I had this problem at first, also. I solved it by moving everything on the floppy (i.e. stage*) to a new /[floppy mount point]/boot/grub/ directory. Once everything was in there, it worked just fine. Hope that helps.
_________________
Bollenator

"This one's a mystery, wrapped in an enigma, baked in a conundrum, splashed with brain-twisters, diced, and served cold on a riddle roll with secret sauce."
Back to top
View user's profile Send private message
phate
Apprentice
Apprentice


Joined: 22 Mar 2004
Posts: 298
Location: Aachen, Germany

PostPosted: Fri Jul 02, 2004 10:55 pm    Post subject: Reply with quote

thanx, you solved my problem 8)
Back to top
View user's profile Send private message
eyoung100
Veteran
Veteran


Joined: 23 Jan 2004
Posts: 1421

PostPosted: Tue Jul 06, 2004 5:32 am    Post subject: Reply with quote

Bollenator wrote:
Sweet, this is exactly what I'm looking for!
Brief explanation: I currently have Gentoo installed on the only hard drive connected to my PC while my Windows drive remains disconnected (so as not to kill it by typing a bad command). What I would like to do is put the Windows drive back in as master and my Gentoo drive as slave and only boot Gentoo from a GRUB floppy (i.e. no boot loader screen). This is for the benefit of my wife who is getting rid of her computer so we can share mine. This way, I will hopefully be able to continue playing with Gentoo when she doesn't want to use the computer, but she can start it up and have it go right into Windows. Therefore, will I need to change my grub.conf file to say:

Code:
root (hd1,0)  #as opposed to hd0,0 as it is now
... root=/dev/hdb3 ...  #as opposed to /dev/hda3 as it is now
?

Will that work from the floppy? Thanks for any feedback.


Instead of messing with boot floppies for dual boot systems. I recommend something like these removable drive caddies for anyone who needs the functionality of Windows, but loves to experiment with alternative OS'es. Most of us who found our way to Linux (Gentoo rocks btw :D , I've tried them all) have an extra Hard Drive laying around somewhere. If we didn't I wouldn't suggest these. I currently own 2 drive caddies and 1 drive bay. The drive bay is set to Primary Master and the Hard Drives in the caddies are also set to Primary Master. The drive bay screws in like a regular hard drive but its empty except for another IDE connecter which the caddy slides into. When I feel like using Gentoo I shutdown Windows, flip a switch on the drive bay, pull the caddy out that holds my Windows OS, slide Gentoo in, flip the switch again to lock the drive in place and reboot. Vice Versa for Windows. Doing this saves me the time and effort of having both OS'es fighting each other, and that was well worth the ~$30. Now that I have these I don't think I could do without them. Some images if my explainatin didn't make sense (The Img tag in the post builder isnt working, so I turned them to URL's):

This is what screws into your case
This is where you screw the actual drive into the caddy
This is the previous image with the lid on. For each drive you want to be removable you buy one of these.
How it all works.
I recommend the BAYA1002
_________________
The Birth and Growth of Science is the Death and Atrophy of Art -- Unknown
Registerd Linux User #363735
Adopt a Post | Strip Comments| Emerge Wrapper
Back to top
View user's profile Send private message
jftuga
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jan 2004
Posts: 139
Location: Athens, GA

PostPosted: Tue Jul 06, 2004 10:30 am    Post subject: Reply with quote

Can newer PCs boot off of a firewire drive yet? Do recent BIOSs allow for this? I know that Apple G5s have this capability.

-John
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks 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