linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* End of FAT directories
@ 2011-04-22 18:48 Michael Karcher
  2011-04-22 18:51 ` End of FAT directories (added missing reference) Michael Karcher
  2011-04-22 20:40 ` End of FAT directories OGAWA Hirofumi
  0 siblings, 2 replies; 12+ messages in thread
From: Michael Karcher @ 2011-04-22 18:48 UTC (permalink / raw)
  To: linux kernel FAT, dosfstools, mtools; +Cc: linux-kernel

Hello Linux FAT developers and developers of related tools,

there seem to be different interpretations around how to read a FAT
directory that contains an entry starting with a NUL byte before further
entries *NOT* starting with NUL bytes. I uploaded an example image of
this type to [1]. It contains three zero-byte files "WINDOWS", "IS",
"GREAT", an empty directory slot and a file with contents named "NOT".

Listing a floppy with this directory contents in Windows gives the
output "WINDOWS", "IS" and "GREAT". Mounting the image in Linux results
in four visible files. Running dosfsck on that image outputs four files,
everything OK, while Windows CHKDSK will found one lost cluster in one
chain. mdir only lists the three files Windows will find too, but when
you copy a file that needs a long name to the image using mcopy, the
file will be appended where there are enough free slots in succession,
i.e. it will not fill the single empty slot. That means mcopy allocates
space for the file, writes a directory entry for it, but mdir does not
see it afterwards. On the other hand, as soon as you add a file that
does not need a long name entry that fills the hole, mdir shows all the
files it previously didn't show.

I'm afraid this is not a pure academic post, but I write it because I
spent hours on trying to find out why I had problem to make some USB
flash drive bootable with syslinux (which follows the MS model on
loading files while booting) after copying files with the linux kernel
(which follows the Linux model, obviously), additionally dosfsck on that
stick showed quite strange results (it dived into a directory that does
no longer exist). Another incarnation is mentioned in
https://wiki.physik.fu-berlin.de/linux-minidisc/doku.php?id=himddiskformat
in the section "Filesystem Issues with some Models on Linux". Some of
the Sony devices clear only the first half of the cluster containing
that subdirectory to zeroes, which works fine if software aborts on the
first entry being zero, but obviously makes problem if the second half
of the cluster is accessed.

I would really appreciate it if all FOSS working on FAT would agree to
one behaviour, and I think we have no choice except being MS compatible
(i.e. implement the behaviour as it has always been in DOS and Windows)

Please comment.

Regards,
  Michael Karcher


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-06-28 23:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-22 18:48 End of FAT directories Michael Karcher
2011-04-22 18:51 ` End of FAT directories (added missing reference) Michael Karcher
2011-04-22 20:40 ` End of FAT directories OGAWA Hirofumi
2011-04-22 21:56   ` Michael Karcher
2011-04-23  0:06     ` OGAWA Hirofumi
2011-04-23 11:38       ` Michael Karcher
2011-04-23 13:46         ` OGAWA Hirofumi
2011-04-28 13:25         ` Pavel Machek
2011-04-28 13:43           ` Michael Karcher
2011-04-28 15:44             ` OGAWA Hirofumi
2011-06-28 23:09               ` Alain Knaff
2011-04-28 20:51             ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).