11-28-2012 12:40 PM
Is there a way to define that an fsck command needs to be run on each file system between the time the dg is imported and the file systems are actually mounted? In case we have an abnormal shutdown we'd like to make sure we check the file systems for errors.
Solved! Go to Solution.
11-28-2012 02:22 PM
The mount agent does an fsck if required - see extract from bundled agent guide for FsckOpt attribute:
Use this attribute to specify options for the fsck command. Youmust correctly set this attribute for local mounts. If the mountprocess fails, the fsck command is executed with the specifiedoptions before it attempts to remount the block device. Its valuemust include either -y or -n. Refer to the fsck manual page for moreinformation.
BLOCK_DEVICE=$2 LOCKFILE=/tmp/.{$3}.DO_NOT_REMOVE case "$1" in start) touch $LOCKFILE fsck $BLOCK_DEVICE;; stop) rm $LOCKFILE ;; monitor) if [ -a $LOCKFILE ] then exit 110 else exit 100 fi ;; *) echo "Usage: $0 {start|stop|monitor} block_device lock_file exit 1 ;; esac
Then create a resource using Application agent like:
Application fsk_vol1 ( StartProgram = "/opt/VRTSvcs/bin/fsck.sh start /dev/vx/dsk/mydg/vol1 vol1" StopProgram = "/opt/VRTSvcs/bin/fsck.sh stop /dev/vx/dsk/mydg/vol1 vol1" MonitorProgram = "/opt/VRTSvcs/bin/fsck.sh monitor /dev/vx/dsk/mydg/vol1 vol1" )
and make this resource dependent on diskgroup resource and make associated mount point dependent on this application resource
Mike
11-28-2012 02:22 PM
The mount agent does an fsck if required - see extract from bundled agent guide for FsckOpt attribute:
Use this attribute to specify options for the fsck command. Youmust correctly set this attribute for local mounts. If the mountprocess fails, the fsck command is executed with the specifiedoptions before it attempts to remount the block device. Its valuemust include either -y or -n. Refer to the fsck manual page for moreinformation.
BLOCK_DEVICE=$2 LOCKFILE=/tmp/.{$3}.DO_NOT_REMOVE case "$1" in start) touch $LOCKFILE fsck $BLOCK_DEVICE;; stop) rm $LOCKFILE ;; monitor) if [ -a $LOCKFILE ] then exit 110 else exit 100 fi ;; *) echo "Usage: $0 {start|stop|monitor} block_device lock_file exit 1 ;; esac
Then create a resource using Application agent like:
Application fsk_vol1 ( StartProgram = "/opt/VRTSvcs/bin/fsck.sh start /dev/vx/dsk/mydg/vol1 vol1" StopProgram = "/opt/VRTSvcs/bin/fsck.sh stop /dev/vx/dsk/mydg/vol1 vol1" MonitorProgram = "/opt/VRTSvcs/bin/fsck.sh monitor /dev/vx/dsk/mydg/vol1 vol1" )
and make this resource dependent on diskgroup resource and make associated mount point dependent on this application resource
Mike
11-29-2012 07:25 AM
Mike - now in see (in some doc provided by the consultant that set this all up) that fskcopt is defined:
hares -modify <resource_name> FsckOpt %-y
But I've never seen an fsck run when the resource was started. I know we've had some start ups after abnormal shutdowns and I would have expected to see some evidence of the fsck while the online process was running.
We do believe we have some file system corruption - which is why I ask.
Scott
11-29-2012 08:49 AM
I believe Fsck is only run if the mount fails and if Fsck is set to "n", then if mount fails, then agent does not try an fsck.
Mike
11-29-2012 12:30 PM
Thanks guys. I think we'll try to schedule some down time to run an fsck just to be sure.