Cleanup tmp?

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
Hi guys. Today I started having problems with a debian server I have that runs on our home network. The machine runs bind9, squid, and squidGuard, and that's pretty much all it does. The squid proxy started to get flaky. The kids could connect sometimes, and others not, and image links were often broken.

I logged on the server and went to clear the mailbox as usual and received a message "mail: /tmp: No space left on device".

Here is the output from df:

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda1 6728280 6395184 0 100% /
tmpfs 514268 0 514268 0% /lib/init/rw
udev 10240 72 10168 1% /dev
tmpfs 514268 0 514268 0% /dev/shm
/dev/hda6 106063388 43659152 57016440 44% /home
/dev/hdb1 57691772 1191900 53569216 3% /hdb1

I'm not sure what normal looks like, but it appears like I have run out of room on hda1. Are there things I should clean up, or should I just edit fstab to mount /tmp on another partition?
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
fwiw, you can run df -h and it'll spit out numbers that are easier to digest.

I would first figure out what's hogging up all the space in your root. You can use the tool du to scan the filesystem and spit out file and directory sizes. For example, to find out the size of your /var directory you would run 'du -sh /var'. That will tell you the total size of all files and sub-directories under the /var directory.

I would guess that your proxy caches might be getting larger then you think or you have a runaway log file. All of which should be located under /var, unless you've specifically changed their storage locations.

As far as mounting /tmp on a different partition, that's always a workable solution. I usually mount /home /var and / with their own partition and just leave /tmp on the / partition.
 

crontab

Member
Dec 20, 2000
160
0
0
your / file system is full. You don't have /tmp as a separate file system so it seems like it's on /.

if you see unwanted files in the /tmp directory, remove them

also if you have large logs or old logs in /var/log, you should remove them if you don't need the content anymore.

I use du -kx | sort -n | tail to see the largest offended directory

also find / -size +9999 -ls to see what the large files are
 

JD50

Lifer
Sep 4, 2005
11,863
2,697
136
cd to /
then do "du -h --max-depth=1" and start tracking down the culprit. My bet is it's something in /var.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
Ok guys, thanks for the recs. I did look at /var/log and there aren't any massive files in there. Squid is supposed to use a fixed amount of disk for cache, and its cache is actually on hdb1, not hda1, so I don't think that's it either.

Time to go digging around some more I guess.

Edit: hey n0cmonkey, good to see you around. Seems like it's been awhile.

Edit2: heh, 3.8GB in /var... so I guess I know where to look.

Edit3: I have 1.1 gig in /var/cache/apt, most of it in a subdir called archives. What's the story on this stuff?

Edit4: so what's the feasability of moving /var in entirety to another partition? I googled a bit and seems there is or was a problem requiring /var/lock and /var/run to stay on root. Is it worth trying this, or perhaps I should just move /var/www (where about 50% of the fat is) over to the other disk and drop a symlink, or edit apache to move the root.

Edit 5: I think I'm just going to boot with gparted and resize hda1. There is plenty of space on that disk. I don't recall why root was set to just 6GB, but I think I accepted whatever the default partitioning choices were. I relocated the web root to hdb1 for now, which freed up 1.5 gigs. The other two big chunks on hda1 are /var/cache/apt/archives, and /usr. I think I will mount /user on hdb1 as well, after I resize. That should be easier to move than var I would think.
 

JD50

Lifer
Sep 4, 2005
11,863
2,697
136
/var/cache/apt/archives is where all of your downloaded packages are stored whenever you use apt-get. I hardly ever use distros that use apt-get, but I believe something like "apt-get clean" or something like that clears our your cache. Check out the apt-get, apt, aptitude (whatever) man pages for more info. You could probably just manually delete everything out of that directory, but apt-get might not like that.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
Hey thanks, that apt-get command worked great. After that, relocating the root web folder, and moving /usr over to the other disk I am down to 22% utilization on that partition. Thanks a lot for the help, folks.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |