Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!columbia!rutgers!ll-xn!adelie!cdx39!jc From: jc@cdx39.UUCP (John Chambers) Newsgroups: comp.unix.wizards Subject: truncating root directory of a file system Message-ID: <511@cdx39.UUCP> Date: Fri, 5-Dec-86 11:08:33 EST Article-I.D.: cdx39.511 Posted: Fri Dec 5 11:08:33 1986 Date-Received: Sun, 7-Dec-86 03:08:10 EST Lines: 36 Keywords: / /usr /usr/lib truncation Hey, here's a good puzzle for a Unix file-system wizard. You know how some directories (like /usr/spool/uucp) can get really huge, and then, even if most of the files go away, the directory stays large, giving poor performance for some applications. The usual solution is to rebuild the directory - you rename it, create a new one in its place, and moving the contents from the old one to the new. Well, there's a case where this doesn't work too well. This is the root directory of a file system. If you do the usual, the new directory isn't the first one in the inode table, and all hell breaks loose when you try to delete the old one. What happens when you mount a file system whose root directory has been rm'd, you just wouldn't believe! Typical directories are / (of course), /usr, /usr/lib, and occasionally others for various 'user' disks. We have a machine on which, for reasons too complicated to explain here, has the following: drwxrwxr-x55 root sys 18880 Nov 24 17:17 /user This is a root directory of a file system. There are about 75 directories under this one, so it only needs to be about 1200 bytes in size. Is there a way to shrink it down somewhat? On systems with the ftrunc() system call, there is an obvious solution. Our SYS5 doesn't have ftrunc(), so there seems to be no way to do the job. Or is there? -- John M Chambers Phone: 617/364-2000x7304 Email: ...{adelie,harvax,inmet,mcsbos,mit-eddie,mot[bos],rclex}!cdx39!{jc,news,root,usenet,uucp} Smail: Codex Corporation; Mailstop C1-30; 20 Cabot Blvd; Mansfield MA 02048-1193