1 .. SPDX-License-Identifier: GPL-2.0
14 * Answer the 'System V and Coherent filesystem support' question with 'y'
15 when configuring the kernel.
16 * To mount a disk or a partition, use::
18 mount [-r] -t sysv device mountpoint
20 The file system type names::
26 may be used interchangeably, but the last two will eventually disappear.
28 Bugs in the present implementation:
32 - The "free list interleave" n:m is currently ignored.
33 - Only file systems with no filesystem name and no pack name are recognized.
34 (See Coherent "man mkfs" for a description of these features.)
36 - SystemV Release 2 FS:
38 The superblock is only searched in the blocks 9, 15, 18, which
39 corresponds to the beginning of track 1 on floppy disks. No support
40 for this FS on hard disk yet.
43 These filesystems are rather similar. Here is a comparison with Minix FS:
45 * Linux fdisk reports on partitions
47 - Minix FS 0x81 Linux/Minix
50 - Coherent FS 0x08 AIX bootable
52 * Size of a block or zone (data allocation unit on disk)
55 - Xenix FS 1024 (also 512 ??)
56 - SystemV FS 1024 (also 512 and 2048)
59 * General layout: all have one boot block, one super block and
60 separate areas for inodes and for directories/data.
61 On SystemV Release 2 FS (e.g. Microport) the first track is reserved and
62 all the block numbers (including the super block) are offset by one track.
64 * Byte ordering of "short" (16 bit entities) on disk:
66 - Minix FS little endian 0 1
67 - Xenix FS little endian 0 1
68 - SystemV FS little endian 0 1
69 - Coherent FS little endian 0 1
71 Of course, this affects only the file system, not the data of files on it!
73 * Byte ordering of "long" (32 bit entities) on disk:
75 - Minix FS little endian 0 1 2 3
76 - Xenix FS little endian 0 1 2 3
77 - SystemV FS little endian 0 1 2 3
78 - Coherent FS PDP-11 2 3 0 1
80 Of course, this affects only the file system, not the data of files on it!
82 * Inode on disk: "short", 0 means non-existent, the root dir ino is:
84 ================================= ==
86 Xenix FS, SystemV FS, Coherent FS 2
87 ================================= ==
89 * Maximum number of hard links to a file:
98 * Free inode management:
102 - Xenix FS, SystemV FS, Coherent FS
103 There is a cache of a certain number of free inodes in the super-block.
104 When it is exhausted, new free inodes are found using a linear search.
106 * Free block management:
110 - Xenix FS, SystemV FS, Coherent FS
111 Free blocks are organized in a "free list". Maybe a misleading term,
112 since it is not true that every free block contains a pointer to
113 the next free block. Rather, the free blocks are organized in chunks
114 of limited size, and every now and then a free block contains pointers
115 to the free blocks pertaining to the next chunk; the first of these
116 contains pointers and so on. The list terminates with a "block number"
117 0 on Xenix FS and SystemV FS, with a block zeroed out on Coherent FS.
119 * Super-block location:
121 =========== ==========================
122 Minix FS block 1 = bytes 1024..2047
123 Xenix FS block 1 = bytes 1024..2047
124 SystemV FS bytes 512..1023
125 Coherent FS block 1 = bytes 512..1023
126 =========== ==========================
128 * Super-block layout:
132 unsigned short s_ninodes;
133 unsigned short s_nzones;
134 unsigned short s_imap_blocks;
135 unsigned short s_zmap_blocks;
136 unsigned short s_firstdatazone;
137 unsigned short s_log_zone_size;
138 unsigned long s_max_size;
139 unsigned short s_magic;
141 - Xenix FS, SystemV FS, Coherent FS::
143 unsigned short s_firstdatazone;
144 unsigned long s_nzones;
145 unsigned short s_fzone_count;
146 unsigned long s_fzones[NICFREE];
147 unsigned short s_finode_count;
148 unsigned short s_finodes[NICINOD];
153 unsigned long s_time;
154 short s_dinfo[4]; -- SystemV FS only
155 unsigned long s_free_zones;
156 unsigned short s_free_inodes;
157 short s_dinfo[4]; -- Xenix FS only
158 unsigned short s_interleave_m,s_interleave_n; -- Coherent FS only
162 then they differ considerably:
173 long s_fill[12 or 14];
180 unsigned long s_unique;
182 Note that Coherent FS has no magic.
188 unsigned short i_mode;
189 unsigned short i_uid;
190 unsigned long i_size;
191 unsigned long i_time;
193 unsigned char i_nlinks;
194 unsigned short i_zone[7+1+1];
196 - Xenix FS, SystemV FS, Coherent FS::
198 unsigned short i_mode;
199 unsigned short i_nlink;
200 unsigned short i_uid;
201 unsigned short i_gid;
202 unsigned long i_size;
203 unsigned char i_zone[3*(10+1+1+1)];
204 unsigned long i_atime;
205 unsigned long i_mtime;
206 unsigned long i_ctime;
209 * Regular file data blocks are organized as
214 - 1 indirect block (pointers to blocks)
215 - 1 double-indirect block (pointer to pointers to blocks)
217 - Xenix FS, SystemV FS, Coherent FS:
220 - 1 indirect block (pointers to blocks)
221 - 1 double-indirect block (pointer to pointers to blocks)
222 - 1 triple-indirect block (pointer to pointers to pointers to blocks)
225 =========== ========== ================
226 Inode size inodes per block
227 =========== ========== ================
232 =========== ========== ================
234 * Directory entry on disk
238 unsigned short inode;
241 - Xenix FS, SystemV FS, Coherent FS::
243 unsigned short inode;
246 =========== ============== =====================
247 Dir entry size dir entries per block
248 =========== ============== =====================
253 =========== ============== =====================
255 * How to implement symbolic links such that the host fsck doesn't scream:
258 - Xenix FS kludge: as regular files with chmod 1000
260 - Coherent FS kludge: as regular files with chmod 1000
263 Notation: We often speak of a "block" but mean a zone (the allocation unit)
264 and not the disk driver's notion of "block".