Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Jul 1998 13:05:31 +0100
From:      Adam Nealis <adamn@criterion.canon.co.uk>
To:        freebsd-questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: File Systems and Disk Space
Message-ID:  <35BC6D0B.A42DB304@csl.com>
References:  <35B8BDFF.6A18C7E8@infoserve.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?35BC6D0B.A42DB304>