[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: mkdosfs -C ...



On 03/06/13 23:06, peasthope@shaw.ca wrote:
Hi,

mkdosfs fails in this case.

=============
root@dalton:/media/9D7C-BB83# fdisk -l /dev/sdb

Disk /dev/sdb: 257 MB, 257425408 bytes
6 heads, 26 sectors/track, 3222 cylinders
Units = cylinders of 156 * 512 = 79872 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8878a0ad

    Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              14        3223      250368    6  FAT16
root@dalton:/media/9D7C-BB83# mount | grep sdb
/dev/sdb1 on /media/9D7C-BB83 type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush)
root@dalton:/media/9D7C-BB83# mkdosfs -v -C /media/9D7C-BB83/FatFile  25
mkdosfs 3.0.9 (31 Jan 2010)
mkdosfs: unable to create /media/9D7C-BB83/FatFile
=============

In attempt understand the ouput from fdisk,
257425408/250368 = 1028 suggests that the block size is 1024 or 1028.
fdisk has no mention of such number but tells "Sector size ... 512 bytes".

What is the block size here?
Why did mkdosfs fail?

Thanks for any enlightenment or ideas,           ... Peter E.


Peter

Not sure about the main question of why mkdosfs failed, I tried to replicate the situation on a spare USB stick and it just works. That said, I didn't understand why you used the -"C" option in this case instead of just giving the device name ?

The units reported by fdisk keep confusing me too. I made myself a little spread sheet to aid my memory :^)

Each cylinder is nominally divided into tracks that are read by 1 head each. Each track is divided into sectors, and these sectors contain a number of bytes. Going upwards in size now: In your case the sector size is 512 bytes, you've got 26 sectors per head and 6 heads per cylinder. 26*6=156 sectors per cylinder, 26*6*512=79872 bytes per cylinder. Now, to make it even more confusing, cylinders sometimes seem to be counted from zero. In your case, the total 257425408 bytes divided by 79872 bytes per cylinder yields 3223 cylinders per disk, not 3222 as fdisk -l displays. Note that partition sdb1 doesn't start at the very beginning of the disk, and the 250368 blocks of 1024 bytes each make up only 256376832 bytes.


--
Klaus


Reply to: