From owner-freebsd-questions Mon Jul 27 05:09:32 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA05511 for freebsd-questions-outgoing; Mon, 27 Jul 1998 05:09:32 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from mailhost.criterion.canon.co.uk (cruella.criterion.canon.co.uk [194.223.249.254]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA05495 for ; Mon, 27 Jul 1998 05:09:22 -0700 (PDT) (envelope-from adamn@criterion.canon.co.uk) Received: from csl.com (hermes.criterion.canon.co.uk [194.223.249.13]) by mailhost.criterion.canon.co.uk (8.8.8/8.7.3) with ESMTP id NAA18971 for ; Mon, 27 Jul 1998 13:03:46 +0100 (BST) Message-ID: <35BC6D0B.A42DB304@csl.com> Date: Mon, 27 Jul 1998 13:05:31 +0100 From: Adam Nealis Organization: Criterion Software, Ltd. X-Mailer: Mozilla 4.05 [en] (X11; I; Linux 2.0.34 i686) MIME-Version: 1.0 To: freebsd-questions Subject: Re: File Systems and Disk Space References: <35B8BDFF.6A18C7E8@infoserve.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG It's good to stop lurking and help out once in a while! John Derk wrote: > Hi. > > A df on my system has indicated the /usr slice is at 100% of capacity > (of 479,783k). I have only been running bsd for a short while. I have a > win95 box with a 1.7G hd--where about 650M are allocated to bsd. I did > use /stand/sysinstall to add some ports/packages, but I didn't think > they were going to take up too much space. Also, there were frequent > onscreen reports of some kind of error while the packages were being > added. I know, I know: "WHAT error?" you ask. Unfortunately, I have no > log of this to offer, but I guess it was obviously to do with running > out of space, no? At any rate, this brings up the question: > > If a guy has about 650M to work with, wants to run freebsd 2.2.6, and > basically can content himself with being able to network two PCs, run > netscape (& XWindows), and learn to set up his printer, how feasable is > it? I can think of two ways to address your disk space problem. Both involve dickering with the way the partition(s) is/are laid. The first shouldn't require reformatting/newfs'ing, the second does (I think). OK, when a partition is initialised, newfs(8) is used. If you took the defaults (which you probably did if you installed via the supplied setup stuff), then you have a spare 8% of capacity on the disk available. This is used by the system to avoid disk thrashing during heavy i/o. Also, root processes can take disk usage beyond 100% (i.e. use up some of that 8% "excess"). To reclaim this, without zapping your partition, look at the -m param in tunefs(8). This dynamically frees up as much of the reserved space as you require. Apparently it is a Bad Thing to go below 5%. I don't know if this applies to large disks (for a 1GB disk, 1%=1.024MB). The other way requires a reformat, using newfs(8). Again, the man page gves you loads of options. As well as -m, you get to specify the number of inodes with the -I option. i-node space determines how many files/directories you can have on a filesystem. Reducing the number of i-nodes increases available space. > Also: I plan to probably reinstall bsd from scratch, unless there is an > easy way to find out what I can delete to regain the needed space. Is > there? See above... > Next, a documentation question: I tried my best to find out about the > above issues by checking the Handbook and manpages, etc., but could not > find a comprehensive explanation. I had hoped to find info about the > following: > > 1. How to determine optimal file system sizes for setup of /swap, > /usr, and so forth Usual rule of thumb for swap is 2X physical RAM - but more doesn't hurt (disk space permitting). I always put in as much as I can because I may add more RAM later. The others depend on what you'll be doing with the box. > 2. How to prevent overloading of various disk slices (e.g., I know > cron is supposed to be something to watch out for) You could use the cron to kick off a script periodically that does df on your local disks and if the capacity goes above a certain threshold, send you an e-mail as a warning. > 3. Which files to suspect first, when the file system is at > capacity. I.e, which files most commonly proliferate to the point where > all space gets used up /var/log is a good place to look - for that reason, I always have /var as a separate partition. > Can someone suggest a specific source that addresses any/all of the > above? (The more the better, because I would like to get a detailed > understanding) May I suggest the FAQ at the FreeBSD site, the Handbook and HOWTOs as well. I hope this, and any more replies you get, help somewhat, Adam. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message