UFS(7FS) | File Systems | UFS(7FS) |
ufs
—
#include <sys/param.h>
#include <sys/types.h>
#include <sys/fs/ufs_fs.h>
#include <sys/fs/ufs_inode.h>
ufs
is one of the primary default disk-based file
systems for illumos. The UFS file system is hierarchical, starting with its
root directory (/) and continuing downward through a
number of directories. The root of a UFS file system is inode
2. A UFS file system's root contents replace the contents of the directory
upon which it is mounted.
Subsequent sections of this manpage provide details of the UFS file systems.
FSOKAY -
fs_time. fs_time is the timestamp
that indicates when the last system write occurred.
fs_state is updated whenever
fs_clean changes. Some fs_clean
values are:
FSCLEAN
FSACTIVE
FSSTABLE
FSBAD
FSLOG
FSLOG
or FSBAD
. A non-logging file system can have
FSACTIVE
, FSSTABLE
, or
FSCLEAN
.
It is not necessary to run the fsck command
on unmounted file systems with a state of
FSCLEAN
, FSSTABLE
, or
FSLOG
.
mount(2) returns
ENOSPC
if an attempt is made to mount a UFS file
system with a state of FSACTIVE
for read/write
access.
As an additional safeguard, fs_clean
should be trusted only if fs_state contains a
value equal to FSOKAY -
fs_time, where FSOKAY
is a
constant integer defined in the
/usr/include/sys/fs/ufs_fs.h file. Otherwise,
fs_clean is treated as though it contains the
value of FSACTIVE
.
If a UID or GID contains an extended value, the short variable (ic_suid, ic_sgid) contains the value 65535 and the corresponding UID or GID is in ic_uid or ic_gid. Because numbers for block and character devices are stored in the first direct block pointer of the inode (ic_db[0]) and the disk block addresses are already 32 bit values, no special encoding exists for device numbers (unlike UID or GID fields).
On-disk format changes for a multiterabyte UFS file system include:
FS_MAGIC
to MTB_UFS_MAGIC
.
For more information, see the
/usr/include/sys/fs/ufs_fs.h file.UFS logging provides two advantages:
The UFS log is allocated from free blocks on the file system and is sized at approximately 1 Mbyte per 1 Gbyte of file system, up to 256 Mbytes. The log size may be larger (up to a maximum of 512 Mbytes), depending upon the number of cylinder groups present in the file system. The log is continually flushed as it fills up. The log is also flushed when the file system is unmounted or as a result of a lockfs(1M) command.
# mount -F ufs /dev/dsk/c0t0d0s7 /export/home
/dev/dsk/c0t0d0s7 /dev/rdsk/c0t0d0s7 /export/home ufs 2 yes -
For more information on mounting UFS file systems, see mount_ufs(1M).
-v
option. In the fstyp output, look at the
nbfree (number of blocks free) and
nffree ((number of fragments free)) fields. On unmounted
filesystems, you can use fsck(1M) and
observe the last line of output, which reports, among other items, the number
of fragments and the degree of fragmentation. To correct a fragmentation
problem, run ufsdump(1M) and
ufsrestore(1M) on the ufs
filesystem.
November 29, 2021 | OmniOS |