You are not logged in.

#1 2010-10-20 16:51:17

cool_arrow
Member
Registered: 2009-01-21
Posts: 27

[solved]need space in root directory

I installed arch a couple of years ago and thought that I left ample room for the root directory.  I have been getting warning messages that the space was low on this directory (/home is on seperate directory).
This is the result of # du -hs     on the directories in root:

11M    /etc
120M    /lib
16K    /lost+found
150G    /media
4.0K    /mnt
499M    /opt
46M    /root
8.5M    /sbin
12K    /srv
0    /sys
88K    /tmp
4.3G    /usr
7.1G    /var

The /var/log directory is 6.8G in size.   There are 3 files in /var/log called everything.log, kernel.log, and errors.log.  Each of those files is 2.2 GB in size.  Can I get rid of all the files in the /var/log directory or maybe just the 3 huge log files? Please advise.  Thanks.

Last edited by cool_arrow (2010-10-20 19:27:02)

Offline

#2 2010-10-20 16:53:30

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: [solved]need space in root directory

man pacman, look for -Sc and -Scc.  (the pkg cache is kept in /var)

also look into logrotate to archive old logs else place (6.8G ?!) on a weekly basis

Last edited by brisbin33 (2010-10-20 16:54:32)

Offline

#3 2010-10-20 17:02:23

cool_arrow
Member
Registered: 2009-01-21
Posts: 27

Re: [solved]need space in root directory

I have done #pacman -Sc and #pacman -Scc already.  It didn't seem to help.

Offline

#4 2010-10-20 17:15:06

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: [solved]need space in root directory

for f in everything.log kernel.log errors.log; do >/var/log/$f; done 

Offline

#5 2010-10-20 17:19:16

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [solved]need space in root directory

Still your /var is a whopping 7 GB. Partitioning guides routinely recommend 3 GB if you swap out /var. Have you done ever any maintenance on that system - at all?

We'd also need to see your fstab so we get an idea what partition layout you're having; for all we know you might have split out every dir in /. However, for starters, if you contain /media a little, you'll have ample room already wink.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#6 2010-10-20 17:20:41

cool_arrow
Member
Registered: 2009-01-21
Posts: 27

Re: [solved]need space in root directory

Sorry perbh but I don't understand that command. 


perbh wrote:
for f in everything.log kernel.log errors.log; do >/var/log/$f; done 

Offline

#7 2010-10-20 17:25:32

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: [solved]need space in root directory

he's basically saying just wipe the logs... i think logrotate is a better solution.

Offline

#8 2010-10-20 17:42:51

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,538

Re: [solved]need space in root directory

/usr/sbin/logrotate /etc/logrotate.conf

Offline

#9 2010-10-20 18:03:39

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: [solved]need space in root directory

brisbin33 wrote:

he's basically saying just wipe the logs... i think logrotate is a better solution.

hey - logrotate doesn't _free_ any space as such (unless I'm terribly mistaken - which may well be the case), when used as a cron-job it just ensures a certain amount of 'break-up' and will over time be a good tool. I don't think it's any help for a one-time effort - if you have a process that's going wild and writing masses to one or more log-files - 'logrotate' ain't gonna help you none.

Offline

#10 2010-10-20 19:26:33

cool_arrow
Member
Registered: 2009-01-21
Posts: 27

Re: [solved]need space in root directory

I just deleted the offending gigantic log files and they were recreated and are small now.  I guess I should really read them and figure out why they are so huge but no time to do that right now.   Thanks guys.

Offline

#11 2010-10-20 21:27:26

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [solved]need space in root directory

They fill over time - that's what they do. If they'd swell to gigabytes in a matter of weeks, then something is wrong, but that doesn't seem to be the case here. You should just set up logrotate, that will prevent the logs from growing big - if you enable rotation and compression, that is. If you're looking at a few GB to shave off though, maybe you should be looking for an extra HD (or a bigger one to replace this one with).


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

Board footer

Powered by FluxBB