Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!haven!adm!xadmx!rbj@dsys.ncsl.nist.gov From: rbj@dsys.ncsl.nist.gov (Root Boy Jim) Newsgroups: comp.unix.wizards Subject: BSD filesystem defragmentation question Message-ID: <20630@adm.BRL.MIL> Date: 16 Aug 89 20:36:04 GMT Sender: news@adm.BRL.MIL Lines: 31 ? From: Chris Torek? In article <1886@marvin.Solbourne.COM> dce@Solbourne.COM (David Elliott) ? writes: ? >OK, let's increase the file size to 10486 bytes, which is 11 ? >fragments. ? > ? >At this point, is the data moved on the disk so that my file ? >comprises one block and 3 fragments, or is it left as fragments? ? The file will occupy one block and 3 fragments-within-one-block. ? The exact mechanism by which a fragment expands, or becomes a ? block, depends on which version of 4BSD and on how many blocks ? and fragments are free and on whether the process is `well-behaved' ? when it comes to writing files. (A well-behaved process writes ? full blocks on full-block boundaries. This is most common, ? although in 4.2BSD [but not 4.3BSD] /usr/ucb/vi was ill-behaved, ? writing 1K at a time.) OK, trick question for wizards! How many fragments does a file of size ((1 << 20) + 1) have? Answer: zero! Only direct blocks are fragmented! Top of page 208 in the 4.3 book. Chris, was this true in 4.2 as well? ? In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) ? Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris Root Boy Jim Have GNU, Will Travel.