Re: /rescue is huge!!

2009-01-27 Thread Wojciech Puchar



ls -li /rescue

total 427594
26 -r-xr-xr-x  1 root  wheel  3324376 Jan 12  2007 [
64 -r-xr-xr-x  1 root  wheel  3324376 Jan 12  2007 atacontrol
65 -r-xr-xr-x  1 root  wheel  3324376 Jan 12  2007 atm
66 -r-xr-xr-x  1 root  wheel  3324376 Jan 12  2007 atmconfig
67 -r-xr-xr-x  1 root  wheel  3324376 Jan 12  2007 badsect
68 -r-xr-xr-x  1 root  wheel  3324376 Jan 12  2007 bsdlabel
69 -r-xr-xr-x  1 root  wheel  3324376 Jan 12  2007 bunzip2
70 -r-xr-xr-x  1 root  wheel  3324376 Jan 12  2007 bzcat
71 -r-xr-xr-x  1 root  wheel  3324376 Jan 12  2007 bzip2
72 -r-xr-xr-x  1 root  wheel  3324376 Jan 12  2007 camcontrol
73 -r-xr-xr-x  1 root  wheel  3324376 Jan 12  2007 cat


do
cd /rescue
echo * /tmp/xxx
edit /tmp/xxx - remove all files that doesn't have 3324376 size, and
one file of 3324376, say it will be cat
then
rm `cat /tmp/xxx`
for x in `cat /tmp/xxx`;do ln cat $x;done

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: /rescue is huge!!

2009-01-26 Thread Daniel Ajoy

http://unix.derkeiler.com/Mailing-Lists/FreeBSD/questions/2004-07/0442.html

This is what's happening to me:

==
In the last episode (Jul 06), Richard Bradley said:
 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, 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. 

==

my ls looks like this:


ls -li /rescue

total 427594
 26 -r-xr-xr-x  1 root  wheel  3324376 Jan 12  2007 [
 64 -r-xr-xr-x  1 root  wheel  3324376 Jan 12  2007 atacontrol
 65 -r-xr-xr-x  1 root  wheel  3324376 Jan 12  2007 atm
 66 -r-xr-xr-x  1 root  wheel  3324376 Jan 12  2007 atmconfig
 67 -r-xr-xr-x  1 root  wheel  3324376 Jan 12  2007 badsect
 68 -r-xr-xr-x  1 root  wheel  3324376 Jan 12  2007 bsdlabel
 69 -r-xr-xr-x  1 root  wheel  3324376 Jan 12  2007 bunzip2
 70 -r-xr-xr-x  1 root  wheel  3324376 Jan 12  2007 bzcat
 71 -r-xr-xr-x  1 root  wheel  3324376 Jan 12  2007 bzip2
 72 -r-xr-xr-x  1 root  wheel  3324376 Jan 12  2007 camcontrol
 73 -r-xr-xr-x  1 root  wheel  3324376 Jan 12  2007 cat
...


how do I reduce the size of the rescue directory? 

Or, as a last resort, can I safely move it under /usr (which is in a different 
partition)?


Daniel
 
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


/rescue is huge!!

2004-07-05 Thread Richard Bradley
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

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: /rescue is huge!!

2004-07-05 Thread Dan Nelson
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.

 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
[EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: /rescue is huge!!

2004-07-05 Thread Richard Bradley
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, 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

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: /rescue is huge!!

2004-07-05 Thread Dan Nelson
In the last episode (Jul 06), Richard Bradley said:
 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, 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
[EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: /rescue is huge!!

2004-07-05 Thread Greg 'groggy' Lehey
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 [EMAIL PROTECTED] for PGP public key.
See complete headers for address and phone numbers.


pgpoLPUjbnpth.pgp
Description: PGP signature


OT: /rescue is huge!!

2004-07-05 Thread epilogue
On Tue, 6 Jul 2004 11:41:44 +0930
Greg 'groggy' Lehey [EMAIL PROTECTED] wrote:

 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
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: OT: /rescue is huge!!

2004-07-05 Thread Greg 'groggy' Lehey
On Monday,  5 July 2004 at 23:54:05 -0400, epilogue wrote:
 On Tue, 6 Jul 2004 11:41:44 +0930
 Greg 'groggy' Lehey [EMAIL PROTECTED] wrote:

 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 [EMAIL PROTECTED] for PGP public key.
See complete headers for address and phone numbers.
What partitions?


In  this  example, you have 20 GB of space to divide up.  How should you do it?
You don't have to worry about this issue, since sysinstall can do it  for  you,
but  we'll  see  below  why this might not be the best choice.  In this section
we'll consider how UNIX file systems have changed over  the  years,  and  we'll
look at the issues in file system layout nowadays.

When  UNIX  was  young,  disks  were tiny.  At the time of the third edition of
UNIX, in 1972, the root file system was on a Digital RF-11, a fixed  head  disk
with 512 kB.  The system was growing, and it was no longer possible to keep the
entire system on this disk, so a second file system became essential.   It  was
mounted on a Digital RK03 with  2  MB  of  storage.   To  quote  from  a  paper
published in the Communications of the ACM in July 1974:

   In  our  installation,  for  example,  the  root directory resides on the
   fixed-head disk, and the large disk drive, which contains  user's  files,
   is mounted by the system initialization program...

As  time  went  on,  UNIX  got bigger, but so did the disks.  By the early 80s,
disks were large enough to put / and /usr on the same disk, and it  would  have
been  possible  to  merge  /  and  /usr,  but  they  didn't,  mainly because of
reliability concerns.  Since that time, an additional file  system,  /var,  has
come  into common use for frequently changed data, and just recently sysinstall
has been changed to create a  /tmp  file  system  by  default.   This  is  what
sysinstall does if you ask it to partition automatically:

[Omitting PostScript image images/disk-label-default.1.ps 4i  ]

Figure 5-9: Default file system sizes

It's  relatively  simple  to  estimate  the  size  of the root file system, and
sysinstall's value of 128 MB is reasonable.  But what about /var and /tmp?   Is
256  MB  too much or too little?  In fact, both file systems put together would
be lost in the 18.7 GB of /usr file system.  Why are  things  still  this  way?
Let's look at the advantages and disadvantages:

o If  you write to a file system and the system crashes before all the data can
  be written to disk, the data integrity of that file system  can  be  severely
  compromised.  For performance reasons, the system doesn't write everything to
  disk immediately, so there's quite a reasonable chance of this happening.

o If you have a crash and lose the root file system, recovery can be difficult.

o If a file system fills up, it can cause lots of trouble.  Most messages about
  file systems on the FreeBSD-questions mailing list are complaining about file
  systems  filling  up.   If you have a large number of small file systems, the
  chances are higher that one will fill up while space remains on another.

o On the other hand, some file systems are more important than others.  If  the
  /var  file  system  fills up (due to overly active logging, for example), you
  may not worry too much.  If your root file system fills up,  you  could  have
  serious problems.

o In  single-user  mode,  only  the  root  file  system  is  mounted.  With the
  classical layout, this means that the only programs you can run are those  in
  /bin  and /sbin.  To run other programs, you must first mount the file system
  on which they are located.

o It's  nice  to keep your personal files separate from the system files.  That
  way you can upgrade a system much more easily.

o It's very difficult to estimate in  advance  the  size  needs  of  some  file
  systems.   For  example, on some systems /var can be very small, maybe only 2
  or 3 MB.  It's hardly worth making a separate file system for that much data.
  On the other hand, other systems, such as ftp or web servers, may have a