Solaris File System Administration
By Yao Lu on 六月 25, 2008
Solaris OS file system is very different from Windows OS.FAT16,FAT32,NTFS are file systems for Windows,But Solaris belong to UNIX architecture .Learning Solaris file system is a difficulty for the beginner.
What is file system? Simply,file system is a directory collections ,and it is used for locating and storing file.
These are so many kinds of file systems for Solaris such as ufs、hsfs、pcfs 、NFS、Tmpfs、Profs、Swapfs and Devfs. For user, file system frame is a multi-level tree made of directory and file.
Demo 1 Create UFS file system
Firstly,we must mark off disks into different partitions,and then we create new file system by using 'newfs' on these partitions.Lastly, these file systems are installed into root directory.
#newfs /dev/rdsk/c1t1d0s0 ----create file system on c1t1d0s0.
# tunefs -m 4 /dev/rdsk/c1t1d0s0 ----tune reservation space,such as increasing 3 percent.
#df -k | grep c1t1d0s0
Demo 2 Mount and Umount
Generally, we must mount the file system to designated directory,and then we can read and write disk by the mounted point.
#mount /dev/dsk/c0t0d0s0 /export/home
#mount -o option option ……
#fstyp /dev/rdsk/ c0d0t0s1 -----check the file ,local or remote?
#mount -F hsfs -o ro /dev/dsk/c0t0d0s0 /cdrom -----mount cdrom file system
#fuser -c -k /export/home ----fuser kill all of processors which belong to this file system
Demo 3 ----Fsck
Power fault ,software fault and hardware fault may result in that file systems are damaged. Fsck command check data consistency of file system,and repaire the damage( Under simple user mode).
#fsck -y /dev/rdsk/c0d0t0s1 -----all of the answers are "yes" in fsck step.
fsck detects a super block damage,and we try to use the super block on 32th sector to repaire the fault(every file system has main super block backup on 32th sector).
#fsck -o b=32 /dev/rdsk/c0t0d0s2
In the end