Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
12-24-2005, 06:48 PM
|
#1
|
Member
Registered: Nov 2005
Distribution: Ubuntu 9.10 and Slackware 13.1
Posts: 78
Rep:
|
Boot from floppy image using GRUB
I need to reflash the BIOS on my Dell Precision 410, but my floppy drive was removed. Is there a way to get GRUB to boot a floppy image file (.bin, .img, etc) stored on a hard drive? Under linux, I can mount a floppy image, and I found a driver that creates a virtual drive under Windows, but I'm stumped as to how to boot from one.
|
|
|
12-24-2005, 07:59 PM
|
#2
|
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187
|
Check out this thread: HOW-TO:Installing (or upgrading) fedora without a CDROM
The method should work for any iso bootable image.
If you have a bin image, check out bin2iso to convert it to an iso image. (If you need to -- GRUB might understand bin.)
|
|
|
12-24-2005, 08:59 PM
|
#3
|
Member
Registered: Nov 2005
Distribution: Ubuntu 9.10 and Slackware 13.1
Posts: 78
Original Poster
Rep:
|
Several problems with that.
First, I am trying to boot a floppy image (.img), not a cd, although the principle should be the same.
Second, and most important, the BIOS reflash disk is a DOS-based disk, not linux-based, so there are no kernel or initrd files.
Third, I don't know what the difference between an .iso and .bin is. I thought they were all just a bit-for-bit image of a disk, made with dd if=/dev/fd0 of=floppy.img.
|
|
|
12-25-2005, 09:39 AM
|
#4
|
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187
|
Ah.
Well, try putting this in your /boot/grub/grub.conf:
Code:
title Floppy
rootnoverify (fd0)
chainloader +1
Wait one: I'm going to try this with my GRUB test floppy.
Edit: OK, that works fine. Now all you need to do is point GRUB to your image file (per the method in the thread). The key s the rootnoverify and chainloader +1 which tell GRUB to use the boot information from the image and loader.
In fact, I'm going to copy my test floppy (which, by the way, is a MSDOS formatted disk) to a HD, and see if I can get it to work from the image.
Last edited by PTrenholme; 12-25-2005 at 09:50 AM.
|
|
|
12-25-2005, 11:13 AM
|
#5
|
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187
|
Well, that didn't work.
I guess it's not so easy.  That set of GRUB code boots fine from a real floppy, but I can't get an image to work. Yet.
But now I have to go play Santa for the grand-kids of my wife will get really upset.
Later. I hope.
|
|
|
12-25-2005, 05:01 PM
|
#6
|
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187
|
OK, here's something that seemed to almost work:
Code:
$ dd if=/dev/fd0 of=/var/share/z/bootfloppy.img # Copy of a bootable floppy
Code:
title Boot from Floppy Image
root (hd4)
chainloader (hd4,0)/bootfloppy.img
where /var/share/z is my 5th hd (which happens to be a vfat drive, but that's probably not necessary).
I'm not, actually, sure that the root (hd4) command is needed, but I haven't (yet) tried it without that line.
Now, note that I said " almost work" in the first line. The floppy I copied is my GRUB boot floppy, and, when I ran the GRUB commands, I got , and then a frozen system. I suspect that I need to be more careful in the dd command, because the file block list for bootflopy.img does not appear to be a contiguous set of blocks, and (again, I suspect) the loader is not finding "stage 1" where it expects it to be found.
Hopefully, the image with which you're working is a more carefully constructed image.
Give it a shot, and let us kow it it hits the target for you. 
|
|
|
12-26-2005, 09:37 AM
|
#7
|
Senior Member
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Rep: 
|
Why not use Grub itself?
You can put Grub's stage1 and stage2 in a bootable Fat32 partition, say it is in hda2, and store it in a directory /boot/grub. In the link I provided later (on BSD & Solaris systems) I used Win98 to host Grub. Boot a Live CD up, invoke a Grub shell by typing
and then install Grub in MBR by
Code:
root (hd0,1)
setup (hd0)
The above effectively asks Grub to use hda2 stage1 and stage2 files to set itself up in the MBR so that you can boot to a Grub prompt. In Grub prompt you can boot any system manually.
You can automate your booting by writing a menu.lst stored inside /boot/grub and Grub will follow it.
In a Grub prompt one can boot 100+ systems
How you arrange Grub to boot whatever image you have becomes a secondary matter.
The primary objective is to have Grub available first.
|
|
|
12-26-2005, 01:31 PM
|
#8
|
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187
|
Quote:
Originally Posted by saikee
Why not use Grub itself?
[snip]
|
Yes, that's fine, but his ( ninjabob7's) problem is that he needs to "flash" his BIOS, but doesn't have a floppy drive from which to run the "flash" program he's downloaded from his BIOS vendor. We're trying to get GRUB to boot from a copy of a bootable disk stored on a hard drive.
As an aside, my local CompUSA store sells floppy drives in the $10-20 range, and they're even less at the local computer parts recycler.
Hum, here's a thought: Why not install dosbox, and have it boot the image for you? I think that might be possible, but I've never tried it.
Of course, "flashing" the BIOS when the system is running can, potentially, cause severe problem if the running system has stored BIOS access addresses which are changed by the "flash."
|
|
|
12-26-2005, 02:04 PM
|
#9
|
Senior Member
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Rep: 
|
(1) I don't have a misconception of thinking a Grub prompt must come from a floppy
(2) I suggested Grub to be sourced from a Live CD in my advice.
|
|
|
12-26-2005, 02:56 PM
|
#10
|
Senior Member
Registered: Feb 2003
Location: Calif, USA
Distribution: PCLINUXOS
Posts: 2,918
Rep: 
|
Perhaps add the flash program to a floppy image from bootdisk.com and burn it to CD as the boot image?
|
|
|
12-26-2005, 04:32 PM
|
#11
|
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187
|
Quote:
Originally Posted by saikee
(1) I don't have a misconception of thinking a Grub prompt must come from a floppy
(2) I suggested Grub to be sourced from a Live CD in my advice.
|
I think you still don't get it. He's got GRUB running fine on his system now, and doesn't need to get it from anywhere. What he need is to boot from a (probably) MSDOS floppy containing his new BIOS settings. He does not have a working floppy drive. He therefore wants GRUB to boot his system from the HD image of the (probably) MSDOS disk which, when started, will upgrade his BIOS.
So, do you have any suggestion which might help him upgrade his BIOS?
Oh, a question for injabob7: Who is your mother board vendor? (I ask because my board is an Asus, and Asus has a system that can update a BIOS over the web.  , so there may be other options available to you for BIOS upgrade.)
|
|
|
12-26-2005, 04:41 PM
|
#12
|
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187
|
Quote:
Originally Posted by 2damncommon
Perhaps add the flash program to a floppy image from bootdisk.com and burn it to CD as the boot image?
|
Now that might just work. Ninjabob7, do you have a working CD burner? It might suffice just to mount the floppy image using the loopback device, put FREEDOS or Win98 on a bootable CD with the floppy contents, boot to a DOS prompt, and start the program from the floppy. (I'm assuming the floppy image contains a DOS program with an AUTOEXEC.BAT file to start it running.)
|
|
|
12-26-2005, 05:02 PM
|
#13
|
Member
Registered: Nov 2005
Distribution: Ubuntu 9.10 and Slackware 13.1
Posts: 78
Original Poster
Rep:
|
OK. First thing you should know is that I realized that the BIOS upgrade was actually the one I already had. However, I would still like to figure out how to boot from the floppy. Second, how do I find out the motherboard? I just discovered something called LinuxBIOS, but don't know if it's compatible with my computer. The computer is a Dell Precision 410. The BIOS doesn't seem to be Phoenix, Award, or anything else. It looks like a custom Dell-made BIOS. I just installed a CD burner today, and it works with K3B from Linux (haven't installed Windows drivers yet). I am using Windows 2000 if that matters, but I have it on a FAT partition. The liveCDs I currently have are:
Knoppix (several versions, newest 4.0.2)
Kanotix 2005-03 (based on Knoppix)
Puppy 1.0.6
FreeDOS
PCLinuxOS 9.1
I'll try that chainloader bit in GRUB, but I don't think it will work. Chainloader (I think) is supposed to execute a piece of code like you'd find in the MBR. What would need to happen, most likely, is to mount the image as a virtual floppy drive and then boot from it. I don't know how you'd do that, though. GRUB probably isn't the way to go.
Once I had this weird version of GRUB that ran under Windows 2000/XP/NT. It came with a mini-version of Windows 3.1. The commands looked something like this (I think):
title Windows 3.1 from floppy image (just for fun...)
kernel (hd0,0)/boot/memdisk
initrd (hd0,0)/boot/win311.img
However, I don't think that was actually a working floppy image, because copying it to an actual floppy and booting it didn't work. Maybe memdisk was the MBR of the floppy?? Anyway, I'll post again once I try these two things.
Edit: Okay, the chainloader method looks like it started booting, then the disk gave this message:
I/O Error: Insert another disk
The kernel=mbr initrd=.img method also failed. GRUB gave a message about not fitting the kernel in memory or something. Which is strange, since it should only be 512 bytes. (dd if=/dev/loop0 of=mbr.bin bs=512 count=1) Maybe I read it wrong and the initrd couldn't fit in memory. Should I gzip it?
Last edited by ninjabob7; 12-26-2005 at 05:20 PM.
|
|
|
12-26-2005, 08:02 PM
|
#14
|
Senior Member
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Rep: 
|
Wrong question leads to wrong answers.
This got nothing to do with Grub which is a "boot loader". The Bios updating program isn't a system.
Is this what you after?
|
|
|
12-26-2005, 08:27 PM
|
#15
|
Member
Registered: Nov 2005
Distribution: Ubuntu 9.10 and Slackware 13.1
Posts: 78
Original Poster
Rep:
|
No. If you paid attention, you would see that I'm trying to boot from a floppy image using GRUB. You would also see that I'm not trying to update my BIOS anymore. I just want to boot the image.
Also, where can I get the GRUB image you're using? It might help me to be on the same page.
|
|
|
All times are GMT -5. The time now is 08:45 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|