요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
=============================
Overview of Amiga Filesystems
=============================
Not all varieties of the Amiga filesystems are supported for reading and
writing. The Amiga currently knows six different filesystems:
============== ===============================================================
DOS\0 The old or original filesystem, not really suited for
hard disks and normally not used on them, either.
Supported read/write.
DOS\1 The original Fast File System. Supported read/write.
DOS\2 The old "international" filesystem. International means that
a bug has been fixed so that accented ("international") letters
in file names are case-insensitive, as they ought to be.
Supported read/write.
DOS\3 The "international" Fast File System. Supported read/write.
DOS\4 The original filesystem with directory cache. The directory
cache speeds up directory accesses on floppies considerably,
but slows down file creation/deletion. Doesn't make much
sense on hard disks. Supported read only.
DOS\5 The Fast File System with directory cache. Supported read only.
============== ===============================================================
All of the above filesystems allow block sizes from 512 to 32K bytes.
Supported block sizes are: 512, 1024, 2048 and 4096 bytes. Larger blocks
speed up almost everything at the expense of wasted disk space. The speed
gain above 4K seems not really worth the price, so you don't lose too
much here, either.
The muFS (multi user File System) equivalents of the above file systems
are supported, too.
Mount options for the AFFS
==========================
protect
If this option is set, the protection bits cannot be altered.
setuid[=uid]
This sets the owner of all files and directories in the file
system to uid or the uid of the current user, respectively.
setgid[=gid]
Same as above, but for gid.
mode=mode
Sets the mode flags to the given (octal) value, regardless
of the original permissions. Directories will get an x
permission if the corresponding r bit is set.
This is useful since most of the plain AmigaOS files
will map to 600.
nofilenametruncate
The file system will return an error when filename exceeds
standard maximum filename length (30 characters).
reserved=num
Sets the number of reserved blocks at the start of the
partition to num. You should never need this option.
Default is 2.
root=block
Sets the block number of the root block. This should never
be necessary.
bs=blksize
Sets the blocksize to blksize. Valid block sizes are 512,
1024, 2048 and 4096. Like the root option, this should
never be necessary, as the affs can figure it out itself.
quiet
The file system will not return an error for disallowed
mode changes.
verbose
The volume name, file system type and block size will
be written to the syslog when the filesystem is mounted.
mufs
The filesystem is really a muFS, also it doesn't
identify itself as one. This option is necessary if
the filesystem wasn't formatted as muFS, but is used
as one.
prefix=path
Path will be prefixed to every absolute path name of
symbolic links on an AFFS partition. Default = "/".
(See below.)
volume=name
When symbolic links with an absolute path are created
on an AFFS partition, name will be prepended as the
volume name. Default = "" (empty string).
(See below.)
Handling of the Users/Groups and protection flags
=================================================
Amiga -> Linux:
The Amiga protection flags RWEDRWEDHSPARWED are handled as follows:
- R maps to r for user, group and others. On directories, R implies x.
- W maps to w.
- E maps to x.
- D is ignored.
- H, S and P are always retained and ignored under Linux.
- A is cleared when a file is written to.
User id and group id will be used unless set[gu]id are given as mount
options. Since most of the Amiga file systems are single user systems
they will be owned by root. The root directory (the mount point) of the
Amiga filesystem will be owned by the user who actually mounts the
filesystem (the root directory doesn't have uid/gid fields).
Linux -> Amiga:
The Linux rwxrwxrwx file mode is handled as follows:
- r permission will allow R for user, group and others.
- w permission will allow W for user, group and others.
- x permission of the user will allow E for plain files.
- D will be allowed for user, group and others.
- All other flags (suid, sgid, ...) are ignored and will
not be retained.
Newly created files and directories will get the user and group ID
of the current user and a mode according to the umask.
Symbolic links
==============
Although the Amiga and Linux file systems resemble each other, there
are some, not always subtle, differences. One of them becomes apparent
with symbolic links. While Linux has a file system with exactly one
root directory, the Amiga has a separate root directory for each
file system (for example, partition, floppy disk, ...). With the Amiga,
these entities are called "volumes". They have symbolic names which
can be used to access them. Thus, symbolic links can point to a
different volume. AFFS turns the volume name into a directory name
and prepends the prefix path (see prefix option) to it.
Example:
You mount all your Amiga partitions under /amiga/<volume> (where
<volume> is the name of the volume), and you give the option
"prefix=/amiga/" when mounting all your AFFS partitions. (They
might be "User", "WB" and "Graphics", the mount points /amiga/User,
/amiga/WB and /amiga/Graphics). A symbolic link referring to
"User:sc/include/dos/dos.h" will be followed to
"/amiga/User/sc/include/dos/dos.h".
Examples
========
Command line::
mount Archive/Amiga/Workbench3.1.adf /mnt -t affs -o loop,verbose
mount /dev/sda3 /Amiga -t affs
/etc/fstab entry::
/dev/sdb5 /amiga/Workbench affs noauto,user,exec,verbose 0 0
IMPORTANT NOTE
==============
If you boot Windows 95 (don't know about 3.x, 98 and NT) while you
have an Amiga harddisk connected to your PC, it will overwrite
the bytes 0x00dc..0x00df of block 0 with garbage, thus invalidating
the Rigid Disk Block. Sheer luck has it that this is an unused
area of the RDB, so only the checksum doesn't match anymore.
Linux will ignore this garbage and recognize the RDB anyway, but
before you connect that drive to your Amiga again, you must
restore or repair your RDB. So please do make a backup copy of it
before booting Windows!
If the damage is already done, the following should fix the RDB
(where <disk> is the device name).
DO AT YOUR OWN RISK::
dd if=/dev/<disk> of=rdb.tmp count=1
cp rdb.tmp rdb.fixed
dd if=/dev/zero of=rdb.fixed bs=1 seek=220 count=4
dd if=rdb.fixed of=/dev/<disk>
Bugs, Restrictions, Caveats
===========================
Quite a few things may not work as advertised. Not everything is
tested, though several hundred MB have been read and written using
this fs. For a most up-to-date list of bugs please consult
fs/affs/Changes.
By default, filenames are truncated to 30 characters without warning.
'nofilenametruncate' mount option can change that behavior.
Case is ignored by the affs in filename matching, but Linux shells
do care about the case. Example (with /wb being an affs mounted fs)::
rm /wb/WRONGCASE
will remove /mnt/wrongcase, but::
rm /wb/WR*
will not since the names are matched by the shell.
The block allocation is designed for hard disk partitions. If more
than 1 process writes to a (small) diskette, the blocks are allocated
in an ugly way (but the real AFFS doesn't do much better). This
is also true when space gets tight.
You cannot execute programs on an OFS (Old File System), since the
program files cannot be memory mapped due to the 488 byte blocks.
For the same reason you cannot mount an image on such a filesystem
via the loopback device.
The bitmap valid flag in the root block may not be accurate when the
system crashes while an affs partition is mounted. There's currently
no way to fix a garbled filesystem without an Amiga (disk validator)
or manually (who would do this?). Maybe later.
If you mount affs partitions on system startup, you may want to tell
fsck that the fs should not be checked (place a '0' in the sixth field
of /etc/fstab).
It's not possible to read floppy disks with a normal PC or workstation
due to an incompatibility with the Amiga floppy controller.
If you are interested in an Amiga Emulator for Linux, look at
http://web.archive.org/web/%2E/http://www.freiburg.linux.de/~uae/
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Amiga filesystem 종류와 block size
1-40Amiga의 여섯 filesystem variant가 모두 같은 read/write 수준으로 지원되는 것은 아닙니다. `DOS\0` old/original filesystem, `DOS\1` original Fast File System, `DOS\2` accented filename의 대소문자 처리 bug를 고친 international old filesystem, `DOS\3` international Fast File System은 read/write를 지원합니다.
directory cache가 있는 original filesystem `DOS\4`와 Fast File System `DOS\5`는 read-only입니다. directory cache는 floppy directory 접근을 크게 빠르게 하지만 file 생성과 삭제를 느리게 하므로 hard disk에는 이점이 적습니다.
이 filesystem들은 512 byte부터 32 KiB block을 허용하지만 Linux AFFS가 지원하는 block size는 512, 1024, 2048, 4096 byte입니다. 큰 block은 대부분의 작업을 빠르게 하지만 disk 공간을 낭비하며 4 KiB를 넘는 이득은 비용에 비해 작습니다. 각 형식의 muFS multi-user variant도 지원합니다.
DOS variant별 의미와 Linux AFFS 접근 모드입니다.
.. SPDX-License-Identifier: GPL-2.0
=============================
Overview of Amiga Filesystems
=============================
Not all varieties of the Amiga filesystems are supported for reading and
writing. The Amiga currently knows six different filesystems:
============== ===============================================================
DOS\0 The old or original filesystem, not really suited for
hard disks and normally not used on them, either.
Supported read/write.
DOS\1 The original Fast File System. Supported read/write.
DOS\2 The old "international" filesystem. International means that
a bug has been fixed so that accented ("international") letters
in file names are case-insensitive, as they ought to be.
Supported read/write.
DOS\3 The "international" Fast File System. Supported read/write.
DOS\4 The original filesystem with directory cache. The directory
cache speeds up directory accesses on floppies considerably,
but slows down file creation/deletion. Doesn't make much
sense on hard disks. Supported read only.
DOS\5 The Fast File System with directory cache. Supported read only.
============== ===============================================================
All of the above filesystems allow block sizes from 512 to 32K bytes.
Supported block sizes are: 512, 1024, 2048 and 4096 bytes. Larger blocks
speed up almost everything at the expense of wasted disk space. The speed
gain above 4K seems not really worth the price, so you don't lose too
much here, either.
The muFS (multi user File System) equivalents of the above file systems
are supported, too.
AFFS mount option
41-103`protect`는 protection bit 변경을 막습니다. `setuid[=uid]`는 모든 file과 directory owner를 지정 UID 또는 현재 사용자 UID로 정하고, `setgid[=gid]`는 같은 방식으로 GID를 정합니다.
`mode=mode`는 원래 permission과 관계없이 octal mode를 적용합니다. directory는 대응 `r` bit가 있으면 `x`도 얻습니다. 일반 AmigaOS file이 대개 `600`으로 mapping되므로 유용합니다.
`nofilenametruncate`는 filename이 표준 최대 길이 30자를 넘으면 truncate하지 않고 error를 반환합니다. `reserved=num`은 partition 시작의 reserved block 수이며 기본 2, `root=block`은 root block number, `bs=blksize`는 512/1024/2048/4096 중 block size입니다. 뒤의 세 option은 보통 AFFS가 자동으로 알아내므로 필요하지 않습니다.
`quiet`는 허용되지 않은 mode 변경에도 error를 반환하지 않습니다. `verbose`는 mount할 때 volume name, filesystem type, block size를 syslog에 기록합니다.
`mufs`는 disk가 자신을 muFS로 식별하지 않지만 실제로 muFS처럼 쓰일 때 지정합니다. `prefix=path`는 AFFS absolute symbolic link의 모든 path 앞에 붙으며 기본값은 `/`입니다. `volume=name`은 AFFS에서 absolute symbolic link를 만들 때 앞에 붙일 volume name이며 기본값은 빈 문자열입니다.
모든 원문 option과 핵심 동작입니다.
Mount options for the AFFS
==========================
protect
If this option is set, the protection bits cannot be altered.
setuid[=uid]
This sets the owner of all files and directories in the file
system to uid or the uid of the current user, respectively.
setgid[=gid]
Same as above, but for gid.
mode=mode
Sets the mode flags to the given (octal) value, regardless
of the original permissions. Directories will get an x
permission if the corresponding r bit is set.
This is useful since most of the plain AmigaOS files
will map to 600.
nofilenametruncate
The file system will return an error when filename exceeds
standard maximum filename length (30 characters).
reserved=num
Sets the number of reserved blocks at the start of the
partition to num. You should never need this option.
Default is 2.
root=block
Sets the block number of the root block. This should never
be necessary.
bs=blksize
Sets the blocksize to blksize. Valid block sizes are 512,
1024, 2048 and 4096. Like the root option, this should
never be necessary, as the affs can figure it out itself.
quiet
The file system will not return an error for disallowed
mode changes.
verbose
The volume name, file system type and block size will
be written to the syslog when the filesystem is mounted.
mufs
The filesystem is really a muFS, also it doesn't
identify itself as one. This option is necessary if
the filesystem wasn't formatted as muFS, but is used
as one.
prefix=path
Path will be prefixed to every absolute path name of
symbolic links on an AFFS partition. Default = "/".
(See below.)
volume=name
When symbolic links with an absolute path are created
on an AFFS partition, name will be prepended as the
volume name. Default = "" (empty string).
(See below.)
Amiga·Linux 사용자와 protection flag 변환
104-146Amiga에서 Linux로 변환할 때 `RWEDRWEDHSPARWED` protection flag 중 `R`은 user/group/other의 `r`로 mapping되고 directory에서는 `x`도 뜻합니다. `W`는 `w`, `E`는 `x`로 mapping하며 `D`는 무시합니다.
`H`, `S`, `P`는 항상 보존하지만 Linux에서는 무시하고, `A`는 file에 write할 때 clear합니다. `setuid` 또는 `setgid` mount option이 없으면 저장된 UID/GID를 사용합니다. 일반적인 single-user Amiga filesystem은 대개 root 소유입니다.
Amiga root directory에는 UID/GID field가 없으므로 mount point는 실제 mount한 사용자가 소유합니다.
Linux에서 Amiga로 변환할 때 `r`은 user/group/other의 `R`, `w`는 `W`, user execute는 일반 file의 `E`를 허용합니다. `D`는 모두에게 허용하고 suid, sgid 같은 나머지 flag는 무시하며 보존하지 않습니다. 새 file과 directory는 현재 사용자의 UID/GID와 umask에 따른 mode를 받습니다.
양방향 permission 변환을 한 표로 정리했습니다.
Handling of the Users/Groups and protection flags
=================================================
Amiga -> Linux:
The Amiga protection flags RWEDRWEDHSPARWED are handled as follows:
- R maps to r for user, group and others. On directories, R implies x.
- W maps to w.
- E maps to x.
- D is ignored.
- H, S and P are always retained and ignored under Linux.
- A is cleared when a file is written to.
User id and group id will be used unless set[gu]id are given as mount
options. Since most of the Amiga file systems are single user systems
they will be owned by root. The root directory (the mount point) of the
Amiga filesystem will be owned by the user who actually mounts the
filesystem (the root directory doesn't have uid/gid fields).
Linux -> Amiga:
The Linux rwxrwxrwx file mode is handled as follows:
- r permission will allow R for user, group and others.
- w permission will allow W for user, group and others.
- x permission of the user will allow E for plain files.
- D will be allowed for user, group and others.
- All other flags (suid, sgid, ...) are ignored and will
not be retained.
Newly created files and directories will get the user and group ID
of the current user and a mode according to the umask.
Amiga volume symbolic link 변환
147-168Linux는 하나의 root directory를 가지지만 Amiga는 partition이나 floppy 같은 filesystem volume마다 별도 root가 있습니다. 각 volume은 다른 volume을 가리키는 symbolic name으로 접근할 수 있으므로 symbolic link가 volume 경계를 넘을 수 있습니다.
AFFS는 volume name을 directory name으로 바꾸고 `prefix` option의 path를 앞에 붙입니다.
예를 들어 모든 Amiga partition을 `/amiga/<volume>`에 mount하고 `prefix=/amiga/`를 사용하면 `User`, `WB`, `Graphics` volume의 mount point는 각각 `/amiga/User`, `/amiga/WB`, `/amiga/Graphics`입니다. `User:sc/include/dos/dos.h` link는 `/amiga/User/sc/include/dos/dos.h`로 해석됩니다.
Amiga volume path를 Linux path로 바꾸는 규칙입니다.
Symbolic links
==============
Although the Amiga and Linux file systems resemble each other, there
are some, not always subtle, differences. One of them becomes apparent
with symbolic links. While Linux has a file system with exactly one
root directory, the Amiga has a separate root directory for each
file system (for example, partition, floppy disk, ...). With the Amiga,
these entities are called "volumes". They have symbolic names which
can be used to access them. Thus, symbolic links can point to a
different volume. AFFS turns the volume name into a directory name
and prepends the prefix path (see prefix option) to it.
Example:
You mount all your Amiga partitions under /amiga/<volume> (where
<volume> is the name of the volume), and you give the option
"prefix=/amiga/" when mounting all your AFFS partitions. (They
might be "User", "WB" and "Graphics", the mount points /amiga/User,
/amiga/WB and /amiga/Graphics). A symbolic link referring to
"User:sc/include/dos/dos.h" will be followed to
"/amiga/User/sc/include/dos/dos.h".
AFFS mount 예
169-180Amiga Workbench disk image는 `mount Archive/Amiga/Workbench3.1.adf /mnt -t affs -o loop,verbose`처럼 loop mount할 수 있습니다. block device partition은 `mount /dev/sda3 /Amiga -t affs`로 mount합니다.
`/etc/fstab` 예는 `/dev/sdb5 /amiga/Workbench affs noauto,user,exec,verbose 0 0`입니다.
image, partition, fstab 세 사용법입니다.
Examples
========
Command line::
mount Archive/Amiga/Workbench3.1.adf /mnt -t affs -o loop,verbose
mount /dev/sda3 /Amiga -t affs
/etc/fstab entry::
/dev/sdb5 /amiga/Workbench affs noauto,user,exec,verbose 0 0
Windows 95의 Rigid Disk Block 손상 주의
181-203Amiga hard disk를 PC에 연결한 채 Windows 95를 boot하면 block 0의 byte `0x00dc..0x00df`를 쓰레기 값으로 덮어 Rigid Disk Block checksum을 무효화할 수 있습니다. 이 영역은 RDB에서 사용하지 않으므로 Linux는 checksum 불일치를 무시하고 RDB를 인식하지만, 다시 Amiga에 연결하기 전 복원하거나 수리해야 합니다.
Windows를 boot하기 전에 RDB backup을 만들어야 합니다. 이미 손상됐다면 원문의 명령은 첫 block을 `rdb.tmp`로 읽고 `rdb.fixed`를 복제한 다음 offset 220의 4 byte를 zero로 만들고 disk에 다시 씁니다.
이 명령은 raw disk를 직접 덮어쓰므로 device 이름을 잘못 지정하면 data를 잃습니다. 원문도 `DO AT YOUR OWN RISK`라고 경고합니다.
위험한 raw write 절차를 명령 순서 그대로 설명합니다.
IMPORTANT NOTE
==============
If you boot Windows 95 (don't know about 3.x, 98 and NT) while you
have an Amiga harddisk connected to your PC, it will overwrite
the bytes 0x00dc..0x00df of block 0 with garbage, thus invalidating
the Rigid Disk Block. Sheer luck has it that this is an unused
area of the RDB, so only the checksum doesn't match anymore.
Linux will ignore this garbage and recognize the RDB anyway, but
before you connect that drive to your Amiga again, you must
restore or repair your RDB. So please do make a backup copy of it
before booting Windows!
If the damage is already done, the following should fix the RDB
(where <disk> is the device name).
DO AT YOUR OWN RISK::
dd if=/dev/<disk> of=rdb.tmp count=1
cp rdb.tmp rdb.fixed
dd if=/dev/zero of=rdb.fixed bs=1 seek=220 count=4
dd if=rdb.fixed of=/dev/<disk>
AFFS bug·제약·주의사항
204-250모든 기능이 충분히 시험된 것은 아니며 최신 bug 목록은 `fs/affs/Changes`를 확인합니다. 기본적으로 filename은 경고 없이 30자로 truncate되며 `nofilenametruncate`로 error 반환 방식으로 바꿀 수 있습니다.
AFFS filename 비교는 대소문자를 무시하지만 Linux shell glob은 대소문자를 구분합니다. 따라서 `rm /wb/WRONGCASE`는 `/mnt/wrongcase`를 지울 수 있지만 `rm /wb/WR*`는 shell이 이름을 먼저 match하므로 동작하지 않을 수 있습니다.
block allocation은 hard disk partition용으로 설계되었습니다. 여러 process가 작은 floppy에 동시에 쓰거나 공간이 부족하면 block 배치가 좋지 않을 수 있습니다.
OFS는 488-byte block 때문에 program file을 memory-map할 수 없으므로 program을 실행할 수 없고, 같은 이유로 그 filesystem 안의 image를 loopback device로 mount할 수 없습니다.
AFFS partition이 mount된 상태에서 system이 crash하면 root block의 bitmap valid flag가 틀릴 수 있습니다. 현재는 Amiga disk validator 또는 수동 작업 없이 손상된 filesystem을 고칠 방법이 없습니다.
부팅 때 AFFS partition을 mount한다면 `/etc/fstab`의 여섯 번째 field를 `0`으로 두어 fsck가 검사하지 않게 할 수 있습니다. 일반 PC나 workstation의 floppy controller는 Amiga와 호환되지 않아 Amiga floppy를 읽을 수 없습니다.
Linux용 Amiga emulator 자료는 `http://web.archive.org/web/%2E/http://www.freiburg.linux.de/~uae/`에서 확인합니다.
운영 중 특히 영향을 주는 제한을 모았습니다.
Bugs, Restrictions, Caveats
===========================
Quite a few things may not work as advertised. Not everything is
tested, though several hundred MB have been read and written using
this fs. For a most up-to-date list of bugs please consult
fs/affs/Changes.
By default, filenames are truncated to 30 characters without warning.
'nofilenametruncate' mount option can change that behavior.
Case is ignored by the affs in filename matching, but Linux shells
do care about the case. Example (with /wb being an affs mounted fs)::
rm /wb/WRONGCASE
will remove /mnt/wrongcase, but::
rm /wb/WR*
will not since the names are matched by the shell.
The block allocation is designed for hard disk partitions. If more
than 1 process writes to a (small) diskette, the blocks are allocated
in an ugly way (but the real AFFS doesn't do much better). This
is also true when space gets tight.
You cannot execute programs on an OFS (Old File System), since the
program files cannot be memory mapped due to the 488 byte blocks.
For the same reason you cannot mount an image on such a filesystem
via the loopback device.
The bitmap valid flag in the root block may not be accurate when the
system crashes while an affs partition is mounted. There's currently
no way to fix a garbled filesystem without an Amiga (disk validator)
or manually (who would do this?). Maybe later.
If you mount affs partitions on system startup, you may want to tell
fsck that the fs should not be checked (place a '0' in the sixth field
of /etc/fstab).
It's not possible to read floppy disks with a normal PC or workstation
due to an incompatibility with the Amiga floppy controller.
If you are interested in an Amiga Emulator for Linux, look at
http://web.archive.org/web/%2E/http://www.freiburg.linux.de/~uae/
요약·해설
affs.rst:1-250AFFS는 Amiga DOS\0~DOS\5와 muFS를 다루며 protection flag, volume symbolic link와 Linux permission을 상호 변환합니다.
지원과 주의 영역을 빠르게 비교합니다.