LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 06-02-2004, 09:27 AM   #1
NickC
Member
 
Registered: Nov 2003
Location: Portland, OR, USA
Posts: 111

Rep: Reputation: 15
How to set up boot from Floppy (or CD)?


Here's the situation: I have two HDDs in my machine. Windows XP is on HDD1 - this is my main machine as I'm still a Linux newbie and trying to figure things out. My family uses it, and I still have lots of work on that machine. Mandrake 9.2 is on HDD2.

But the way I've set it up is each drive is independent - not even connected together! So when I'm running XP, my Linux drive is not even plugged in. When I want to run Linux, I power off and physically switch the IDE cable from HDD1 to HDD2 and fire up Mandrake. This works well because I have no worries about screwing with the MBR or anything else of my Windows drive.

The obvious problem is each time I want to switch OS's, I have to open the case and switch drives. I still do NOT want to mess with dual booting and generally screwing with the MBR of Windows. I don't have time right now to clean up any messes I may make!

I heard there was a way to set things up so that I can connect both drives all the time, but the computer will ALWAYS boot to Windows XP unless I insert a boot floppy (or CD) for Mandrake. Is there an easy way to do this considering I already have Mandrake 9.2 installed on HDD2? i.e., can I just create a boot floppy and then go plug in both drives (with Linux as slave)? And then it will just always boot to XP except when I boot with the floppy (or CD) in the drive?

Or will I have to reinstall Mandrake to make this work? Actually I may do that anyway, because right now the Linux drives is quite loud. One of the advantages to switching drives is that it's quiet when I'm running Windows! If I want both drives plugged in all the time I should really buy a quiet drive for Linux.

I searched around, but all the posts I could find dealt with dual booting and various tricks to make it work. As I said, right now I don't want to mess with this. I just want the machine to boot to Windows unless I override it with a Linux boot floppy (or CD).

Last edited by NickC; 06-02-2004 at 10:56 AM.
 
Old 06-02-2004, 10:50 AM   #2
ahh
Member
 
Registered: May 2004
Location: UK
Distribution: Gentoo
Posts: 293

Rep: Reputation: 31
Go to your boot loader setup, I don't know where that is in Mandrake as I use SuSE, and it should ask you where you want to install it. Tell it you want to install it on a floppy. Now when you boot with the floppy in it will boot Linux, and without the floppy in it will boot Windows.
 
Old 06-02-2004, 10:55 AM   #3
NickC
Member
 
Registered: Nov 2003
Location: Portland, OR, USA
Posts: 111

Original Poster
Rep: Reputation: 15
Thanks. So is this something I could do with my current install? Or can it only be done in the process of a fresh install?
 
Old 06-02-2004, 11:04 AM   #4
ahh
Member
 
Registered: May 2004
Location: UK
Distribution: Gentoo
Posts: 293

Rep: Reputation: 31
You can do it with your current install. Somewhere in your Mandrake control centre, if it has one, or if not it is possible to edit your grub or lilo configuration files by hand. But you definately don't need to reinstall to do it.
 
Old 06-02-2004, 11:20 AM   #5
Dave Farrance
Member
 
Registered: May 2004
Location: UK
Distribution: Mandrake 10.0
Posts: 47

Rep: Reputation: 15
Not easy.

The kernel will be on hdb instead of hda, but lilo needs to see the kernel in the position that it's going to be in when you install the bootloader.

You can do it with the grub bootloader, but that takes some time to learn how to use.

Or maybe you boot the rescue console on the installation CD1 (press F1 when prompted) when the drive is in its slave position, mount the mandrake installation, chroot to its mount position and edit lilo.conf appropriately and run lilo to install it to a floppy.

It's not easy and you'll probably have to do a lot of manpage reading, and find your way through by trial and error.
 
Old 06-02-2004, 11:26 AM   #6
ahh
Member
 
Registered: May 2004
Location: UK
Distribution: Gentoo
Posts: 293

Rep: Reputation: 31
Lilo doesen't mind where a kernel is, you just have to tell it. I have always run my dual boot boxes with lilo on a floppy and never had a problem. Have a look at
Code:
man lilo.conf
for some examples.

Last edited by ahh; 06-02-2004 at 11:27 AM.
 
Old 06-02-2004, 04:14 PM   #7
Dave Farrance
Member
 
Registered: May 2004
Location: UK
Distribution: Mandrake 10.0
Posts: 47

Rep: Reputation: 15
It does mind if it can't see the kernel at the indicated position when the bootloader is being installed (as would be the case when a drive is to change its location). It needs to see it to determine its absolute offset from the start of the partition.
 
Old 06-02-2004, 04:58 PM   #8
oxidized
LQ Newbie
 
Registered: Jun 2004
Location: New York City
Distribution: Debian
Posts: 21

Rep: Reputation: 15
wow, I seem to literally be advertising this program a lot, but I feel it can be relavant to your case

Code:
http://btmgr.sourceforge.net/
Smart Bootmanager. Open source program. You install it to a floppy disk. Connect your two hds, reboot with that program on the disk. From there you can select what hard drive.

That software is also nice if you have trouble booting from CD too.
 
Old 06-02-2004, 05:41 PM   #9
NickC
Member
 
