Page 1 of 1

[SOLVED] mkfs.vfat problem

Posted: Thu Jul 09, 2015 12:07 pm
by Alex
I am searching for a way to format my floppy’s with a new FAT12 file-system.

The problem is that when i use the mkfs.vfat command like this:
  • sudo mkfs.vfat -v -I -c -D 0x00 -f 2 -F 12 -h 0 -r 224 -R 1 -s 1 -S 512 -M 0xF8 /dev/sdg 1440
the following output is:
  • mkfs.fat 3.0.26 (2014-03-07)
    /dev/sdg has 1 head and 3 sectors per track,
    hidden sectors 0x0000;
    logical sector size is 512,
    using 0xf8 media descriptor, with 2880 sectors;
    drive number 0x00;
    filesystem has 2 12-bit FATs and 1 sector per cluster.
    FAT size is 9 sectors, and provides 2847 clusters.
    There is 1 reserved sector.
    Root directory contains 224 slots and uses 14 sectors.
    Volume ID is f9d9d583, no volume label.
    Searching for bad blocks 224... 608... 864... 1264...
the problem is that it formats the floppy with 1 head and 3 sectors per track,
but a normal floppy does have 2 heads and 18 sectors per track!

When i use the comand like this to make a floppy image:
  • mkfs.vfat -v -I -c -D 0x00 -f 2 -F 12 -h 0 -r 224 -R 1 -s 1 -S 512 -M 0xF8 -C ./Floppy.img 1440
i get this output:
  • mkfs.fat 3.0.26 (2014-03-07)
    ./Floppy.img has 2 heads and 18 sectors per track,
    hidden sectors 0x0000;
    logical sector size is 512,
    using 0xf8 media descriptor, with 2880 sectors;
    drive number 0x00;
    filesystem has 2 12-bit FATs and 1 sector per cluster.
    FAT size is 9 sectors, and provides 2847 clusters.
    There is 1 reserved sector.
    Root directory contains 224 slots and uses 14 sectors.
    Volume ID is fde3c95f, no volume label.
and this is right!!!
Why is it right when i make a image and wrong when i want to format a real floppy???


I am working with Ubuntu 14.04LTS
I am using a USB-Floppy drive!

Re: mkfs.vfat problem

Posted: Thu Jul 09, 2015 2:16 pm
by Octocontrabass
Alex wrote:Why is it right when i make a image and wrong when i want to format a real floppy???
Alex wrote:I am using a USB-Floppy drive!
You answered your own question.

The heuristics in dosfstools do not recognize /dev/sdg as a floppy disk, so the floppy disk parameters aren't applied.

Re: mkfs.vfat problem

Posted: Fri Jul 10, 2015 4:42 am
by Alex
Thank you Octocontrabass. That sounds plausible.
So I have to find another way to accomplish this task.
The next way, i can think of, is to make the floppy image and "dd" it on the floppy.
I had thought there would be a simple command, that can format a floppy in a usb-floppy-drive.

Re: [SOLVED] mkfs.vfat problem

Posted: Fri Jul 10, 2015 5:03 am
by iansjack
What about mtools?