Checks the volume label from the root directory entry that is valid and
matches the label stored in boot sector.
Add new command line option -U which consider lowercase volume label as
invalid and allows only uppercase labels. By default lowercase volume
labels are allowed.
This patch tries to fix infamous fsck.fat error:
Both FATs appear to be corrupt. Giving up.
It just fill again FAT media type and sets other bits to one as it is
required by FAT specification. Similar thing is doing also Windows chkdsk
tool.
In the most cases corrupted first FAT cluster is fatal error which
indicates totally corrupted filesystem impossible to repair. So fixing
first FAT cluster is not done by fsck.fat automatically and needs to be
enabled by a new -F option, which forces usage of specified FAT table
(either clean or corrupted).
This change makes fsck.fat check whether "." and ".." entries exist in
all non-root directories as the two very first. If those entries are
occupied by some other file, fsck.fat will offer to move them to some
later slot. "." and ".." entries found in any other slots are treated
as ordinary bad-shortname entries. The test case for this situation has
been enabled and verified to perform as expected.
The function drop_file() was also modified so that it does not mark
dropped file clusters as free. This was necessary because otherwise
dropping too-late "." and ".." entries would delete their containing
directory. If deleted entries' clusters are truly no longer used, they
shall be picked up by a later reclamation stage.
Additionally, subdirs() and check_file() were modified not to check
unused directory entries.
Additionally-fixed-by: Dave Odell <dmo2118@gmail.com>
To emphasize use italic font style instead of putting word into two
apostrophes. Ascii apostrophe in troff manpage language means "right single
quotation mark", therefore putting word into two apostrophes is fully
wrong.
Also arguments and file names should be formatted in italic.
It is needed only for non-removable disks used on Microsoft Windows systems
and only when formatting whole unpartitioned disk.
Also some removable USB flash disks accessed via USB Mass Storage declares
themselves as non-removable and Microsoft Windows systems do not recognize
them without MBR partition table and MBR disk signature.
Because MBR sector and first FAT sector are very similar (starts with
boot code, ends with boot sign 0xAA55) they can live together at one
sector. Moreover location of the MBR partition table overlaps only with the
end of FAT boot code where is just place for the error message, it is
possible to fill (fake) MBR partition table with one partition which refers
to whole disk itself (starts at sector 0 and spans whole disk).
Similar thing is doing mformat (FAT12/16/32 formatting tool) from mtools
project or mkudffs (UDF formatting tool) from udftools project.
According to Microsoft FAT specification "fatgen103.doc" there are
following restrictions for FAT label stored in root directory:
* DIR_Name[0] may not equal 0x20.
* Lower case characters are not allowed in DIR_Name (what these characters
are is country specific).
* The following characters are not legal in any bytes of DIR_Name:
- Values less than 0x20 except for the special case of 0x05 in
DIR_Name[0]
- 0x22, 0x2A, 0x2B, 0x2C, 0x2E, 0x2F, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
0x5B, 0x5C, 0x5D, and 0x7C
And another Microsoft "FAT32 Spec (SDA Contribution).pdf" describe:
* DIR_Name[0] cannot equal 0x20 (in other words, names cannot start with a
space character).
FAT label in both boot sector and root directory is stored according to
current OEM code page. Microsoft Windows system treat FAT label really in
this way. In most cases OEM code page is just 8bit extension of the
printable ASCII, therefore for ASCII-only labels there is no change.
By default OEM code page 850 is used which contains most of the characters
that are also available in ISO-8859-1. Same default which is used by
fsck.fat and mlabel (from mtools project).
The reason for change is that 850 is more common on Windowes and used by
more regions as 437. Also it contains most of the characters that are also
available in ISO-8859-1. And 850 is also default DOS code page used by
mtools, which is used on Linux.
When given the new -i or --volume-id option, fatlabel will display or
change the volume ID (serial number) instead of the volume label. The ID
is displayed as an 8 digit hexadecimal number, when changing it must
also be given as a hexadecimal number that fits within 32 bits.
Fixes#52
Signed-off-by: Andreas Bombe <aeb@debian.org>
TYPE can be 'standard' or 'atari' (case insensitive) to select the
desired mode rather than having to toggle with -A.
Signed-off-by: Andreas Bombe <aeb@debian.org>
Acknowledge that image files can be used in place of device files.
Remove mentions of "under Linux" since it has been portable for a while.
Signed-off-by: Andreas Bombe <aeb@debian.org>
The -A option doesn't turn on (or turn off) Atari format selection, it
toggles it with every occurrence. Change wording in the man pages to
reflect that.
Also mention that automatic selection can happen only on 68k Atari Linux
in the man pages and the --enable-atari-check option help in
configure.ac.
Signed-off-by: Andreas Bombe <aeb@debian.org>
The symlinks from the old names (mkdosfs, dosfsck, etc.) are now only
created on "make install" when the --enable-compat-symlinks option was
given to configure.
Signed-off-by: Andreas Bombe <aeb@debian.org>
In preparation for fixing the horribly outdated and broken device
checking - which will likely involve using additional libraries like
libblkid - as well as making this package portable to other operating
systems, the build system is now the tried and true autoconf/automake
combination which should make both goals a little more straightforward.
The release version number and date are now in configure.ac and
substituted by configure where they are needed. Now it is no longer
necessary to change the number in multiple places for a release and the
man pages get the number substituted directly into them, making the
update-version.sh script and the VERSION file obsolete.
The English man pages are moved back up one directory to mark their
status as the master copy for all translations. At the moment the po4a
translation infrastructure is defunct since it isn't integrated into
the automake environment yet. So far it hasn't been used, so that is
not an actual regression.
The date in the man pages is not automatically updated anymore. This is
as it should be, since the date is supposed to signify the time of the
last nontrivial change and not the release date of the software.
Signed-off-by: Andreas Bombe <aeb@debian.org>
Make the manpages conform to the rules for groff sources. First,
eliminate empty lines because these create vertical spaces where it
isn't desired. Man page sources should not contain empty lines. Second,
put a line break between sentences in a paragraph. A period is
recognized and formatted as a full stop period only when a line break
comes right after it.
Signed-off-by: Andreas Bombe <aeb@debian.org>