FAT16 root filesystem limited to 255 entries

Bug #613656 reported by msonst
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
hal-info (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: hal-info

Hi,
there seems to be a problem to handle more than 255 files in a FAT16 SD card root directory.

Using this script:
<code>
#!/bin/bash
for i in $(seq 1 1 403)
do
  dd if=/media/8129-4A70/0.bin of=/media/8129-4A70/$i.bin
done
</code>

I fill my 2gig SD card with copies of 0.bin (5120000Bytes). At 255 dd stops and displays that there is not enough space left.
Message:
dd: öffne „/media/8129-4A70/<number>.bin“: No space left on device

As you can see, the card is empty before.

df -h before filling card:
Dateisystem Größe Benut Verf Ben% Eingehängt auf
/dev/mmcblk0p1 1,9G 5,2M 1,9G 1% /media/8129-4A70

If I use df after the no space message you can see that there is 32% blank space left on the device. (Enough memory for about 100 further copies)

df -h after filling card:
Dateisystem Größe Benut Verf Ben% Eingehängt auf
/dev/mmcblk0p1 1,9G 1,3G 619M 68% /media/8129-4A70

I tried to do the same in a subdirectory. Result is: 403 successfull copies and all free space is used!
Trying to copy those new files to the root directory brought the error message again.

As far as I know the FAT16 spec. defines 512 entries in root directory. So there might be an error.

SD Card Controller: SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22) (lspci)
SD Card: SD 2Gig Sandisk
Mainboard: F3Sa (Asus)
Ubuntu:
Lucid (Linux <user> 2.6.32-24-generic #38-Ubuntu SMP Mon Jul 5 09:22:14 UTC 2010 i686 GNU/Linux)
Description: Ubuntu 10.04.1 LTS
Release: 10.0

Kind regards
Michael Sonst

msonst (focus01)
description: updated
Revision history for this message
Mechanical snail (replicator-snail) wrote :

According to Wikipedia, "The number of root directory entries available is determined when the volume is formatted", so perhaps the manufacturer formatted the card with only 256 entries.

If this is the case, it's not a bug in Ubuntu. If reformatting doesn't help, then please re-open this bug.

Changed in hal-info (Ubuntu):
status: New → Invalid
Revision history for this message
Mechanical snail (replicator-snail) wrote :

...or if Windows lets you add more files to the root.

Revision history for this message
msonst (focus01) wrote :

Hi,
under Windows it is possible to put approx. 100 files more in the root directory. I've already reformatted the card under Ubuntu.

Michael

Changed in hal-info (Ubuntu):
status: Invalid → New
Revision history for this message
msonst (focus01) wrote :

... I also used a (Win formatted) card with the same effect to cross check it.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.