Page 1 of 1
GRUB howto
Posted: Mon Dec 26, 2005 4:44 am
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
Re:GRUB howto
Posted: Mon Dec 26, 2005 11:22 am
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
Re:GRUB howto
Posted: Mon Dec 26, 2005 10:30 pm
by purevoid
Turns out -o loop,uid=blah doesn't work for ext2fs. Shame it doesn't tell you that!
Jonathan
Re:GRUB howto
Posted: Wed Dec 28, 2005 7:12 am
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
Re:GRUB howto
Posted: Wed Dec 28, 2005 7:15 am
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.
Re:GRUB howto
Posted: Wed Dec 28, 2005 9:01 am
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?