-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
James Melin wrote:
|
| Is it possible to force an FSCK on all file systems defined to a Linux
| guest at IPL? I am seeing some errors in /opt/warn that are concerning me
| on a couple of file systems though the systems appear to be running at the
| moment. Typically it's been doing it after x many mounts or after x many
| days without being checked.
|
Hey, James.
Forcing a fsck on one particular filesystem can be achieved by simply
touch(1)ing a file called "forcefsck" at the root of that filesystem, as
suggested by Christian Bornträger.
For example, if you would like to force a fsck on root and /opt
filesystems, you can simply save this script to /etc/init.d/forcefsck
and run "insserv forcefsck":
- ----CUT-HERE----
#!/bin/sh
### BEGIN INIT INFO
# Provides: forcefsck
# Required-Start:
# Required-Stop:
# Default-Start: 0 6
# Default-Stop:
# Short-Description: Force a fsck upon subsequent IPL.
# Description: Force a fsck upon subsequent IPL.
### END INIT INFO
# This is the file you should list the mount points to be fsck'd
MPOINT_LIST="/etc/sysconfig/force_fsck_on_ipl"
if [ ! -r "${MPOINT_LIST}" ]; then
~ echo "$0: No mount point list found."
~ exit 0
fi
case $1 in
~ start)
for $mpoint in `cat ${MPOINT_LIST}`; do
echo "$0: Forcing fsck on ${mpoint} upon next IPL."
touch ${mpoint}/forcefsck
done
~ ;;
~ *)
echo "Usage: $0 start"
~ ;;
esac
- ----CUT-HERE----
As pointed out in the script, list the filesystems you want to have
checked upon IPL in /etc/sysconfig/force_fsck_on_ipl, so in the above
example, you simply:
$ echo "/" > /etc/sysconfig/force_fsck_on_ipl
$ echo "/opt" >> /etc/sysconfig/force_fsck_on_ipl
and that's it.
| Also, is it possible to run an integrity check of a file system while
it is
| mounted with some other utility? FSCK of course warns about possibly
| frelling your filesystem to the center of the earth if you use it on a
| mounted file system. Just wondering what FS checker might be available
| that I don't have to schedule downtime with customers in order to use it
The standard practice when system is left in an inconsistant mode after
something bad happens is this:
~ 1. tell system to go into single-user mode:
$ telinit 1
...
Login:
~ 2. log in as superuser
~ 3. unmount all filesystems you want to check
~ 4. check them using
$ fsck -v -f /dev/whatever
~ 5. if one of the filesystems you want to check is being used,
~ so you can't unmount it, at least remount it read-only and
~ then check it; usually, if errors are fixed during recovery,
~ you will be prompted to reboot:
$ mount / -o remount,ro
$ fsck.ext3 -vf /dev/rootpartition
...
fsck.ext3: ***** FILE SYSTEM WAS MODIFIED *****
fsck.ext3: ***** REBOOT LINUX *****
And that's about all there is to it. Normally, you should be capable to
remount a filesystem in read-only mode regardless of what's going on
with the machine, but it may cause some of your applications to freak
out, that's why this kind of maintenance is ONLY advised in single-user
mode.
Prior to doing that on a z/Linux, check how your networking scripts and
especially, the sshd daemon, are configured to behave in single-user
runlevel. I don't think they'll be running (infact, SLES9 kills *every*
single process but init when going to rl 1), so be prepared to do that
by reconnecting to the VM user with a 3270 of some kind and perform the
tasks there somehow, which might involve running a getty or similar, on
3270 port (see about /etc/inittab).
If you also have other users logged into the guest, they might place
additional restrictions on what you can do (f.e., you cannot umount a
partition that contains a directory which is the CWD of a process,
including shells, and it is polite to consider they might be doing
something important to them anyways), so you might want to hint them
beforehand:
~ $ echo "System going into maintenance mode in 10 minutes." | wall; \
sleep 600; /sbin/telinit 1
Hope to have helped,
- --
Grega Bremec
gregab at p0f dot net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFC8e38fu4IwuB3+XoRAjPuAJ0QdfqGfrf5/EAjJYDyKjrkOeqLAwCbBb/Q
S57KrAZjNBRoav281vK4XT0=
=ubwo
-----END PGP SIGNATURE-----
----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390