affs.rst 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. .. SPDX-License-Identifier: GPL-2.0
  2. =============================
  3. Overview of Amiga Filesystems
  4. =============================
  5. Not all varieties of the Amiga filesystems are supported for reading and
  6. writing. The Amiga currently knows six different filesystems:
  7. ============== ===============================================================
  8. DOS\0 The old or original filesystem, not really suited for
  9. hard disks and normally not used on them, either.
  10. Supported read/write.
  11. DOS\1 The original Fast File System. Supported read/write.
  12. DOS\2 The old "international" filesystem. International means that
  13. a bug has been fixed so that accented ("international") letters
  14. in file names are case-insensitive, as they ought to be.
  15. Supported read/write.
  16. DOS\3 The "international" Fast File System. Supported read/write.
  17. DOS\4 The original filesystem with directory cache. The directory
  18. cache speeds up directory accesses on floppies considerably,
  19. but slows down file creation/deletion. Doesn't make much
  20. sense on hard disks. Supported read only.
  21. DOS\5 The Fast File System with directory cache. Supported read only.
  22. ============== ===============================================================
  23. All of the above filesystems allow block sizes from 512 to 32K bytes.
  24. Supported block sizes are: 512, 1024, 2048 and 4096 bytes. Larger blocks
  25. speed up almost everything at the expense of wasted disk space. The speed
  26. gain above 4K seems not really worth the price, so you don't lose too
  27. much here, either.
  28. The muFS (multi user File System) equivalents of the above file systems
  29. are supported, too.
  30. Mount options for the AFFS
  31. ==========================
  32. protect
  33. If this option is set, the protection bits cannot be altered.
  34. setuid[=uid]
  35. This sets the owner of all files and directories in the file
  36. system to uid or the uid of the current user, respectively.
  37. setgid[=gid]
  38. Same as above, but for gid.
  39. mode=mode
  40. Sets the mode flags to the given (octal) value, regardless
  41. of the original permissions. Directories will get an x
  42. permission if the corresponding r bit is set.
  43. This is useful since most of the plain AmigaOS files
  44. will map to 600.
  45. nofilenametruncate
  46. The file system will return an error when filename exceeds
  47. standard maximum filename length (30 characters).
  48. reserved=num
  49. Sets the number of reserved blocks at the start of the
  50. partition to num. You should never need this option.
  51. Default is 2.
  52. root=block
  53. Sets the block number of the root block. This should never
  54. be necessary.
  55. bs=blksize
  56. Sets the blocksize to blksize. Valid block sizes are 512,
  57. 1024, 2048 and 4096. Like the root option, this should
  58. never be necessary, as the affs can figure it out itself.
  59. quiet
  60. The file system will not return an error for disallowed
  61. mode changes.
  62. verbose
  63. The volume name, file system type and block size will
  64. be written to the syslog when the filesystem is mounted.
  65. mufs
  66. The filesystem is really a muFS, also it doesn't
  67. identify itself as one. This option is necessary if
  68. the filesystem wasn't formatted as muFS, but is used
  69. as one.
  70. prefix=path
  71. Path will be prefixed to every absolute path name of
  72. symbolic links on an AFFS partition. Default = "/".
  73. (See below.)
  74. volume=name
  75. When symbolic links with an absolute path are created
  76. on an AFFS partition, name will be prepended as the
  77. volume name. Default = "" (empty string).
  78. (See below.)
  79. Handling of the Users/Groups and protection flags
  80. =================================================
  81. Amiga -> Linux:
  82. The Amiga protection flags RWEDRWEDHSPARWED are handled as follows:
  83. - R maps to r for user, group and others. On directories, R implies x.
  84. - W maps to w.
  85. - E maps to x.
  86. - D is ignored.
  87. - H, S and P are always retained and ignored under Linux.
  88. - A is cleared when a file is written to.
  89. User id and group id will be used unless set[gu]id are given as mount
  90. options. Since most of the Amiga file systems are single user systems
  91. they will be owned by root. The root directory (the mount point) of the
  92. Amiga filesystem will be owned by the user who actually mounts the
  93. filesystem (the root directory doesn't have uid/gid fields).
  94. Linux -> Amiga:
  95. The Linux rwxrwxrwx file mode is handled as follows:
  96. - r permission will allow R for user, group and others.
  97. - w permission will allow W for user, group and others.
  98. - x permission of the user will allow E for plain files.
  99. - D will be allowed for user, group and others.
  100. - All other flags (suid, sgid, ...) are ignored and will
  101. not be retained.
  102. Newly created files and directories will get the user and group ID
  103. of the current user and a mode according to the umask.
  104. Symbolic links
  105. ==============
  106. Although the Amiga and Linux file systems resemble each other, there
  107. are some, not always subtle, differences. One of them becomes apparent
  108. with symbolic links. While Linux has a file system with exactly one
  109. root directory, the Amiga has a separate root directory for each
  110. file system (for example, partition, floppy disk, ...). With the Amiga,
  111. these entities are called "volumes". They have symbolic names which
  112. can be used to access them. Thus, symbolic links can point to a
  113. different volume. AFFS turns the volume name into a directory name
  114. and prepends the prefix path (see prefix option) to it.
  115. Example:
  116. You mount all your Amiga partitions under /amiga/<volume> (where
  117. <volume> is the name of the volume), and you give the option
  118. "prefix=/amiga/" when mounting all your AFFS partitions. (They
  119. might be "User", "WB" and "Graphics", the mount points /amiga/User,
  120. /amiga/WB and /amiga/Graphics). A symbolic link referring to
  121. "User:sc/include/dos/dos.h" will be followed to
  122. "/amiga/User/sc/include/dos/dos.h".
  123. Examples
  124. ========
  125. Command line::
  126. mount Archive/Amiga/Workbench3.1.adf /mnt -t affs -o loop,verbose
  127. mount /dev/sda3 /Amiga -t affs
  128. /etc/fstab entry::
  129. /dev/sdb5 /amiga/Workbench affs noauto,user,exec,verbose 0 0
  130. IMPORTANT NOTE
  131. ==============
  132. If you boot Windows 95 (don't know about 3.x, 98 and NT) while you
  133. have an Amiga harddisk connected to your PC, it will overwrite
  134. the bytes 0x00dc..0x00df of block 0 with garbage, thus invalidating
  135. the Rigid Disk Block. Sheer luck has it that this is an unused
  136. area of the RDB, so only the checksum doesn't match anymore.
  137. Linux will ignore this garbage and recognize the RDB anyway, but
  138. before you connect that drive to your Amiga again, you must
  139. restore or repair your RDB. So please do make a backup copy of it
  140. before booting Windows!
  141. If the damage is already done, the following should fix the RDB
  142. (where <disk> is the device name).
  143. DO AT YOUR OWN RISK::
  144. dd if=/dev/<disk> of=rdb.tmp count=1
  145. cp rdb.tmp rdb.fixed
  146. dd if=/dev/zero of=rdb.fixed bs=1 seek=220 count=4
  147. dd if=rdb.fixed of=/dev/<disk>
  148. Bugs, Restrictions, Caveats
  149. ===========================
  150. Quite a few things may not work as advertised. Not everything is
  151. tested, though several hundred MB have been read and written using
  152. this fs. For a most up-to-date list of bugs please consult
  153. fs/affs/Changes.
  154. By default, filenames are truncated to 30 characters without warning.
  155. 'nofilenametruncate' mount option can change that behavior.
  156. Case is ignored by the affs in filename matching, but Linux shells
  157. do care about the case. Example (with /wb being an affs mounted fs)::
  158. rm /wb/WRONGCASE
  159. will remove /mnt/wrongcase, but::
  160. rm /wb/WR*
  161. will not since the names are matched by the shell.
  162. The block allocation is designed for hard disk partitions. If more
  163. than 1 process writes to a (small) diskette, the blocks are allocated
  164. in an ugly way (but the real AFFS doesn't do much better). This
  165. is also true when space gets tight.
  166. You cannot execute programs on an OFS (Old File System), since the
  167. program files cannot be memory mapped due to the 488 byte blocks.
  168. For the same reason you cannot mount an image on such a filesystem
  169. via the loopback device.
  170. The bitmap valid flag in the root block may not be accurate when the
  171. system crashes while an affs partition is mounted. There's currently
  172. no way to fix a garbled filesystem without an Amiga (disk validator)
  173. or manually (who would do this?). Maybe later.
  174. If you mount affs partitions on system startup, you may want to tell
  175. fsck that the fs should not be checked (place a '0' in the sixth field
  176. of /etc/fstab).
  177. It's not possible to read floppy disks with a normal PC or workstation
  178. due to an incompatibility with the Amiga floppy controller.
  179. If you are interested in an Amiga Emulator for Linux, look at
  180. http://web.archive.org/web/%2E/http://www.freiburg.linux.de/~uae/