1 ==== 2 VFAT 3 ==== 4 5 USING VFAT 6 ========== 7 8 To use the vfat filesystem, use the filesystem 9 10 mount -t vfat /dev/fd0 /mnt 11 12 13 No special partition formatter is required, 14 'mkdosfs' will work fine if you want to format 15 16 VFAT MOUNT OPTIONS 17 ================== 18 19 **uid=###** 20 Set the owner of all files on this fil 21 The default is the uid of current proc 22 23 **gid=###** 24 Set the group of all files on this fil 25 The default is the gid of current proc 26 27 **umask=###** 28 The permission mask (for files and dir 29 The default is the umask of current pr 30 31 **dmask=###** 32 The permission mask for the directory. 33 The default is the umask of current pr 34 35 **fmask=###** 36 The permission mask for files. 37 The default is the umask of current pr 38 39 **allow_utime=###** 40 This option controls the permission ch 41 42 **-20**: If current process is 43 you can change timestamp. 44 45 **-2**: Other users can change 46 47 The default is set from dmask option. 48 writable, utime(2) is also allowed. i. 49 50 Normally utime(2) checks current proce 51 the file, or it has CAP_FOWNER capabil 52 filesystem doesn't have uid/gid on dis 53 check is too inflexible. With this opt 54 relax it. 55 56 **codepage=###** 57 Sets the codepage number for convertin 58 characters on FAT filesystem. 59 By default, FAT_DEFAULT_CODEPAGE setti 60 61 **iocharset=<name>** 62 Character set to use for converting be 63 encoding is used for user visible file 64 Unicode characters. Long filenames are 65 in Unicode format, but Unix for the mo 66 know how to deal with Unicode. 67 By default, FAT_DEFAULT_IOCHARSET sett 68 69 There is also an option of doing UTF-8 70 with the utf8 option. 71 72 .. note:: ``iocharset=utf8`` is not recommende 73 the utf8 option instead. 74 75 **utf8=<bool>** 76 UTF-8 is the filesystem safe version o 77 is used by the console. It can be enab 78 for the filesystem with this option. 79 If 'uni_xlate' gets set, UTF-8 gets di 80 By default, FAT_DEFAULT_UTF8 setting i 81 82 **uni_xlate=<bool>** 83 Translate unhandled Unicode characters 84 escaped sequences. This would let you 85 restore filenames that are created wit 86 characters. Until Linux supports Unic 87 this gives you an alternative. Withou 88 a '?' is used when no translation is p 89 escape character is ':' because it is 90 illegal on the vfat filesystem. The e 91 that gets used is ':' and the four dig 92 unicode. 93 94 **nonumtail=<bool>** 95 When creating 8.3 aliases, normally th 96 end in '~1' or tilde followed by some 97 option is set, then if the filename is 98 "longfilename.txt" and "longfile.txt" 99 currently exist in the directory, long 100 be the short alias instead of longfi~1 101 102 **usefree** 103 Use the "free clusters" value stored o 104 be used to determine number of free cl 105 scanning disk. But it's not used by de 106 recent Windows don't update it correct 107 case. If you are sure the "free cluste 108 correct, by this option you can avoid 109 110 **quiet** 111 Stops printing certain warning message 112 113 **check=s|r|n** 114 Case sensitivity checking setting. 115 116 **s**: strict, case sensitive 117 118 **r**: relaxed, case insensitive 119 120 **n**: normal, default setting, curren 121 122 **nocase** 123 This was deprecated for vfat. Use ``sh 124 125 **shortname=lower|win95|winnt|mixed** 126 Shortname display/create setting. 127 128 **lower**: convert to lowercase for di 129 emulate the Windows 95 rule for create 130 131 **win95**: emulate the Windows 95 rule 132 133 **winnt**: emulate the Windows NT rule 134 135 **mixed**: emulate the Windows NT rule 136 emulate the Windows 95 rule for create 137 138 Default setting is `mixed`. 139 140 **tz=UTC** 141 Interpret timestamps as UTC rather tha 142 This option disables the conversion of 143 between local time (as used by Windows 144 (which Linux uses internally). This i 145 useful when mounting devices (like dig 146 that are set to UTC in order to avoid 147 local time. 148 149 **time_offset=minutes** 150 Set offset for conversion of timestamp 151 used by FAT to UTC. I.e. <minutes> min 152 from each timestamp to convert it to U 153 Linux. This is useful when time zone s 154 not the time zone used by the filesyst 155 option still does not provide correct 156 cases in presence of DST - time stamps 157 setting will be off by one hour. 158 159 **showexec** 160 If set, the execute permission bits of 161 allowed only if the extension part of 162 .COM, or .BAT. Not set by default. 163 164 **debug** 165 Can be set, but unused by the current 166 167 **sys_immutable** 168 If set, ATTR_SYS attribute on FAT is h 169 IMMUTABLE flag on Linux. Not set by de 170 171 **flush** 172 If set, the filesystem will try to flu 173 early than normal. Not set by default. 174 175 **rodir** 176 FAT has the ATTR_RO (read-only) attrib 177 the ATTR_RO of the directory will just 178 and is used only by applications as a 179 for the customized folder). 180 181 If you want to use ATTR_RO as read-onl 182 the directory, set this option. 183 184 **errors=panic|continue|remount-ro** 185 specify FAT behavior on critical error 186 without doing anything or remount the 187 read-only mode (default behavior). 188 189 **discard** 190 If set, issues discard/TRIM commands t 191 device when blocks are freed. This is 192 and sparse/thinly-provisioned LUNs. 193 194 **nfs=stale_rw|nostale_ro** 195 Enable this only if you want to export 196 over NFS. 197 198 **stale_rw**: This option main 199 *inodes* by *i_logstart* which 200 improve look-ups. Full file op 201 supported but with cache evict 202 result in ESTALE issues. 203 204 **nostale_ro**: This option ba 205 on the on-disk location of a f 206 This ensures that ESTALE will 207 evicted from the inode cache. 208 such as rename, create and unl 209 previously pointed at one file 210 potentially causing data corru 211 option also mounts the filesys 212 213 To maintain backward compatibility, `` 214 defaulting to "stale_rw". 215 216 **dos1xfloppy <bool>: 0,1,yes,no,true,false** 217 If set, use a fallback default BIOS Pa 218 configuration, determined by backing d 219 parameters match defaults assumed by D 220 180 kiB, 320 kiB, and 360 kiB floppies 221 222 223 224 LIMITATION 225 ========== 226 227 The fallocated region of file is discarded at 228 when using fallocate with FALLOC_FL_KEEP_SIZE. 229 So, User should assume that fallocated region 230 last close if there is memory pressure resulti 231 the inode from the memory. As a result, for an 232 the fallocated region, user should make sure t 233 after reopening the file. 234 235 TODO 236 ==== 237 Need to get rid of the raw scanning stuff. In 238 a get next directory entry approach. The only 239 raw scanning is the directory renaming code. 240 241 242 POSSIBLE PROBLEMS 243 ================= 244 245 - vfat_valid_longname does not properly checke 246 - When a volume name is the same as a director 247 directory of the filesystem, the directory n 248 up as an empty file. 249 - autoconv option does not work correctly. 250 251 252 TEST SUITE 253 ========== 254 If you plan to make any modifications to the v 255 get the test suite that comes with the vfat di 256 257 `<http://web.archive.org/web/*/http://bmrc.ber 258 259 This tests quite a few parts of the vfat files 260 tests for new features or untested features wo 261 262 NOTES ON THE STRUCTURE OF THE VFAT FILESYSTEM 263 ============================================= 264 This documentation was provided by Galen C. Hu 265 lightly annotated by Gordon Chaffee. 266 267 This document presents a very rough, technical 268 knowledge of the extended FAT file system used 269 Windows 95. I don't guarantee that any of the 270 but it appears to be so. 271 272 The extended FAT file system is almost identic 273 file system used in DOS versions up to and inc 274 :-). The significant change has been the addi 275 These names support up to 255 characters inclu 276 case characters as opposed to the traditional 277 278 Here is the description of the traditional FAT 279 Windows 95 filesystem:: 280 281 struct directory { // Short 8.3 names 282 unsigned char name[8]; 283 unsigned char ext[3]; 284 unsigned char attr; 285 unsigned char lcase; 286 unsigned char ctime_ms; 287 unsigned char ctime[2]; 288 unsigned char cdate[2]; 289 unsigned char adate[2]; 290 unsigned char reserved[2]; 291 unsigned char time[2]; 292 unsigned char date[2]; 293 unsigned char start[2]; 294 unsigned char size[4]; 295 }; 296 297 298 The lcase field specifies if the base and/or t 299 name should be capitalized. This field does n 300 Windows 95 but it is used by Windows NT. The 301 completely compatible from Windows NT to Windo 302 compatible in the reverse direction, however. 303 the 8.3 namespace and are written on Windows N 304 show up as uppercase on Windows 95. 305 306 .. note:: Note that the ``start`` and ``size`` 307 endian integer values. The descript 308 structure are public knowledge and c 309 310 With the extended FAT system, Microsoft has in 311 directory entries for any files with extended 312 legally fits within the old 8.3 encoding schem 313 entries.) I call these extra entries slots. 314 specially formatted directory entry which hold 315 a file's extended name. Think of slots as add 316 directory entry of the file to which they corr 317 prefers to refer to the 8.3 entry for a file a 318 extended slot directory entries as the file na 319 320 The C structure for a slot directory entry fol 321 322 struct slot { // Up to 13 characters o 323 unsigned char id; 324 unsigned char name0_4[10]; 325 unsigned char attr; 326 unsigned char reserved; 327 unsigned char alias_checksum; 328 unsigned char name5_10[12]; 329 unsigned char start[2]; 330 unsigned char name11_12[4]; 331 }; 332 333 334 If the layout of the slots looks a little odd, 335 because of Microsoft's efforts to maintain com 336 software. The slots must be disguised to prev 337 panicking. To this end, a number of measures 338 339 1) The attribute byte for a slot direc 340 to 0x0f. This corresponds to an ol 341 attributes of "hidden", "system", " 342 label". Most old software will ign 343 entries with the "volume label" bit 344 entries don't have the other three 345 346 2) The starting cluster is always set 347 value for a DOS file. 348 349 Because the extended FAT system is backward co 350 possible for old software to modify directory 351 be taken to ensure the validity of slots. An 352 verify that a slot does in fact belong to an 8 353 the following: 354 355 1) Positioning. Slots for a file alwa 356 their corresponding 8.3 directory e 357 slot has an id which marks its orde 358 name. Here is a very abbreviated v 359 entry and its corresponding long na 360 "My Big File.Extension which is lon 361 362 <proceeding files...> 363 <slot #3, id = 0x43, character 364 <slot #2, id = 0x02, character 365 <slot #1, id = 0x01, character 366 <directory entry, name = "MYBI 367 368 369 .. note:: Note that the slots are s 370 are numbered from 1 to N. 371 0x40 to mark it as the la 372 373 2) Checksum. Each slot has an alias_c 374 checksum is calculated from the 8.3 375 following algorithm:: 376 377 for (sum = i = 0; i < 11; i++) 378 sum = (((sum&1)<<7)|(( 379 } 380 381 382 3) If there is free space in the final 383 is stored after the final character 384 characters in the final slot are se 385 386 Finally, note that the extended name is stored 387 character takes either two or four bytes, UTF-
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.