0001 .. SPDX-License-Identifier: GPL-2.0
0002
0003 =============================
0004 Overview of Amiga Filesystems
0005 =============================
0006
0007 Not all varieties of the Amiga filesystems are supported for reading and
0008 writing. The Amiga currently knows six different filesystems:
0009
0010 ============== ===============================================================
0011 DOS\0 The old or original filesystem, not really suited for
0012 hard disks and normally not used on them, either.
0013 Supported read/write.
0014
0015 DOS\1 The original Fast File System. Supported read/write.
0016
0017 DOS\2 The old "international" filesystem. International means that
0018 a bug has been fixed so that accented ("international") letters
0019 in file names are case-insensitive, as they ought to be.
0020 Supported read/write.
0021
0022 DOS\3 The "international" Fast File System. Supported read/write.
0023
0024 DOS\4 The original filesystem with directory cache. The directory
0025 cache speeds up directory accesses on floppies considerably,
0026 but slows down file creation/deletion. Doesn't make much
0027 sense on hard disks. Supported read only.
0028
0029 DOS\5 The Fast File System with directory cache. Supported read only.
0030 ============== ===============================================================
0031
0032 All of the above filesystems allow block sizes from 512 to 32K bytes.
0033 Supported block sizes are: 512, 1024, 2048 and 4096 bytes. Larger blocks
0034 speed up almost everything at the expense of wasted disk space. The speed
0035 gain above 4K seems not really worth the price, so you don't lose too
0036 much here, either.
0037
0038 The muFS (multi user File System) equivalents of the above file systems
0039 are supported, too.
0040
0041 Mount options for the AFFS
0042 ==========================
0043
0044 protect
0045 If this option is set, the protection bits cannot be altered.
0046
0047 setuid[=uid]
0048 This sets the owner of all files and directories in the file
0049 system to uid or the uid of the current user, respectively.
0050
0051 setgid[=gid]
0052 Same as above, but for gid.
0053
0054 mode=mode
0055 Sets the mode flags to the given (octal) value, regardless
0056 of the original permissions. Directories will get an x
0057 permission if the corresponding r bit is set.
0058 This is useful since most of the plain AmigaOS files
0059 will map to 600.
0060
0061 nofilenametruncate
0062 The file system will return an error when filename exceeds
0063 standard maximum filename length (30 characters).
0064
0065 reserved=num
0066 Sets the number of reserved blocks at the start of the
0067 partition to num. You should never need this option.
0068 Default is 2.
0069
0070 root=block
0071 Sets the block number of the root block. This should never
0072 be necessary.
0073
0074 bs=blksize
0075 Sets the blocksize to blksize. Valid block sizes are 512,
0076 1024, 2048 and 4096. Like the root option, this should
0077 never be necessary, as the affs can figure it out itself.
0078
0079 quiet
0080 The file system will not return an error for disallowed
0081 mode changes.
0082
0083 verbose
0084 The volume name, file system type and block size will
0085 be written to the syslog when the filesystem is mounted.
0086
0087 mufs
0088 The filesystem is really a muFS, also it doesn't
0089 identify itself as one. This option is necessary if
0090 the filesystem wasn't formatted as muFS, but is used
0091 as one.
0092
0093 prefix=path
0094 Path will be prefixed to every absolute path name of
0095 symbolic links on an AFFS partition. Default = "/".
0096 (See below.)
0097
0098 volume=name
0099 When symbolic links with an absolute path are created
0100 on an AFFS partition, name will be prepended as the
0101 volume name. Default = "" (empty string).
0102 (See below.)
0103
0104 Handling of the Users/Groups and protection flags
0105 =================================================
0106
0107 Amiga -> Linux:
0108
0109 The Amiga protection flags RWEDRWEDHSPARWED are handled as follows:
0110
0111 - R maps to r for user, group and others. On directories, R implies x.
0112
0113 - W maps to w.
0114
0115 - E maps to x.
0116
0117 - D is ignored.
0118
0119 - H, S and P are always retained and ignored under Linux.
0120
0121 - A is cleared when a file is written to.
0122
0123 User id and group id will be used unless set[gu]id are given as mount
0124 options. Since most of the Amiga file systems are single user systems
0125 they will be owned by root. The root directory (the mount point) of the
0126 Amiga filesystem will be owned by the user who actually mounts the
0127 filesystem (the root directory doesn't have uid/gid fields).
0128
0129 Linux -> Amiga:
0130
0131 The Linux rwxrwxrwx file mode is handled as follows:
0132
0133 - r permission will allow R for user, group and others.
0134
0135 - w permission will allow W for user, group and others.
0136
0137 - x permission of the user will allow E for plain files.
0138
0139 - D will be allowed for user, group and others.
0140
0141 - All other flags (suid, sgid, ...) are ignored and will
0142 not be retained.
0143
0144 Newly created files and directories will get the user and group ID
0145 of the current user and a mode according to the umask.
0146
0147 Symbolic links
0148 ==============
0149
0150 Although the Amiga and Linux file systems resemble each other, there
0151 are some, not always subtle, differences. One of them becomes apparent
0152 with symbolic links. While Linux has a file system with exactly one
0153 root directory, the Amiga has a separate root directory for each
0154 file system (for example, partition, floppy disk, ...). With the Amiga,
0155 these entities are called "volumes". They have symbolic names which
0156 can be used to access them. Thus, symbolic links can point to a
0157 different volume. AFFS turns the volume name into a directory name
0158 and prepends the prefix path (see prefix option) to it.
0159
0160 Example:
0161 You mount all your Amiga partitions under /amiga/<volume> (where
0162 <volume> is the name of the volume), and you give the option
0163 "prefix=/amiga/" when mounting all your AFFS partitions. (They
0164 might be "User", "WB" and "Graphics", the mount points /amiga/User,
0165 /amiga/WB and /amiga/Graphics). A symbolic link referring to
0166 "User:sc/include/dos/dos.h" will be followed to
0167 "/amiga/User/sc/include/dos/dos.h".
0168
0169 Examples
0170 ========
0171
0172 Command line::
0173
0174 mount Archive/Amiga/Workbench3.1.adf /mnt -t affs -o loop,verbose
0175 mount /dev/sda3 /Amiga -t affs
0176
0177 /etc/fstab entry::
0178
0179 /dev/sdb5 /amiga/Workbench affs noauto,user,exec,verbose 0 0
0180
0181 IMPORTANT NOTE
0182 ==============
0183
0184 If you boot Windows 95 (don't know about 3.x, 98 and NT) while you
0185 have an Amiga harddisk connected to your PC, it will overwrite
0186 the bytes 0x00dc..0x00df of block 0 with garbage, thus invalidating
0187 the Rigid Disk Block. Sheer luck has it that this is an unused
0188 area of the RDB, so only the checksum doesn't match anymore.
0189 Linux will ignore this garbage and recognize the RDB anyway, but
0190 before you connect that drive to your Amiga again, you must
0191 restore or repair your RDB. So please do make a backup copy of it
0192 before booting Windows!
0193
0194 If the damage is already done, the following should fix the RDB
0195 (where <disk> is the device name).
0196
0197 DO AT YOUR OWN RISK::
0198
0199 dd if=/dev/<disk> of=rdb.tmp count=1
0200 cp rdb.tmp rdb.fixed
0201 dd if=/dev/zero of=rdb.fixed bs=1 seek=220 count=4
0202 dd if=rdb.fixed of=/dev/<disk>
0203
0204 Bugs, Restrictions, Caveats
0205 ===========================
0206
0207 Quite a few things may not work as advertised. Not everything is
0208 tested, though several hundred MB have been read and written using
0209 this fs. For a most up-to-date list of bugs please consult
0210 fs/affs/Changes.
0211
0212 By default, filenames are truncated to 30 characters without warning.
0213 'nofilenametruncate' mount option can change that behavior.
0214
0215 Case is ignored by the affs in filename matching, but Linux shells
0216 do care about the case. Example (with /wb being an affs mounted fs)::
0217
0218 rm /wb/WRONGCASE
0219
0220 will remove /mnt/wrongcase, but::
0221
0222 rm /wb/WR*
0223
0224 will not since the names are matched by the shell.
0225
0226 The block allocation is designed for hard disk partitions. If more
0227 than 1 process writes to a (small) diskette, the blocks are allocated
0228 in an ugly way (but the real AFFS doesn't do much better). This
0229 is also true when space gets tight.
0230
0231 You cannot execute programs on an OFS (Old File System), since the
0232 program files cannot be memory mapped due to the 488 byte blocks.
0233 For the same reason you cannot mount an image on such a filesystem
0234 via the loopback device.
0235
0236 The bitmap valid flag in the root block may not be accurate when the
0237 system crashes while an affs partition is mounted. There's currently
0238 no way to fix a garbled filesystem without an Amiga (disk validator)
0239 or manually (who would do this?). Maybe later.
0240
0241 If you mount affs partitions on system startup, you may want to tell
0242 fsck that the fs should not be checked (place a '0' in the sixth field
0243 of /etc/fstab).
0244
0245 It's not possible to read floppy disks with a normal PC or workstation
0246 due to an incompatibility with the Amiga floppy controller.
0247
0248 If you are interested in an Amiga Emulator for Linux, look at
0249
0250 http://web.archive.org/web/%2E/http://www.freiburg.linux.de/~uae/