>>>>>>>>>>>>> Original Request >>>>>>>>>>>>>>>>>>>>>>>>>>>>
Hello Sun-managers
Is there a way to cause both SunOS 4.1.x and SunOS 5.x computers to
boot and force a complete slow fsck on the various filesystems while booting.
Currently the fsck checks some flag that says this file system is okay.
Well I want it to ignore the flag and do a complete check.
Yes I am prepared to wait 20 minutes or more for it to boot.
Does anyone know how to modify the /etc/rc* files for BOTH OSs.
Ideally I would like a 'slowboot' command that will create a file or
something such that when the machine boots it will see this file and
do a complete fsck run.
Please spare me the praises of unix filesystems being quite bug free and
this is not needed and there are patches and ...
Trust me, there is not a unix machine alive today that would not benefit
from a good slow boot once a month.
Plus I do NOT WANT to boot off the cdrom, do manual fsck and reboot off the
disk. I have done this too many times with fsck fixing errors.
This is why I want a slowboot command to avoid this single-usr stuff.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Special thanks to the dozens of people who submitted answers, there are
simply too many to mention. Many people supplied various ideas and
ultimately various pieces that were all fitted together.
Many of you mentioned to read the man pages and a few were kind enough
to give more details.
The spirit of unix has always been to share information and then modify
it to your needs. Unfortunately some of you belong in the military on
the front lines and not behind a unix workstation since you only know how
to handle a flame thrower.
A few amateur psychologists replied with their diagnosis of my initial
request. If you stop trying to interpret between the lines it would be
more accurate for you to read exactly what is written. Nobody knows
everything, especially myself, so why do you think this request appeared.
Anyway, enough preaching, here is are the tested solutions.
Enjoy and thank all of you again.
>>>>>>>>>>> Solution SunOS 4.1.x (Solaris 1.x) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# cd /usr/etc
# cp fastboot slowboot
# vi slowboot
- change the line
cp /dev/null /fastboot
- to the line
cp /dev/null /slowboot
# ln -s ../usr/etc/slowboot /etc/slowboot
# vi /etc/rc
- find the lines
if [ -r /fastboot ]; then
rm -f /fastboot
- change to the lines
if [ -r /fastboot ]; then
rm -f /fastboot
elif [ -r /slowboot ]; then
rm -f /slowboot
# vi /etc/rc.boot
- find the lines
if [ $1x = singleuserx ]; then
echo "checking / and /usr filesystems"
intr fsck -p -w / /usr
error=$?
what="Fsck"
else
echo "checking filesystems"
intr fsck -p -w
error=$?
what="Reboot"
fi
- change them to
if [ $1x = singleuserx ]; then
if [ -r /slowboot ]; then
echo "checking / and /usr filesystems slowly"
intr fsck -f -p -w / /usr
error=$?
/bin/rm /slowboot
else
echo "checking / and /usr filesystems"
intr fsck -p -w / /usr
error=$?
fi
what="Fsck"
else
if [ -r /slowboot ]; then
echo "checking filesystems slowly"
intr fsck -f -p -w
error=$?
/bin/rm /slowboot
else
echo "checking filesystems"
intr fsck -p -w
error=$?
fi
what="Reboot"
fi
>>>>>>>>>>> Solution SunOS 5.1.x (Solaris 2.x) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# vi /sbin/slowboot
- add the following lines
#! /bin/sh
cp /dev/null /slowboot
cp /dev/null /reconfigure
/sbin/init 6
# chmod 755 /sbin/slowboot
# ln -s ../sbin/slowboot /etc/slowboot
# vi /etc/rcS /sbin/mountall
- find the lines
/usr/sbin/fsck -F $2 -m $1 >/dev/null 2>&1
if [ $? -ne 0 ]
- change it to the lines
/usr/sbin/fsck -F $2 -m $1 >/dev/null 2>&1
if [ $? -ne 0 -o -r /slowboot ]
- find the lines
ufs) foptions="-o p"
;;
- change it to the lines
ufs) if [ -r /slowboot ]; then
echo checking slowly
foptions="-o f -o p"
else
foptions="-o p"
fi
;;
# vi /sbin/mountall
- find the lines
/usr/sbin/fsck "-m" "-F" $fstype $fsckdev >/dev/null 2>&1
case $? in
0) /sbin/mount "-F" $fstype $OPTIONS $special $mountp
- change it to the lines
/usr/sbin/fsck "-m" "-F" $fstype $fsckdev >/dev/null 2>&1
case $? in
0) if [ -r /slowboot ]; then
checkfs $fsckdev $fstype $mountp
fi
/sbin/mount "-F" $fstype $OPTIONS $special $mountp
- at the very end of this file add the following lines
if [ -r /slowboot ]; then
/usr/bin/rm -f /slowboot
/sbin/sync
fi
This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:17 CDT