jay@ncspm.ncsu.edu (Jay C. Smith) (08/22/89)
From article <5176@ucdavis.ucdavis.edu>, by cck@deneb.ucdavis.edu (Earl H. Kinmonth): > On some systems, such as SCO Xenix, an approach such as the following > has the effect of defragmenting file systems. > (a) backup up the file system you want to defragment (or at least > major directory trees in that system); > (b) verify the backup; > (c) remove the backed up files; > (d) fsck -s > (e) restore from the back up. A faster alternative to steps c and d is mkfs. This will have the effect of removing all files and rebuilding the free list and it runs a lot faster than "rm -fr *" fo
jay@ncspm.ncsu.edu (Jay C. Smith) (08/30/89)
In article <1788@ncsp24Aug198920:30:10GMT> jay@ncspm.ncsu.edu (Jay C. Smith) writes: [stuff I didn't write....] I'm not sure what's going on here, since I don't read these newsgroups and I didn't post the article. The subject line matches a posting I made in rec.arts.sf-lovers, and it looks like the message ID was somehow screwed up (I may have accidentally done this, though I'm not sure how). Apologies. Apparently this article also went to comp.sources.wanted, a newsgroup my machine does not receive and that I cannot post to. -- "Good. For a minute I thought we were in trouble." --------------------------------------------------------------------- Jay C. Smith uucp: ...!mcnc!ncsuvx!ncspm!jay Domain: jay@ncspm.ncsu.edu internet: jay%ncspm@ncsuvx.ncsu.edu
bob@wyse.wyse.com (Bob McGowen Wyse Technology Training) (09/06/89)
In article <1788@ncsp24Aug198920:30:10GMT jay@ncspm.ncsu.edu (Jay C. Smith) writes: >From article <5176@ucdavis.ucdavis.edu>, by cck@deneb.ucdavis.edu (Earl H. Kinmonth): >> On some systems, such as SCO Xenix, an approach such as the following >> has the effect of defragmenting file systems. >> (a) backup up the file system you want to defragment (or at least >> major directory trees in that system); >> (b) verify the backup; >> (c) remove the backed up files; >> (d) fsck -s >> (e) restore from the back up. > >A faster alternative to steps c and d is mkfs. This will have the effect >of removing all files and rebuilding the free list and it runs a lot >faster than "rm -fr *" fo A point to remember is that the -s and -S options to fsck only reorganize the free list. This puts the blocks in sequence but there WILL STILL be gaps. Thus it reduces but does not eliminate fragmentation unless all files are first removed, as noted by Earl in his comment above. Another factor affecting the degree of defragmentation would be the frequency with which the fsck is run. I have set up a cron entry that runs it with the -S option on a daily basis (in the wee hours of the morning). The -S form will only reorganize the free list if there are no problems found in the file system structure and can be run while in multi-user mode without apparent problems (I have been doing this for nearly a year now. If anyone has any info on why I shouldn't, I'd sure like to know!). It is still worthwhile to occasionally backup ALL files in an fs and do the mkfs on it, but the method I've outlined has helped keep my system relatively free of fragmentation problems longer than without it. I am running XENIX 2.3.2 on a 386 system with ESDI 150M HD. Bob McGowan (standard disclaimer, these are my own ...) Customer Education, Wyse Technology, San Jose, CA ..!uunet!wyse!bob bob@wyse.com
doug@letni.UUCP (Doug Davis) (09/07/89)
In article <2402@wyse.wyse.com> bob@wyse.UUCP (Bob McGowen Wyse Technology Training) writes: >Another factor affecting the degree of defragmentation would be the >frequency with which the fsck is run. I have set up a cron entry that >runs it with the -S option on a daily basis (in the wee hours of the >morning). The -S form will only reorganize the free list if there are no >problems found in the file system structure and can be run while in >multi-user mode without apparent problems WRONGGGGGGGG!!!!!!!! >(I have been doing this for nearly a year now. >If anyone has any info on why I shouldn't, I'd sure like to know!). This is like saying, "I have a revolver, with only one bullet in it, and in the wee hours of the morning, when noone is around I put the barrel in my ear, give the cylinder a really good spin and then pull the trigger. I have been doing that for nearly a year and haven't shot myself yet." Isn't that what you are saying? ;-) Case in point, there exists a race condition between the time fsck figures out that there were no "errors" and the time that it actually writes the newly organized freelist out. During this time, small as it may be, something could open up a file and allocate a block or two... Guess what happens now.. *BOOM*..... your filsystems dead.. >I am running XENIX 2.3.2 on a 386 system with ESDI 150M HD. I'm sorry.. -- Doug Davis/1030 Pleasant Valley Lane/Arlington/Texas/76015/817-467-3740 {sys1.tandy.com, motown!sys1, uiucuxc!sys1 lawnet, attctc, texbell} letni!doug "AIX a three letter word, and it's BLUE" --jfh@rpp386 Yes John, but you need some good old-fashoned *FOUR* letter words to describe it