|
|
| Next: The Sentinel |
| Author |
Message |
ray External

Since: Nov 13, 2004 Posts: 3387
|
Posted: Mon Jun 18, 2007 8:22 pm Post subject: proper method to clean house Archived from groups: alt>os>linux>gentoo (more info?) |
|
|
I find that my 10gb Gentoo partition has filled up. I find 1.8gb in
/var/tmp/ccache and 1.2gb in /usr/src. I've been looking at gentoo.org in
the docs section to find appropriate commands to clean things out, but
without luck, so far. Can someone tell me how to do that or at least what
is safe to delete.
thanks |
|
| Back to top |
|
 |
AZ Nomad External

Since: Nov 03, 2006 Posts: 243
|
Posted: Tue Jun 19, 2007 2:41 am Post subject: Re: proper method to clean house [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
On Mon, 18 Jun 2007 20:22:08 -0600, ray <ray.TakeThisOut@zianet.com> wrote:
>I find that my 10gb Gentoo partition has filled up. I find 1.8gb in
>/var/tmp/ccache and 1.2gb in /usr/src. I've been looking at gentoo.org in
>the docs section to find appropriate commands to clean things out, but
>without luck, so far. Can someone tell me how to do that or at least what
>is safe to delete.
>thanks
the only thing in /usr/src should be kernel and you can only get rid of
it entirely if you won't be building any more packages that depend on it.
What you can do is a 'make mrproper' in it to clean out all the object files.
You can also get rid of all versions other than the current running version.
Do a 'uname -r' to get that information.
You can also get rid of all the unused versions in /lib/modules. |
|
| Back to top |
|
 |
Arthur Hagen External

Since: Aug 30, 2004 Posts: 524
|
Posted: Tue Jun 19, 2007 2:41 am Post subject: Re: proper method to clean house [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
AZ Nomad <aznomad.2.TakeThisOut@PremoveOBthisOX.COM> wrote:
> On Mon, 18 Jun 2007 20:22:08 -0600, ray <ray.TakeThisOut@zianet.com> wrote:
>
>
>> I find that my 10gb Gentoo partition has filled up. I find 1.8gb in
>> /var/tmp/ccache and 1.2gb in /usr/src. I've been looking at
>> gentoo.org in the docs section to find appropriate commands to clean
>> things out, but without luck, so far. Can someone tell me how to do
>> that or at least what is safe to delete.
>
>> thanks
>
> the only thing in /usr/src should be kernel and you can only get rid
> of
> it entirely if you won't be building any more packages that depend on
> it. What you can do is a 'make mrproper' in it to clean out all the
> object files. You can also get rid of all versions other than the
> current running version. Do a 'uname -r' to get that information.
Do not do "make mrproper" for the /current/ kernel, or you won't be able to
emerge 3rd party modules. In /usr/src/linux (which should be a symlink to
the current kernel), do "make clean; make modules_prepare" instead.
To get rid of all kernel versions except the latest you installed:
emerge --prune sys-kernel/gentoo-sources
(Substitute gentoo-sources with the kernel you use -- it could be
hardened-sources or vanilla or bsd or...)
After this, you can rm -r the directories for the versions you removed from
under /usr/src/
> You can also get rid of all the unused versions in /lib/modules.
Just don't get rid of them if there still are kernels using them under
/boot -- sometimes you want to be able to boot into an older kernel.
Another few space savers:
check /usr/portage/distfiles, and remove the older versions of any source
package which you have more than one version of. (Or zonk it all if you
want to, but then you'll have to re-download the packages if rebuilding
anything.)
If you have gentoolkit installed, you might want to clean out
/usr/portage/distfiles automatically by running "eclean-dist" (will only
remove packages that no longer have an ebuild) or "eclean-dist -d" (to
remove everything except what you need for a reinstall).
For ccache, you can do:
# if compiling something, wait until finished.
cd /var/tmp/ccache
rm -f tmp.*
find . -type f -mtime +360 | xargs rm
# adjust 360 to fit your needs - any files that old in days will be removed
ccache -c # this one will take a while
To get rid of left-over files from emerge compiles:
cd /var/tmp/portage
rm -rf *
If running apache:
rm -f /tmp/sess_*
If running mysql:
# Unless you're running replication:
mysql -e "purge master logs before '`date +%Y-%m-%d` 00:00:00'"
# In any case:
/usr/bin/mysqloptimize -As
If using xfs (not the X font server, but the file system), emerge xfsdump
and run:
xfs_fsr -v
# This will defragment all xfs hard drives, which can free up some space
too, due to getting rid of unnecessary extents.
Then there's /var/log/... I recommend using the logrotate package or
similar, and make sure that logs are rotated and compressed every now and
then.
Good luck cleaning!
--
*Art |
|
| Back to top |
|
 |
Anthony.Youngman External

Since: Jun 20, 2007 Posts: 6
|
Posted: Wed Jun 20, 2007 7:46 am Post subject: Re: proper method to clean house [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
On Jun 19, 3:22 am, ray <r....TakeThisOut@zianet.com> wrote:
> I find that my 10gb Gentoo partition has filled up. I find 1.8gb in
> /var/tmp/ccache and 1.2gb in /usr/src. I've been looking at gentoo.org in
> the docs section to find appropriate commands to clean things out, but
> without luck, so far. Can someone tell me how to do that or at least what
> is safe to delete.
>
I'm guessing that /var/tmp means it really is temporary
How big is your swap partition? I deliberately created a 10Gb swap on
my system (I multi-boot, and have allocated an 80Gb disk to Gentoo
so I mounted /tmp as a tmpfs partition.
If you look in fstab, there's probably a partition put there by
default that's tmpfs. Wipe the contents of /var/tmp, edit fstab to
mount it tmpfs, and bingo - every reboot the contents just go away ...
as I find various ...tmp's I'll probably do the same.
Cheers,
Wol |
|
| Back to top |
|
 |
Anthony.Youngman External

Since: Jun 20, 2007 Posts: 6
|
Posted: Wed Jun 20, 2007 12:51 pm Post subject: Re: proper method to clean house [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Wim Cossement wrote:
> Anthony.Youngman DeleteThis @ECA-International.com wrote:
> > On Jun 19, 3:22 am, ray <r... DeleteThis @zianet.com> wrote:
> >> I find that my 10gb Gentoo partition has filled up. I find 1.8gb in
> >> /var/tmp/ccache and 1.2gb in /usr/src. I've been looking at gentoo.org in
> >> the docs section to find appropriate commands to clean things out, but
> >> without luck, so far. Can someone tell me how to do that or at least what
> >> is safe to delete.
> >>
> > I'm guessing that /var/tmp means it really is temporary
> >
> > How big is your swap partition? I deliberately created a 10Gb swap on
> > my system (I multi-boot, and have allocated an 80Gb disk to Gentoo
> > so I mounted /tmp as a tmpfs partition.
>
> So this means that those 10 GB are used as tmpfs mounts when you run out
> of memory? But is this not negative for performance?
No ...
tmpfs creates a filesystem in ram. If you don't use the files, they
get flushed to swap when you run out of ram. Basically, it's exactly
the same hit to your system as if you had a program that used a lot of
memory, but rarely did anything, so it spends the bulk of its time
swapped out.
Seeing as I've got 768Mb RAM and rarely use anywhere near that (free
RAM stays high!) the hit to my system is near zilch.
>
> > If you look in fstab, there's probably a partition put there by
> > default that's tmpfs. Wipe the contents of /var/tmp, edit fstab to
> > mount it tmpfs, and bingo - every reboot the contents just go away ...
> > as I find various ...tmp's I'll probably do the same.
>
> Wiping various dirs can be done with tmpreaper (that you can put in a
> cronjob for instance) and clearing out standard locations for scratch
> can be done by setting WIPE_TMP to yes in /etc/conf.d/bootmisc.
>
I know. I can't be bothered. My system rarely spends that long up, so
I just find it easier to wipe things on shutdown.
Cheers,
Wol |
|
| Back to top |
|
 |
Wim Cossement External

Since: Mar 21, 2007 Posts: 20
|
Posted: Wed Jun 20, 2007 1:09 pm Post subject: Re: proper method to clean house [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Anthony.Youngman RemoveThis @ECA-International.com wrote:
> On Jun 19, 3:22 am, ray <r... RemoveThis @zianet.com> wrote:
>> I find that my 10gb Gentoo partition has filled up. I find 1.8gb in
>> /var/tmp/ccache and 1.2gb in /usr/src. I've been looking at gentoo.org in
>> the docs section to find appropriate commands to clean things out, but
>> without luck, so far. Can someone tell me how to do that or at least what
>> is safe to delete.
>>
> I'm guessing that /var/tmp means it really is temporary
>
> How big is your swap partition? I deliberately created a 10Gb swap on
> my system (I multi-boot, and have allocated an 80Gb disk to Gentoo
> so I mounted /tmp as a tmpfs partition.
So this means that those 10 GB are used as tmpfs mounts when you run out
of memory? But is this not negative for performance?
> If you look in fstab, there's probably a partition put there by
> default that's tmpfs. Wipe the contents of /var/tmp, edit fstab to
> mount it tmpfs, and bingo - every reboot the contents just go away ...
> as I find various ...tmp's I'll probably do the same.
Wiping various dirs can be done with tmpreaper (that you can put in a
cronjob for instance) and clearing out standard locations for scratch
can be done by setting WIPE_TMP to yes in /etc/conf.d/bootmisc.
Wimmy |
|
| Back to top |
|
 |
markpeloquin External

Since: Jul 04, 2007 Posts: 1
|
Posted: Wed Jul 04, 2007 9:43 pm Post subject: Re: proper method to clean house [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
On Jun 20, 9:46 am, Anthony.Young... RemoveThis @ECA-International.com wrote:
> If you look in fstab, there's probably a partition put there by
> default that's tmpfs. Wipe the contents of /var/tmp, edit fstab to
> mount it tmpfs, and bingo - every reboot the contents just go away ...
> as I find various ...tmp's I'll probably do the same.
Wrong. /var/tmp is supposed to be preserved between reboots. That's
why there's a /tmp and a /var/tmp. If a developer decides something
aught to go into /var/tmp and not /tmp, this is the reason. See
http://www.pathname.com/fhs/ .
Also, remember to remove any packages that are no longer needed with
'emerge --depclean -av'. So if you installed and later remove
evolution, you can get rid of all the junk that came with it.
Mark |
|
| Back to top |
|
 |
Arthur Hagen External

Since: May 30, 2004 Posts: 45
|
Posted: Thu Jul 05, 2007 1:08 am Post subject: Re: proper method to clean house [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
On Wed, 2007-07-04 at 21:43 -0700, markpeloquin DeleteThis @gmail.com wrote:
> On Jun 20, 9:46 am, Anthony.Young... DeleteThis @ECA-International.com wrote:
>
> > If you look in fstab, there's probably a partition put there by
> > default that's tmpfs. Wipe the contents of /var/tmp, edit fstab to
> > mount it tmpfs, and bingo - every reboot the contents just go away ...
> > as I find various ...tmp's I'll probably do the same.
>
> Wrong. /var/tmp is supposed to be preserved between reboots. That's
> why there's a /tmp and a /var/tmp. If a developer decides something
> aught to go into /var/tmp and not /tmp, this is the reason. See
> http://www.pathname.com/fhs/ .
True, but read the small print too -- it's still a *temporary* folder.
A program can take advantage of, but should never /expect/ a file to be
preserved in any tmp folder, but re-create files there as necessary.
Files in /var/tmp can be deleted at *any* time they're not locked by a
program, and it's up to the program to cope.
If permanence across sessions is needed, a program should use a
different folder within /var.
Regards,
--
*Art |
|
| Back to top |
|
 |
|
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
| |
|
|