problem with "mkdosfs"

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
Seven11
Member
Member
Posts: 25
Joined: Mon Oct 30, 2006 12:48 pm

problem with "mkdosfs"

Post 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]
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post 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)
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Seven11
Member
Member
Posts: 25
Joined: Mon Oct 30, 2006 12:48 pm

Post 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?
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post 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)
Attachments
fat-img.tar.gz
(1.7 KiB) Downloaded 111 times
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
Seven11
Member
Member
Posts: 25
Joined: Mon Oct 30, 2006 12:48 pm

Post by Seven11 »

alright I solved it using wine to emulate my old DOS FAT image file creator :D
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post 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:
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
Post Reply