GRUB howto

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
purevoid

GRUB howto

Post by purevoid »

Hi,

How do I make a GRUB floppy that's formatted with ext2 file system?

Linux is giving me troubles -- mke2fs floppy.img doesn't seem to give me a floppy image with ext2fs, or at least can't be mounted on loopback with mount command.

I need a FS that supports longer filenames than fat12 =/

Jonathan
JoeKayzA

Re:GRUB howto

Post by JoeKayzA »

Hi!

First of all, is the file floppy.img present before you issue the mke2fs command?

If not (which is what I guess), mke2fs doesn't know the size of the image you want to create and therefore probably uses the smallest possible size.

So, what you need to do is:

Code: Select all

dd if=/dev/zero of=floppy.img count=2880
mke2fs floppy.img
Then you'll get a ready-to-mount ext2-floppy-image

cheers Joe
purevoid

Re:GRUB howto

Post by purevoid »

Turns out -o loop,uid=blah doesn't work for ext2fs. Shame it doesn't tell you that!

Jonathan
Enlight

Re:GRUB howto

Post by Enlight »

Shame you're making false assomptions!

using -o loop works when the fs starts at the begining of the file.

I never tried with floppy disks so I don't know the offset, but when I mount as a loop a false disk image that I created I do it this way :

1) DOS geometry of the disk

SECTORS=63 # only valid value I know about
SIZE_OF_SECTORS=512 # valids are 512, 1024 and 2048
OFFSET=(( $SECTORS * $SIZE_OF_SECTORS )) # where the first partition starts : 1st sector of the 2nd cylinder of the 1st "disk"

losetup -o $OFFSET /dev/loop0 $my_image.img
mount /dev/loop0 $my_mount_point

so for a floppy, try with a 512 offset or maybe a multiple
purevoid

Re:GRUB howto

Post by purevoid »

Err, the uid part of -o loop doesn't work with ext2. just -o loop works fine -- that's what I was meant to say, sorry.
Enlight

Re:GRUB howto

Post by Enlight »

Oh yeah there is no uid specific option but that is in man (8) mount, but what were you expecting that can't be down using chmod and chown?
Post Reply