blob: 5776cbd5fa53295d97d637df8a8381df43aaa78c [file] [log] [blame]
Mauro Carvalho Chehab762721682020-02-17 17:11:49 +01001.. SPDX-License-Identifier: GPL-2.0
2
3=============================
Linus Torvalds1da177e2005-04-16 15:20:36 -07004Overview of Amiga Filesystems
5=============================
6
7Not all varieties of the Amiga filesystems are supported for reading and
8writing. The Amiga currently knows six different filesystems:
9
Mauro Carvalho Chehab762721682020-02-17 17:11:49 +010010============== ===============================================================
Linus Torvalds1da177e2005-04-16 15:20:36 -070011DOS\0 The old or original filesystem, not really suited for
12 hard disks and normally not used on them, either.
13 Supported read/write.
14
15DOS\1 The original Fast File System. Supported read/write.
16
17DOS\2 The old "international" filesystem. International means that
18 a bug has been fixed so that accented ("international") letters
19 in file names are case-insensitive, as they ought to be.
20 Supported read/write.
21
22DOS\3 The "international" Fast File System. Supported read/write.
23
24DOS\4 The original filesystem with directory cache. The directory
25 cache speeds up directory accesses on floppies considerably,
26 but slows down file creation/deletion. Doesn't make much
27 sense on hard disks. Supported read only.
28
29DOS\5 The Fast File System with directory cache. Supported read only.
Mauro Carvalho Chehab762721682020-02-17 17:11:49 +010030============== ===============================================================
Linus Torvalds1da177e2005-04-16 15:20:36 -070031
32All of the above filesystems allow block sizes from 512 to 32K bytes.
33Supported block sizes are: 512, 1024, 2048 and 4096 bytes. Larger blocks
34speed up almost everything at the expense of wasted disk space. The speed
35gain above 4K seems not really worth the price, so you don't lose too
36much here, either.
37
38The muFS (multi user File System) equivalents of the above file systems
39are supported, too.
40
41Mount options for the AFFS
42==========================
43
Mauro Carvalho Chehab762721682020-02-17 17:11:49 +010044protect
45 If this option is set, the protection bits cannot be altered.
Linus Torvalds1da177e2005-04-16 15:20:36 -070046
Mauro Carvalho Chehab762721682020-02-17 17:11:49 +010047setuid[=uid]
48 This sets the owner of all files and directories in the file
Linus Torvalds1da177e2005-04-16 15:20:36 -070049 system to uid or the uid of the current user, respectively.
50
Mauro Carvalho Chehab762721682020-02-17 17:11:49 +010051setgid[=gid]
52 Same as above, but for gid.
Linus Torvalds1da177e2005-04-16 15:20:36 -070053
Mauro Carvalho Chehab762721682020-02-17 17:11:49 +010054mode=mode
55 Sets the mode flags to the given (octal) value, regardless
Linus Torvalds1da177e2005-04-16 15:20:36 -070056 of the original permissions. Directories will get an x
57 permission if the corresponding r bit is set.
58 This is useful since most of the plain AmigaOS files
59 will map to 600.
60
Fabian Frederick8ca57722014-04-07 15:39:01 -070061nofilenametruncate
62 The file system will return an error when filename exceeds
63 standard maximum filename length (30 characters).
64
Mauro Carvalho Chehab762721682020-02-17 17:11:49 +010065reserved=num
66 Sets the number of reserved blocks at the start of the
Linus Torvalds1da177e2005-04-16 15:20:36 -070067 partition to num. You should never need this option.
68 Default is 2.
69
Mauro Carvalho Chehab762721682020-02-17 17:11:49 +010070root=block
71 Sets the block number of the root block. This should never
Linus Torvalds1da177e2005-04-16 15:20:36 -070072 be necessary.
73
Mauro Carvalho Chehab762721682020-02-17 17:11:49 +010074bs=blksize
75 Sets the blocksize to blksize. Valid block sizes are 512,
Linus Torvalds1da177e2005-04-16 15:20:36 -070076 1024, 2048 and 4096. Like the root option, this should
77 never be necessary, as the affs can figure it out itself.
78
Mauro Carvalho Chehab762721682020-02-17 17:11:49 +010079quiet
80 The file system will not return an error for disallowed
Linus Torvalds1da177e2005-04-16 15:20:36 -070081 mode changes.
82
Mauro Carvalho Chehab762721682020-02-17 17:11:49 +010083verbose
84 The volume name, file system type and block size will
Linus Torvalds1da177e2005-04-16 15:20:36 -070085 be written to the syslog when the filesystem is mounted.
86
Mauro Carvalho Chehab762721682020-02-17 17:11:49 +010087mufs
88 The filesystem is really a muFS, also it doesn't
Linus Torvalds1da177e2005-04-16 15:20:36 -070089 identify itself as one. This option is necessary if
90 the filesystem wasn't formatted as muFS, but is used
91 as one.
92
Mauro Carvalho Chehab762721682020-02-17 17:11:49 +010093prefix=path
94 Path will be prefixed to every absolute path name of
Linus Torvalds1da177e2005-04-16 15:20:36 -070095 symbolic links on an AFFS partition. Default = "/".
96 (See below.)
97
Mauro Carvalho Chehab762721682020-02-17 17:11:49 +010098volume=name
99 When symbolic links with an absolute path are created
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100 on an AFFS partition, name will be prepended as the
101 volume name. Default = "" (empty string).
102 (See below.)
103
104Handling of the Users/Groups and protection flags
105=================================================
106
107Amiga -> Linux:
108
109The Amiga protection flags RWEDRWEDHSPARWED are handled as follows:
110
111 - R maps to r for user, group and others. On directories, R implies x.
112
Max Staudtd3a84a82020-08-27 17:49:00 +0200113 - W maps to w.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700114
115 - E maps to x.
116
Max Staudtd3a84a82020-08-27 17:49:00 +0200117 - D is ignored.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118
Max Staudtd3a84a82020-08-27 17:49:00 +0200119 - H, S and P are always retained and ignored under Linux.
120
121 - A is cleared when a file is written to.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700122
123User id and group id will be used unless set[gu]id are given as mount
124options. Since most of the Amiga file systems are single user systems
125they will be owned by root. The root directory (the mount point) of the
126Amiga filesystem will be owned by the user who actually mounts the
127filesystem (the root directory doesn't have uid/gid fields).
128
129Linux -> Amiga:
130
131The Linux rwxrwxrwx file mode is handled as follows:
132
Max Staudtd3a84a82020-08-27 17:49:00 +0200133 - r permission will allow R for user, group and others.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700134
Max Staudtd3a84a82020-08-27 17:49:00 +0200135 - w permission will allow W for user, group and others.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700136
Max Staudtd3a84a82020-08-27 17:49:00 +0200137 - x permission of the user will allow E for plain files.
138
139 - D will be allowed for user, group and others.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700140
141 - All other flags (suid, sgid, ...) are ignored and will
142 not be retained.
Mauro Carvalho Chehab762721682020-02-17 17:11:49 +0100143
Linus Torvalds1da177e2005-04-16 15:20:36 -0700144Newly created files and directories will get the user and group ID
145of the current user and a mode according to the umask.
146
147Symbolic links
148==============
149
150Although the Amiga and Linux file systems resemble each other, there
151are some, not always subtle, differences. One of them becomes apparent
152with symbolic links. While Linux has a file system with exactly one
153root directory, the Amiga has a separate root directory for each
154file system (for example, partition, floppy disk, ...). With the Amiga,
155these entities are called "volumes". They have symbolic names which
156can be used to access them. Thus, symbolic links can point to a
157different volume. AFFS turns the volume name into a directory name
158and prepends the prefix path (see prefix option) to it.
159
160Example:
161You mount all your Amiga partitions under /amiga/<volume> (where
162<volume> is the name of the volume), and you give the option
163"prefix=/amiga/" when mounting all your AFFS partitions. (They
164might be "User", "WB" and "Graphics", the mount points /amiga/User,
165/amiga/WB and /amiga/Graphics). A symbolic link referring to
166"User:sc/include/dos/dos.h" will be followed to
167"/amiga/User/sc/include/dos/dos.h".
168
169Examples
170========
171
Mauro Carvalho Chehab762721682020-02-17 17:11:49 +0100172Command line::
173
Linus Torvalds1da177e2005-04-16 15:20:36 -0700174 mount Archive/Amiga/Workbench3.1.adf /mnt -t affs -o loop,verbose
175 mount /dev/sda3 /Amiga -t affs
176
Mauro Carvalho Chehab762721682020-02-17 17:11:49 +0100177/etc/fstab entry::
178
Linus Torvalds1da177e2005-04-16 15:20:36 -0700179 /dev/sdb5 /amiga/Workbench affs noauto,user,exec,verbose 0 0
180
181IMPORTANT NOTE
182==============
183
184If you boot Windows 95 (don't know about 3.x, 98 and NT) while you
185have an Amiga harddisk connected to your PC, it will overwrite
186the bytes 0x00dc..0x00df of block 0 with garbage, thus invalidating
187the Rigid Disk Block. Sheer luck has it that this is an unused
188area of the RDB, so only the checksum doesn't match anymore.
189Linux will ignore this garbage and recognize the RDB anyway, but
190before you connect that drive to your Amiga again, you must
191restore or repair your RDB. So please do make a backup copy of it
192before booting Windows!
193
194If the damage is already done, the following should fix the RDB
195(where <disk> is the device name).
Mauro Carvalho Chehab762721682020-02-17 17:11:49 +0100196
197DO AT YOUR OWN RISK::
Linus Torvalds1da177e2005-04-16 15:20:36 -0700198
199 dd if=/dev/<disk> of=rdb.tmp count=1
200 cp rdb.tmp rdb.fixed
201 dd if=/dev/zero of=rdb.fixed bs=1 seek=220 count=4
202 dd if=rdb.fixed of=/dev/<disk>
203
204Bugs, Restrictions, Caveats
205===========================
206
207Quite a few things may not work as advertised. Not everything is
208tested, though several hundred MB have been read and written using
209this fs. For a most up-to-date list of bugs please consult
210fs/affs/Changes.
211
Fabian Frederick8ca57722014-04-07 15:39:01 -0700212By default, filenames are truncated to 30 characters without warning.
213'nofilenametruncate' mount option can change that behavior.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700214
215Case is ignored by the affs in filename matching, but Linux shells
Mauro Carvalho Chehab762721682020-02-17 17:11:49 +0100216do care about the case. Example (with /wb being an affs mounted fs)::
217
Linus Torvalds1da177e2005-04-16 15:20:36 -0700218 rm /wb/WRONGCASE
Mauro Carvalho Chehab762721682020-02-17 17:11:49 +0100219
220will remove /mnt/wrongcase, but::
221
Linus Torvalds1da177e2005-04-16 15:20:36 -0700222 rm /wb/WR*
Mauro Carvalho Chehab762721682020-02-17 17:11:49 +0100223
Linus Torvalds1da177e2005-04-16 15:20:36 -0700224will not since the names are matched by the shell.
225
226The block allocation is designed for hard disk partitions. If more
227than 1 process writes to a (small) diskette, the blocks are allocated
228in an ugly way (but the real AFFS doesn't do much better). This
229is also true when space gets tight.
230
231You cannot execute programs on an OFS (Old File System), since the
232program files cannot be memory mapped due to the 488 byte blocks.
233For the same reason you cannot mount an image on such a filesystem
234via the loopback device.
235
236The bitmap valid flag in the root block may not be accurate when the
237system crashes while an affs partition is mounted. There's currently
238no way to fix a garbled filesystem without an Amiga (disk validator)
239or manually (who would do this?). Maybe later.
240
241If you mount affs partitions on system startup, you may want to tell
242fsck that the fs should not be checked (place a '0' in the sixth field
243of /etc/fstab).
244
245It's not possible to read floppy disks with a normal PC or workstation
246due to an incompatibility with the Amiga floppy controller.
247
248If you are interested in an Amiga Emulator for Linux, look at
249
Mauro Carvalho Chehab762721682020-02-17 17:11:49 +0100250http://web.archive.org/web/%2E/http://www.freiburg.linux.de/~uae/