[Top][All Lists]

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

Re: [Not a bug] [From help-grub] Problems creating a boot floppy image

From: Felix Zielcke
Subject: Re: [Not a bug] [From help-grub] Problems creating a boot floppy image
Date: Wed, 10 Jun 2009 14:30:43 +0200

Am Mittwoch, den 10.06.2009, 14:28 +1000 schrieb David Lindsay:
> [ I thought I'd copy my post from help-grub over in case anyone here
> can shed some light on my problem. If this isn't good etiquette,
> please do tell me! ]

Hm maybe I should subscribe to help-grub.
bug-grub is actually for reporting bugs inside GRUB, actually only GRUB
2 now. We don't accept anymore bug reports for GRUB-legacy.

> 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 read the source correctly, ext2/ext3/ext4 stores the superblock
after 1024 byte so this should work.
But you just can't rely that the first 1024 bytes of a filesystem is
unused. For example with FAT this just isn't possible.

grub2 has a grub-mkrescue script to generate floppy and cd images and
you can use --overlay to include custom files.
But with the floppy image they get embed to the grub2 image itself, so
only grub can access them. There is no filesystem in the floppy image.
Felix Zielcke

reply via email to

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