Page 1 of 1

problem with "mkdosfs"

Posted: Mon Oct 30, 2006 12:58 pm
by Seven11
I have just switched from Windows XP to Mandriva Linux on my laptop and are now trying to get my old kernel to work.
I'm using dd, losetup and mkdosfs (just as the wiki explains here).
like this:
dd if=/dev/zero of=floppy.img bs=512 count=2880
losetup /dev/loop0 floppy.img
mkdosfs /dev/loop0 -F 12 -c -v
But my mkdosfs (0.4) replies:
mkdosfs: Unable to get drive geometry for '/dev/loop0'
Anybody who knows what might be wrong?

[/quote]

Posted: Mon Oct 30, 2006 2:37 pm
by Combuster
Apparently it cant get the CHS values for the floppy (or guess them) - you'll probably have to supply them manually (2 heads, 80 cylinders, 18 sectors IIRC)

Posted: Mon Oct 30, 2006 4:31 pm
by Seven11
yes I knew that... but there's no way to tell mkdosfs or losetup the CHS geometry.

Does anybody know of another way to build a FAT disk (without using the floppy) under Linux?

Posted: Mon Oct 30, 2006 5:04 pm
by Brynet-Inc
Ahh, Now I know why I love OpenBSD..8)

Code: Select all

[brynet@obox]~: $ dd if=/dev/zero of=test.img bs=512 count=2880 
[brynet@obox]~: $ sudo vnconfig svnd0 /home/brynet/test.img
[brynet@obox]~: $ sudo newfs_msdos -F 12 /dev/svnd0c
[brynet@obox]~: $ sudo mount -t msdos /dev/svnd0c /floppy
[brynet@obox]~: $ sudo umount /floppy
[brynet@obox]~: $ sudo vnconfig -u svnd0
[brynet@obox]~: $ tar zcvf fat-img.tar.gz test.img
Sorry for gloating.. :oops:

Also a neat feature in OpenBSD's newfs_msdos command is the -B flag.. (Get bootstrap from file)

Posted: Tue Oct 31, 2006 6:21 am
by Seven11
alright I solved it using wine to emulate my old DOS FAT image file creator :D

Posted: Tue Oct 31, 2006 6:32 am
by Brynet-Inc
Seven11 wrote:alright I solved it using wine to emulate my old DOS FAT image file creator :D
Shame on you.. :wink: