HP-UX Reference (11i v1 00/12) - 4 File Formats (vol 8)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man4/!!!intro.4
________________________________________________________________
___ ___
f
fs(4) fs(4)
/* sizes determined by number of cylinder groups and their sizes */
daddr_t fs_csaddr; /* blk addr of cyl grp summary area */
long fs_cssize; /* size of cyl grp summary area */
long fs_cgsize; /* cylinder group size */
/* these fields should be derived from the hardware */
long fs_ntrak; /* tracks per cylinder */
long fs_nsect; /* sectors per track */
long fs_spc; /* sectors per cylinder */
/* this comes from the disk driver partitioning */
long fs_ncyl; /* cylinders in file system */
/* these fields can be computed from the others */
long fs_cpg; /* cylinders per group */
long fs_ipg; /* inodes per group */
long fs_fpg; /* blocks per group * fs_frag */
/* this data must be re-computed after crashes */
struct csum fs_cstotal; /* cylinder summary information */
/* these fields are cleared at mount time */
char fs_fmod; /* super block modified flag */
char fs_clean; /* file system is clean flag */
char fs_ronly; /* mounted read-only flag */
char fs_flags; /* currently unused flag */
char fs_fsmnt[MAXMNTLEN];/* name mounted on */
/* these fields retain the current block allocation info */
long fs_cgrotor; /* last cg searched */
struct csum *fs_csp[MAXCSBUFS]; /*list of fs_cs info buffers*/
long fs_cpc; /* cyl per cycle in postbl */
short fs_postbl[MAXCPG][NRPOS];/*head of blocks per rotation*/
long fs_magic; /* magic number */
char fs_fname[6]; /* name of file system */
char fs_fpack[6]; /* pack name of file system */
u_char fs_rotbl[1]; /* list of blocks for each rotation */
/* actually longer */
};
A file system consists of a number of cylinder groups. Each cylinder group has inodes and data.
A file system is described by its super-block, which in turn describes the cylinder groups. The super-block
is critical data and is replicated in each cylinder group to protect against catastrophic loss. This is done at
file system creation time and the critical super-block data does not change, so the copies need not be refer-
enced further unless disaster strikes.
Addresses stored in inodes are capable of addressing fragments of ‘blocks’. File system blocks of at most
size MAXBSIZE can be optionally broken into smaller pieces, each of which is addressable; these pieces
may be DEV_BSIZE, or some multiple of a DEV_BSIZE unit (DEV_BSIZE is defined in
<sys/param.h>).
Large files consist of exclusively large data blocks. To avoid undue wasted disk space, the last data block of
a file is allocated only as many fragments of a large block as are necessary, if that file is small enough to not
require indirect data blocks. The file system format retains only a single pointer to such a fragment, which
is a piece of a single large block that has been divided. The size of such a fragment is determinable from
information in the inode, using the blksize(fs, ip, lbn) macro.
The file system records space availability at the fragment level; to determine block availability, aligned
fragments are examined.
I-numbers begin at 0. Inodes 0 and 1 are reserved. Inode 2 is used for the root directory of the file system.
The
lost+found directory is given the next available inode when it is initially created by mkfs.
fs_minfree gives the minimum acceptable percentage of file system blocks that can be free. If the freel-
ist drops below this level, only the super-user may continue to allocate blocks. This can be set to 0 if no
reserve of free blocks is deemed necessary. However, severe performance degradations result if the file
system is run at greater than 90% full; thus the default value of fs_minfree is 10%.
The best trade-off between block fragmentation and overall disk utilization and performance varies for each
intended use of the file system. Suggested values can be found in the system administrator’s manual for
each implementation.
HP-UX Release 11i: December 2000 − 2 − Section 4−−55
___
___