Operating System - HP-UX
1820566 Members
2038 Online
109626 Solutions
New Discussion юеВ

Re: fsck File System Check & Repair

 
SOLVED
Go to solution
LG Porter
Frequent Advisor

fsck File System Check & Repair

A) What is the correct parameters to use when performing a fsck on a JFS file system that will not mount? B) Can fsck be used to check a file system while it is mounted? (That is validate that the file system and the disks are ok? Sometimes Oracle will log messages that suggest that a disk maybe bad even though vgdisplay and lvdisplay indicate everything is ok.)
4 REPLIES 4
S.K. Chan
Honored Contributor

Re: fsck File System Check & Repair

From Technical DB .. (hope this helps ..)

Since a JFS file system records pending file system updates in an intent log, fsck typically runs an intent log replay rather than a full structural file system check on a JFS file system.

But, if the file system detects damage or the intent log replay operation detects damage, an indication that a complete check is required is placed in the super-block and a full check is performed. A full file system check will always perform any pending extended inode operations without operator interaction.

To manually run fsck on a JFS file system, use the following syntax:

# /usr/sbin/fsck [-F vxfs] [-V] [-PmnNyY] [-o full,nolog] [... ]

If is not specified, fsck reads the table in /etc/fstab, using the first field to determine which file system to check.

-F vxfs Specify the VxFS file system type.
-V Echo the completed command line, but perform no other action. The command line is generated by incorporating the user specified options and other information derived from /etc/fstab. This option allows the user to verify the command line.

-y|Y Assume a "yes" response to all questions asked by fsck.Additionally, if the file system requires a full file system check after the log replay, or if the nolog suboption causes the log replay to be skipped and the file system is not clean, then a full file system check is performed.

-n|N Assume a "no" response to all questions asked by fsck; do not open the file system for writing. Log replay is not performed. A full file system check is performed.


fsck to produce messages that identify the device being checked. NOTE: With VxFS, -P is used by default.

-o Specify VxFS file system specific options. These options can be a combination of the following in a comma-separated list:
full Perform a full file system check.
nolog Do not perform log replay. This option may be used if the log area was physically damaged.
Sanjay_6
Honored Contributor
Solution

Re: fsck File System Check & Repair

Hi Larry,

Don't do a fsck on a filesystem that is mounted. This may corrupt your filesystem.

To do a fsck on an unmounted filesystem, first try,

fsck -F vxfs /dev/vg_name/rlv_name

you can use -y option with the fsck command, it will then take yes for all questions which it would have otherwise been interactive.

Hope this helps.

regds
Luc Bussieres
Frequent Advisor

Re: fsck File System Check & Repair

Hi,

The command to run a full fsck on a vxfs filesystem is:
fsck -F vxfs -o full /dev/vg??/rlvol?

You should not run an fsck on a mounted filesystem since some information may still be in the buffer cache that the kernel keep and since the information on disk is not coherent until the cache is emptied, fsck will almost always find some problems with the filesystems on disk even if there is none and if you try to repair them you may corrupt the information on disk.

Luc
La r├Г┬йponse est le malheur de la question
Helen French
Honored Contributor

Re: fsck File System Check & Repair

Hi Larry,

a) What is the correct parameters to use when performing a fsck on a JFS file system that will not mount?

Well ..it 'depends'. An fsck without any option can be the first one. If you see the man pages of fsck, that will list you all options and you can use the one which best suitable for your situation.

# man 1M fsck_vxfs

Normally when you invoke fsck without option, it will tell you if you need to include any options for more checking on the file system ( eg: full file system check needed )

For a full and complete checking of the file system, do this:

# fsck -o full /dev/vgxx/rlvolx

b) Can fsck be used to check a file system while it is mounted?

You can use fsck, but it is not advisable. When you invoke fsck on a mounted FS, it will prompt you for confirmation. Unmount the FS and then do the fsck. Also for disk related checking, you can use the STM instead of fsck.

HTH,
Shiju
Life is a promise, fulfill it!