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