Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Jul 2004 11:41:44 +0930
From:      Greg 'groggy' Lehey <grog@FreeBSD.org>
To:        Richard Bradley <rtb27@cam.ac.uk>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: /rescue is huge!!
Message-ID:  <20040706021144.GB1069@wantadilla.lemis.com>
In-Reply-To: <200407060259.08128.rtb27@cam.ac.uk>
References:  <200407060229.03972.rtb27@cam.ac.uk> <20040706013649.GN6574@dan.emsphone.com> <200407060259.08128.rtb27@cam.ac.uk>

next in thread | previous in thread | raw e-mail | index | archive | help

--XOIedfhf+7KOe/yw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Tuesday,  6 July 2004 at  2:59:08 +0100, Richard Bradley wrote:
> On Tuesday 06 July 2004 2:36 am, you wrote:
>> In the last episode (Jul 06), Richard Bradley said:
>>> I recently tried to add a user to my FreeBSD box, but was amazed to
>>> find that the / partition was full! I had a look, and the culprit is
>>> the "/rescue" folder, holding 135 statically linked binaries of
>>> nearly 4Mb each, giving a folder size of 491Mb!
>>
>> Check the inode number of each file in /rescue (ls -li /rescue).
>> You'll notice they're all the same, which means they're all hardlinks
>> to the same file.  "du /rescue" should report under 4MB.
>>
>> Your space is probably being taken up somewhere else.
>
> That's very strange if true, because since deleting the "/rescue"
> folder,

I'm a little irritated by the use of the term "folder".  Do you mean
mail?  /rescue is a directory.

> the used space on / has gone from 550Mb+ to 129Mb.

How do you measure this?  If you created a 100 MB partition or
thereabouts, you can't store 550 MB in it.

> I can't check the inodes now, as I have `rm`ed them all!

The thing to do next time is:

  # ls -il /rescue
  total 460
  664332 -r-xr-xr-x  135 root  wheel  3554248 May  8 12:43 [
  664332 -r-xr-xr-x  135 root  wheel  3554248 May  8 12:43 atacontrol
  664332 -r-xr-xr-x  135 root  wheel  3554248 May  8 12:43 atm
  664332 -r-xr-xr-x  135 root  wheel  3554248 May  8 12:43 atmconfig

The first column in this list is the inode number; the third is the
number of links.  Looking at the size, we see:

  # du -sk  /rescue
  3502    /rescue

100 MB should be plenty of space for the root file system assuming
that you have separate /usr and /var file systems (not something that
I recommend, but that's what the handbook recommends).  I'd guess that
you've made some mistake somewhere and have been confused by the
concept of links.

Briefly, UNIX files consist of an metadata (which describes the file)
and the data of the file itself.  The metadata does *not* include the
name; it's accessed by number.  The name is stored in the directory,
which is like a phone book: it contains a name and a number, in this
case file name and inode number.  Like a phone book, more than one
name can have the same number.  That's what you're seeing here; the
link count just states how many names refer to this inode.

Greg
--
When replying to this message, please copy the original recipients.
If you don't, I may ignore the reply or reply to the original recipients.
For more information, see http://www.lemis.com/questions.html
Note: I discard all HTML mail unseen.
Finger grog@FreeBSD.org for PGP public key.
See complete headers for address and phone numbers.

--XOIedfhf+7KOe/yw
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (FreeBSD)

iD8DBQFA6gpgIubykFB6QiMRAjWxAKCnYGkuRZ3xWbPSIOOxwo5Es907wACfd2SI
zqcveqHhQUxMrM4Vcy7IsD4=
=kZ7G
-----END PGP SIGNATURE-----

--XOIedfhf+7KOe/yw--



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