home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.sun.misc
- Path: sparky!uunet!hela.iti.org!lokkur!scs
- From: scs@lokkur.dexter.mi.us (Steve Simmons)
- Subject: Re: Why does OW leave all kind of garbage in tmp?
- Message-ID: <1992Aug18.112409.24335@lokkur.dexter.mi.us>
- Organization: Inland Sea
- References: <1992Aug17.133855.14134@homebase.vistachrome.com> <1992Aug17.152726.21925@hal.com>
- Date: Tue, 18 Aug 92 11:24:09 GMT
- Lines: 56
-
- ables@hal.com (King Ables) writes:
-
- >> If you delete the lost+found directory there are ways to get it back, but
- >> arbitrarily removing it is not a very good idea.
-
- >If you delete your lost+found directory and fsck had saved corrupted
- >data there that you want, it's gone. You can make a *new* lost+found
- >directory which the appropriate amount of available file slots so that
- >fsck can use it again if it wants to, but you can't get *those* data files
- >back.
-
- Simply recreating the directory is not enough. You need to create it
- with enough empty slots that lots of found files can be placed in it
- without requiring any actual disk space allocation.
-
- Some systems have a utility to create lost+found directories with all
- the empty slots. Suns don't appear to (or its somewhere I haven't looked),
- but you can do the same job with the csh commands:
-
- mkdir lost+found
- cd lost+found
- touch {0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
- rm *
-
- This will create 1000 slots, which is probably sufficient. :-)
-
-
- Another useful lost+found tool is this script:
-
- ======================= clip here ==============================
- LOG=log
- for MOUNT in `gawk '{ if ( $3 == "4.2" ) print $2 }' < /etc/fstab`
- do
- if [ -d $MOUNT/lost+found ] ; then
- cd $MOUNT/lost+found
- if [ 2 != `ls -a | wc -l` ] ; then
- echo There are files to look at in $MOUNT/lost+found.
- fi
- else
- echo Warning -- no lost+found directory in $MOUNT.
- fi
- done > $LOG
- if [ 0 != `wc -l < $LOG` ] ; then
- mail -s "Lost+Found Errors Found At Boot" root < $LOG
- fi
- rm -f $LOG
- ======================= clip here ==============================
-
- It uses gawk, but should work perfectly well with awk. The best place
- for it is one of your rc files after the fscks are done. If there are
- any missing lost+found directories or any found files in those
- directories, root will be sent mail about it.
- --
- "Voodoun is a very interesting religion for the whole family, even those
- members of it who are dead."
- -- "Good Omens", by Neil Gaiman and Terry Pratchett
-