Saturday, 30 July 2011

1. File System Management (Real Time)


1. File System Management

File System issues are not a regular task.
Basic commands:

# uname –a                              To display the OS name, version, kernel version
# isainfo –b                             Display the kernel bit
# format                                  To find the available disk
# newfs –N                             Display the super block & primary block
Last + found                           consist of inode, data block information
# ls –s *                                   List all the details of files & directories
                                                (for touch 0Mb, for cat 2 blocks)

Q: How to check which file occupying more memory in File system?
A:
# cd /sai                       /sai is the mount point
# du –sh * | sort –nr                // displays the files occupying more memory

Q: Can we increase the file system in Solaris?
A: Generally we cannot increase the File System, but we can increase the File system if continuous cylinders available.

# growfs –M /sai /dev/rdsk/c0d0s6
# df –h /sai

Q: Can we decrease the File System?
A: No way, not possible

Note: to over come this problem SVM (Solaris Volume Manager) use.

How many are using the File System?
# cd /sai
# fuser –u /sai                          // to display how many users using File System

To check the minfree:
#fstyp –v /dev/rdsk/c0d0s0 | grep –i minfree

We can write the script for repeated loop of status:

# while true
> do
> fstyp –v /dev/rdsk/c0d0s0 |grep –i  minfree
> done


To increase the minfree:
# tunefs –m 20 /dev/rdsk/c0d0s0
To decrease the minfree:
# tunefs –m 10 /dev/rdsk/c0d0s0



Issue 1:
If file system exceeds the threshold value then ticket will generate automatically.

A:To resolve this
Check out more size files in File System
Compress the files or delete the old files, if it is so important consult the clients then delete.


Copy /keep the data:
# cp –r /usr/* .

To see old files;
# ls –ltr

To gip:
# gzip aa

To unzip:
# gunzip aa.gz

*** To find top 10 files occupied more size:
# find . –xdev –type f –ls | sort –nr +6|head -10

*** To find top 20 files occupied more size:
# find . –xdev –type f –ls | sort –nr +6|head -20

To move the data:
# mv /etc/aa /opt               move /aa to /opt

Issue 2:
If inodes are corrupted (some times file system also will not work)
A: To resolve:
I will ask the backup team to take backup of file system, & restore it freshly.

Issue 3:
Suppose my File System is 2 GB, its usage is 1GB, but it is showing 100%. Actually it has to show 50%.
A:To resolve:
Simply I unmount & mount the filesystem
Or
If it is not release the space, I will reboot. Then it will show 50%.

Issue 4:
User can not accessing the file system
A: To resolve:
Check out the file permissions, and give the proper permissions to that file.

# mount: mount file system from mnttab
# mountall: mount all file system from vfstab

No comments:

Post a Comment