truncating root directory of a file system

John Chambers jc at cdx39.UUCP
Sat Dec 6 02:08:33 AEST 1986


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



More information about the Comp.unix.wizards mailing list