home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / sun / misc / 3745 < prev    next >
Encoding:
Text File  |  1992-08-18  |  2.4 KB  |  67 lines

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