Registered: Nov 2003
Location: Portland, OR, USA
Posts: 111

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by ahh
Lilo doesen't mind where a kernel is, you just have to tell it. I have always run my dual boot boxes with lilo on a floppy and never had a problem. Have a look at
Code:
man lilo.conf
for some examples.
Great. I'll look into it. I believe I'm using GRUB.

And:

Quote:
Originally posted by oxidized
Smart Bootmanager. Open source program. You install it to a floppy disk. Connect your two hds, reboot with that program on the disk. From there you can select what hard drive.

That software is also nice if you have trouble booting from CD too.
This looks like the easiest solution. So given that both my hard drives are configured as single, I hook up my Windows drive as master and Linux as slave and then boot from this software on floppy and it will choose, huh?! What if I don't boot from here - will the master drive automatically boot first? (i.e., can I default to Windows if I leave the floppy out?)
 
Old 06-02-2004, 06:07 PM   #10
Dave Farrance
Member
 
Registered: May 2004
Location: UK
Distribution: Mandrake 10.0
Posts: 47

Rep: Reputation: 15
If you're using grub then stick with it. I think that it's the best tool for this task. Unlike lilo, it doesn't need to see the kernel in its correct position before the bootloader is installed. So you can edit grub's menu.lst to change hda for hdb.

You'll also need to edit /etc/fstab similarly.

That Smart Bootmanager seems to refer to bootable partitions only. It might be able to locate a linux kernel, but if it does, they've forgotten to mention it on their web page there. In which case you'd need to put lilo or grub on the boot record of the linux partition to make it bootable, and you're back to the original problem.
 
Old 06-03-2004, 08:19 AM   #11
NickC
Member
 
Registered: Nov 2003
Location: Portland, OR, USA
Posts: 111

Original Poster
Rep: Reputation: 15
Okay, so if I stick with Grub, I can change the menu.lst and /etc/fstab to show that the drive is now on slave (hdb) instead of master (hda). But do I still need to move the boot loader onto floppy as ahh had initially said?
 
Old 06-03-2004, 08:46 AM   #12
Dave Farrance
Member
 
Registered: May 2004
Location: UK
Distribution: Mandrake 10.0
Posts: 47

Rep: Reputation: 15
Yes. It just so happens that I wrote a script for myself to transfer the existing (and hopefully working) grub onto a floppy.
Code:
#!/bin/sh

if [ $USER != root ]; then 
  echo "Only root can do this";
  exit;
fi

read -p "Format floppy? y/n " yesno
if [[ $yesno = [Yy]* ]]; then

  # format & mkfs can't be done without this
  umount -v -f /mnt/floppy;

  # force format at 1440 despite current format
  fdformat /dev/fd0u1440

  # Make ext2 with no space reserved for super user
  mke2fs -v -m 0 /dev/fd0;
  
  # I don't know why this has to be so specific, but it does
  mount -v -t ext2 /dev/fd0 /mnt/floppy;
  
fi
  
# make parent directories as necessary
mkdir -v -p /mnt/floppy/boot/grub

# put grub images & menu on floppy
cp -v /boot/grub/* /mnt/floppy/boot/grub

# install bootloader
/usr/sbin/grub --batch <<EOT
root (fd0)
setup (fd0)
quit
EOT

# flush write caches
sync
edit: I've just replaced superformat with fdformat in the above script which is the more commonly installed package

Last edited by Dave Farrance; 06-03-2004 at 09:42 AM.
 
Old 06-03-2004, 09:26 AM   #13
NickC
Member
 
Registered: Nov 2003
Location: Portland, OR, USA
Posts: 111

Original Poster
Rep: Reputation: 15
Thanks - I will try this!

From what I see in your script, you're simply copying Grub stuff onto your floppy - you're not deleting anything from the hard drive?

So by doing this, with the Windows hard drive installed as master, my PC will always boot up to that and pretty much not even look at the boot loader on the slave Linux drive, right? And when I put this floppy into the drive, it will override the normal boot sequence and go directly to the Linux slave drive? Sounds perfect!
 
Old 06-03-2004, 09:40 AM   #14
Dave Farrance
Member
 
Registered: May 2004
Location: UK
Distribution: Mandrake 10.0
Posts: 47

Rep: Reputation: 15
That's correct.

Note that I've corrected the script so if you'd already copied it, then please copy it again.
 
Old 06-03-2004, 03:13 PM   #15
NickC
Member
 
Registered: Nov 2003
Location: Portland, OR, USA
Posts: 111

Original Poster
Rep: Reputation: 15
Excellent. I'm going to be busy for the next few days, but when I get a chance I will try this out and post back results. I hadn't copied down the script before you corrected it, so no problems there.

Thanks again for all the help!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Lost Linux boot and boot floppy doesn't work marquedios Linux - Newbie 9 05-22-2005 02:21 PM
Creating a Boot Floppy for Dual Boot Setup? jdanniel Linux - Newbie 8 08-07-2004 02:08 PM
Trying to set linux box as router firewall that'll boot from floppy only dbiswaswb Linux - Newbie 7 05-09-2004 08:26 AM
Floppy disk fail to boot when install suse 8 with boot from floppy ffang Linux - Newbie 0 08-18-2003 08:44 PM
Slackware 9.0 floppy set? sobolev Slackware 3 08-13-2003 05:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 05:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration