Monday 21 April 2008

How to create and maintain ufs file system(Solaris)

Creating a New ufs file system
To create a ufs file system,by using the newfs command.
# newfs /dev/rdsk/c1t0d0s0
newfs will ask for comfirmation.To proceed,type y,to terminate,type n.
note : newfs with option -T on smaller file systems that will contain many small files.
warning : newfs with boot slices(s0) or entry slice(s2) may be cause system fail.please use this command carefully.

Checking the File system
fsck , checks the data consistency of a file system and attempts to correct or repair any consistencies or damage found.
# fsck /dev/rdsk/c1t0d0s0
note : option -y to response "yes" every time.

Recovery SuperBlocks
If the fsck command fail because of a corrupted superblock, you can see a message "BAD SUPERBLOCK AT BLOCK #: MAGIC NUMBER WRONG"
you can recovery superblock by using backup superblocks.
# fsck -o b=32 /dev/rdsk/c1t0d0s0
for find another backup superblocks
# newfs -N /dev/rdsk/c1t0d0s0
note : use newfs -N -T,It you use newfs -T to create ufs file system

Monitoring File System Use
df command - Displays the number of free disk blocks
du command - Summarizes disk use
quot command - Summarizes file system ownership

No comments: