[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems creating a boot floppy image

From: David Lindsay
Subject: Problems creating a boot floppy image
Date: Wed, 10 Jun 2009 14:20:16 +1000

Hey there.

I'm trying to create a GRUB floppy disk image (without using a real
floppy disk) but I'm not getting very far.

I don't know how to use GRUB itself to install to a disk image so I've
been trying to use dd.

This is what I've been doing:

1. qemu-img create floppy.img 1440
2. mkfs -t msdos floppy.img (or 'mkfs -t ext2 floppy.img')
> 'file' reports that it's a filesystem
> image will mount at this point (with a loopback device of course)
3. dd if=stage1 of=floppy.img bs=512 conv=notrunc count=1
> 'file' says "x86 boot sector; GRand Unified Bootloader, stage1 version 0x3"
> With FAT, image becomes unmountable (mount asks for fs type and complains 
> that it's not a valid FAT FS if I hand it '-t msdos', dmesg says "bogus 
> number of reserved sectors")
> With ext2 the image will still mount
4. dd if=stage2 of=floppy.img bs=512 conv=notrunc seek=1
> With ext2 the image will fail to mount at this point

After completing all 4 steps I can boot the disk image in QEMU and get
a GRUB prompt, but I can't do much more since the disk doesn't have a
valid filesystem on it!

If I replace 'stage2' with 'e2fs_stage1_5' I just get repeated 'GRUB
GRUB GRUB GRUB GRUB GRUB [...]' ad infinitum, both when I use
'count=1' or omit the count parameter. Since I'd expect to see
"loading stage1_5..." at this point I think that stage2 being on the
filesystem (or there being a filesystem at all) is negligible.

Any help will be appreciated! :)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]