Creating a New ufs File System
# newfs /dev/rdsk/c0d1s6 ==> to create a new filesystem
# fstyp -v /dev/rdsk/c0d1s6 | head ==> to view minfree value
# newfs -m 2 /dev/dsk/c0d1s6 ==> to set minfree value for a new filesystem
# tunefs -m 1 /dev/rdsk/c0d1s6 ==> to change minfree value on an existing file system
Checking the File System
Never run the fsck command on a mounted file system.
# fsck /dev/rdsk/c0d1s6 ==> to check an unmounted filesystem
# fsck /export/home ==> to check using the mount point directory
# fsck -o f,p /dev/rdsk/c0d1s6
f - forces a file system check
p - checks and fixes the file system noninteractively (preen). The
program exits immediately if a problem requiring intervention is found.
# fsck -o b=32 /dev/rdsk/c0d1s6 ==> to use a backup superblock
# newfs -N /dev/rdsk/c0d1s6 ==> to list the locations of all the alternative backup superblocks
N - to view the file system parameters without actually creating the file system
# fsck -o b=518432 /dev/rdsk/c0d1s6 ==> to use an alternative superblock number
# newfs -N -T /dev/rdsk/c1t3d0s7
T - allows the file system to be a multi-Terabyte file system
Monitoring File System Use
To display the capacity of file systems
# df -k ==> disk allocation in Kbytes
# df -h ==> human readable format
# df -k /dev/dsk/c0d1s6 ==> to view available space on a device
To display disk usage
# cd /opt
# du -k ==> disk usage in kilobytes
# du -h /opt | more ==> human readable format
# du -ak /opt ==> disk usage including files
# du -sk /opt ==> summary of disk usage
# quot -af ==> to display disk space used by users on all mounted file systems in kb
a - reports on all mounted file systems
f - number of files
# quot -f /dev/dsk/c0d1s6 ==> to display disk space used by users for a specific file system