Discussion:
/rescue is huge!!
Richard Bradley
2004-07-06 01:29:03 UTC
Permalink
Hi everyone,

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!

The Handbook says that "100 MB is a reasonable size for this filesystem. You
will not be storing too much data on it, as a regular FreeBSD install will
put about 40 MB of data here." (ยง 2.5.5). I gave my root partition what I
thought was a generous 512Mb.

What is going on here? I read the "rescue" manpage, and while it might be a
nice thing to fall back on, I can't justify it over being able to add user
accounts.

Should I just delete this lot? Should I have a bigger / partition?

Is the handbook out of date in this respect? (/rescue was added in 5.2)

All comments welcome...


Rich
Dan Nelson
2004-07-06 01:36:49 UTC
Permalink
Post by Richard Bradley
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.
Post by Richard Bradley
What is going on here? I read the "rescue" manpage, and while it
might be a nice thing to fall back on, I can't justify it over being
able to add user accounts.
You missed this section:

The /rescue tools are compiled using crunchgen(1), which makes
them considerably more compact than the standard utilities.
--
Dan Nelson
***@allantgroup.com
Richard Bradley
2004-07-06 01:59:08 UTC
Permalink
Post by Dan Nelson
Post by Richard Bradley
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, the
used space on / has gone from 550Mb+ to 129Mb. I can't check the inodes now,
as I have `rm`ed them all!


Rich
Dan Nelson
2004-07-06 02:10:28 UTC
Permalink
Post by Richard Bradley
Post by Dan Nelson
Post by Richard Bradley
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, the used space on / has gone from 550Mb+ to 129Mb. I can't
check the inodes now, as I have `rm`ed them all!
If at some point you had copied /rescue with cp (instead of a tar pipe
or something else that preserves hardlinks), you would have gotten a
separate file for each link.
--
Dan Nelson
***@allantgroup.com
Greg 'groggy' Lehey
2004-07-06 02:11:44 UTC
Permalink
Post by Richard Bradley
Post by Dan Nelson
Post by Richard Bradley
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.
Post by Richard Bradley
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.
Post by Richard Bradley
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 ***@FreeBSD.org for PGP public key.
See complete headers for address and phone numbers.
Richard Bradley
2004-07-06 02:25:50 UTC
Permalink
Post by Greg 'groggy' Lehey
Post by Richard Bradley
Post by Dan Nelson
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.
Yes, I mean directory. I switch between unix and the other OS family and
sometimes get sloppy with my terminology. Apologies.
Post by Greg 'groggy' Lehey
Post by Richard Bradley
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 measured this using kdf. The partition size is 512Mb. I was unable to write
to the partition, and df was reporting 120% disk usage. Since I rm'ed the /
rescue directory, kdf reports 23% disk usage and I can write to the
partition.

I thought that all the space was being used by /rescue, because kdirstat
reported the size of the directory at ~400Mb, but after some experimentation,
it appears kdirstat counts multi-linked files once for each link, so the
directory may not have been taking up all that space.

Regardless of the accuracy of kdf and kdirstat, I did receive a "disk full"
message from "pw" on a partition which now has 380Mb free, so something funny
is going on...
Post by Greg 'groggy' Lehey
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.
I have almost certainly made a mistake somewhere, but my goal is to find out
what and not to repeat it. Things seem to be ok now (apart from I have no
rescue dir).

As far as I can tell, I understand links, but one can rarely know what one
doesn't know ;-)

Regards,


Rich
epilogue
2004-07-06 03:54:05 UTC
Permalink
On Tue, 6 Jul 2004 11:41:44 +0930
Post by Greg 'groggy' Lehey
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).
hello greg,

apparently, determining how 'best' to partition a drive is a bit of an art.
because i followed the advice given in the handbook, i found my
curiosity piqued by your comment. i was wondering if you would be so kind
as to share the reasoning behind your stated view?

i know that you're a busy fellow, so feel free to ignore this message. if
you are going to humour me, i won't be offended by tersely worded reply.
yet another possibility is that you post your thoughts on this with the
list. i'm sure that such a message would be of interest to other newbs and
might even generate an interesting discussion, without (i hope) polluting
the list.

whichever way, thanks for your time.


cheers,
epi
Greg 'groggy' Lehey
2004-07-06 04:33:43 UTC
Permalink
Post by epilogue
On Tue, 6 Jul 2004 11:41:44 +0930
Post by Greg 'groggy' Lehey
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).
hello greg,
apparently, determining how 'best' to partition a drive is a bit of an art.
because i followed the advice given in the handbook, i found my
curiosity piqued by your comment. i was wondering if you would be so kind
as to share the reasoning behind your stated view?
Sure. It's stated in more detail in my book "The Complete FreeBSD",
so I'll quote that. You'll note that I recommend a root file system
of between 4 and 6 GB. That's what I wrote at the time; nowadays, I
think 8 GB might be a better value.

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 ***@FreeBSD.org for PGP public key.
See complete headers for address and phone numbers.

Continue reading on narkive:
Loading...