Thursday, February 23, 2017

Sun Solaris File System Management

If you are working on Sun Solaris operating system and wants to more grow up on this operating system, you definitely like my post because in this post I will explain you the most important thing file system management.

I will describe all the file systems command in this post which is generally used on all Solaris version operating system. Using these command you are more familiar about the file system management on Solaris server.

How to create a new file system on Solaris Server:-

We are using two type of file system (UFS & ZFS) on Solaris operating system. In this example we are taking UFS file system as for ZFS file system creation information you can found in my older post.

  • Create a new file system-
          sun01#newfs /dev/rdsk/c0d0s1
  • View minfree value-
          sun01#fstyp -v /dev/rdsk/c0d0s1 | head
  • Set minfree value for a new file system-
          sun01#newfs -m 2 /dev/dsk/c0d0s1
  • Change minfree value on an existing file system-
          sun01#tunefs -m 1 /dev/rdsk/c0d0s1

In the above my example, my hard disk name is c0d0s1.

How to Monitoring File System Usage on Solaris Server:-

In Sun Solaris Server , you must be aware about the capacity of file system. You can check file system usage using several commands.
  • Display the capacity of file systems in readable format-
          sun01#df -h
  • Display the disk allocation size in Kbytes-
         sun01#df -k
  • Display the available space on a device or disk-
         sun01#df -k /dev/dsk/c0d0s1
  • Display the disk usage in readable format-
          sun01#du -h /home
  • Display the disk usage including files-
          sun01#du -ak /home
  • Display the disk usage in summary format-
          sun01#du -sk /home

How to Checking or repair the File System on Solaris Server:-

We can repair and check the file system on Sun Solaris server. You can use the "fsck" command for this one but make sure you never run the fsck command on a mounted file system. You need umount file system first then run repair or check the Solaris file system.

  • Check or repair an unmounted filesystem-
           sun01#fsck /dev/rdsk/c0d0s1
  • Check or repair using the mount point directory-
          sun01#fsck /export/home 
  • To use a backup superblock number on Solaris server-
          sun01#fsck -o b=32 /dev/rdsk/c0d0s1 
  • To use an alternative superblock number-
          sun01#fsck -o b=518432 /dev/rdsk/c0d0s1

Hope, you are like my this post. Please comment on the post if you are facing any issue. I will try to resolve your issue as soon as possible.

No comments:

Post a Comment