Information Technology Reference
In-Depth Information
created. The -
v
command-line argument is used to preview the file system
parameters. Also most of the
mkfs
command-line arguments can be specified
as
newfs
command-line arguments. If any of these parameters are specified,
they will override any calculated parameters and be passed to the
mkfs
com-
mand. See the
newfs(1M)
manual page for details.
If using the
mkfs
command directly, the
-F
command-line argument should
be included to identify the type of file system to create. If not specified, the
file system type listed in the
/etc/default/fs
file is used by default. The
default type for local (disk-based) file systems is UFS. Additional parameters,
such as block size and disk geometry (sectors per track, tracks per cylinder,
and so on), can also be specified.
The commands used to create file systems expect raw (character) logical device
names. In addition, the only type of disk-based file system that can be created on a
standard Solaris 9 operating system is UFS. However, when a floppy disk is format-
ted, the PCFS is created on the disk automatically, because the PCFS format is the
same as the DOS disk format.
Checking and Repairing File Systems
File systems are damaged when the data that defines the file systems is cor-
rupted. This can be caused by either software errors or failures of the under-
lying physical disk hardware. The
fsck(1M)
command checks (audits) the
logical consistency of a file system and attempts to make the repairs neces-
sary to eliminate any inconsistency. The
fsck
command checks the
superblock, cylinder group blocks, inodes, indirect blocks, and data blocks.
The
fsck
command is typically executed when a file system is mounted auto-
matically as part of system boot. It can also be executed manually on one or
more file systems. Only unmounted file systems should be checked and
repaired, because changes can affect programs accessing the file system, in
turn causing even more damage. One or more raw logical device names (par-
titions) can be specified as command-line arguments. Like the
mkfs
com-
mand, the
-F
command-line argument should be used to specify the type of
file system being checked. The following listing shows the
fsck
command
checking the 1GB file system previously created:
# fsck -F ufs /dev/rdsk/c0t2d0s4
** /dev/rdsk/c0t2d0s4
** Last Mounted on
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
2 files, 9 used, 288846 free
#