Xref: utzoo comp.unix.aix:3869 comp.unix.internals:2232 Path: utzoo!news-server.csri.toronto.edu!rutgers!uwm.edu!wuarchive!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!unmvax!uokmax!servalan!rmtodd From: rmtodd@servalan.uucp (Richard Todd) Newsgroups: comp.unix.aix,comp.unix.internals Subject: Re: file fragmentation Keywords: fragmentation, UNIX Message-ID: <1991Mar6.000156.27641@servalan.uucp> Date: 6 Mar 91 00:01:56 GMT References: <476@bally.Bally.COM> <3412@unisoft.UUCP> Distribution: usa Organization: Ministry of Silly Walks Lines: 45 greywolf@unisoft.UUCP (The Grey Wolf) writes: ><476@bally.Bally.COM> by siva@bally.Bally.COM (Siva Chelliah/50000) ># I have few questions : ># 1 ) Is there a way to find out the fragmentation of a file system ># (like the Norton utility for DOS)? >What kind of filesystem -- Berkeley's Fast File System or System V's >Usel^H^H^HNIX filesystem? >If it's Berkeley, you can just run fsck -n on it. >If it's System V, you can just forget it. Actually, if it's a System V Slow Filesystem :-), there is a program called "fsanalyse" lurking in one of the source group archives which can be used to report the fragmentation state of your filesystem. As for Berkeley Fast File System, I'm not sure if "fsck -n" will report what the guy's after. There seems to be two things denoted by the term "fragmentation": 1. the presence of files that are in non-contiguous blocks on the disk, necessitating lots of seeks in order to read the entire file, and 2. the fraction of the total file space that's allocated from "fragments" (in the BSD FFS sense, i.e. portions of a whole block allocated for the small end-portions of files) instead of from whole blocks. I think the fragmentation that fsck -n reports is the second type, not the first; certainly the second type should be easier to compute, given that fsck presumably already has all the info of how many fragments, etc. are allocated in core already; figuring out how the blocks belonging to each file are scattered about the disk and giving an estimate of (type 1) fragmentation is a more difficult problem. Alas, the amount of "type 1" fragmentation (scattering of files across the disks) is the figure you're interested in if you're wondering how much disk performance you're losing, and I don't know offhand of a package that computes this.... However, all this may be moot for the original poster's purposes. I note that this thread has been crossposted to comp.unix.aix, so I assume the original poster is using an AIX box. On the RISC/6000 flavor of AIX (I don't know about the others) they don't use *either* the BSD or SysV types of filesystem layout; they use a filesystem layout all their own. Good luck in finding utilities that will spit out statistics about (RISC) AIX filesystems; you'll need it.... -- Richard Todd rmtodd@uokmax.ecn.uoknor.edu rmtodd@chinet.chi.il.us rmtodd@servalan.uucp Motorola Skates On Intel's Head!