affs.txt 8.0 KB

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