View Full Version : HELP! - disk usage on partition is running low
alexismya2
08-13-2008, 02:04 PM
Hello. I use direct admin and when I do a back up of my website it is under 2 GB. I have 80 GB on my server. Direct Admin just sent me a message saying that The disk usage for one or more of your partitions are running low. How can this be? What could be wrong and how can I correct it?
Rich-Boy
08-13-2008, 03:13 PM
What is your OS? If it's some unix variant please post the output of df
alexismya2
08-13-2008, 03:20 PM
sorry, don't understand. The hosting company said I need to get into SSH to delete the transistion or dump log files, could be what is using up space. Does anyone know how to do this?
Rich-Boy
08-13-2008, 03:39 PM
Log into your server via ssh and post the output of these two commands (you may need to be root, or use sudo)
# uname -a
# df -h
alexismya2
08-13-2008, 04:02 PM
okay i did it. What info do you need?
Rich-Boy
08-13-2008, 04:06 PM
All of it please. You can mask any info that might uniquely identify your server such as hostnames and IPs
alexismya2
08-13-2008, 04:14 PM
uname is Linux
File system
/dev/sda2 size 72G Used 67G Avail 1.3 G Use 99% Mounted on /
/dev/sda1 size 487M Used 18M Avail 444M Use 4% Mounted on /boot
/dev/shm size 506M Used 0 Avail 506M Use 0% Mounted on /dev/shm
alexismya2
08-13-2008, 04:16 PM
uname
Linux host.xxxxxx.com 2.6.11-1.1369_FC4smp #1 SMP 005 i686 i386 GNU/Linux
Rich-Boy
08-13-2008, 04:22 PM
Ok, that's confirmed that you are -quite- close to filling up that 80GB, now to find out where most of your storage is being used up. Paste the output of;
# cd / && du -sk * |sort -n
Note: it might take a few minutes to gather the info
alexismya2
08-13-2008, 04:24 PM
ok thanks. Just ran it
Rich-Boy
08-13-2008, 04:26 PM
Right.... and does that solve your problem?
alexismya2
08-13-2008, 04:27 PM
Home 68041600
usr 1179208
proc 978523
var 774360
lib 116168
etc 20488
And others with less use
alexismya2
08-13-2008, 04:28 PM
Remember when I do a back up it is under 2G
alexismya2
08-13-2008, 04:32 PM
Why have I used up all my space if my website is under 2 G? By the way, thanks for your help
Rich-Boy
08-13-2008, 04:38 PM
Are you saying that you only expect your server to have used up 2GB?
You only have 1.3GB available on the server so if the backup of your website is anywhere near this amount then this is the reason you cannot backup. Your /home/ is taking up most of the space (64GB) so i would advise that you perform the same du command i mentioned inside /home to see which user is taking up the most hard disk space.
alexismya2
08-13-2008, 04:40 PM
Please tell me how to do perform the same du command inside /home.
Rich-Boy
08-13-2008, 04:42 PM
# cd /home && du -sk * |sort -n
alexismya2
08-13-2008, 04:49 PM
THANK YOU! OH MY. It says I have 62821760 backup
Rich-Boy
08-13-2008, 04:51 PM
http://www.google.co.uk/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-GB%3Aofficial&hs=0AP&q=62821760+kilobytes+in+gigabytes&btnG=Search&meta=
That'll be it then :)
Edit;
for future reference you may find this command easier on the eye
# du -h --max-depth 1 /home/ |sort -n
alexismya2
08-13-2008, 04:56 PM
Ok. I need your help deperately now then. I don't see this anywhere in direct admin. Our backup folder in DA says 1.6G. So where is this folder that has the 60G? And where do I go in Direct Admin to stop the automatic backups that must be occurring?
Rich-Boy
08-13-2008, 05:04 PM
I suggest that you seriously consider reading up on basic Linux administration, in my opinion you should be adept in at least locating, identifying and deleting directories/files. This might be a good starting point;
http://linuxcommand.org/learning_the_shell.php
Rich-Boy
08-13-2008, 05:10 PM
http://www.debianhelp.co.uk/commands.htm < looks good too
littleoak
08-13-2008, 07:02 PM
Alex,
Send me an email if you like and I'll help you with this (for free).
alexismya2
08-13-2008, 07:11 PM
Thank you so much for your help! The information you have given me is invaluable. Thank you so so much.
alexismya2
08-13-2008, 07:14 PM
Thank you and I sent you email.
littleoak
08-13-2008, 07:48 PM
I received your email and replied. It will be from christopher (me) at littleoak.
alexismya2
08-13-2008, 08:50 PM
Thank You So Much Littleoak!! Also Thank You Rich-boy!!!
nobaloney
08-16-2008, 06:31 PM
Forget your backup directories. Backup is probably crashing before it finishes. You can't trust anything in the backup directories.
Post the output of these commands:
# cd /home
# du -sh /home | grep G
Then for each output line, do the du -sh command for that directory.
Jeff
littleoak
08-16-2008, 06:38 PM
Jeff,
I took a look at her server. She had a nightly cron set up to back up using the system backup. I removed the extra system backups.
nobaloney
08-16-2008, 07:30 PM
Good idea ;).
Jeff
klaver
03-24-2009, 11:34 AM
simple nifty script to clean up old backup files and keep your disk clean. Create a new file 'del-old-data.sh' and put it in your /home/backup directory with the following content:
#!/bin/bash
# Keep the 21 newest entries in the directory where this script is located, and delete everything else older.
i=1;
max=21;
DIR=`dirname $0`
THIS=`basename $0`
cd $DIR
for file in `ls -1Bt --color=no $DIR | grep -v $THIS` ; do
if (let "$i>$max"); then
rm -rf $file;
fi;
let i++;
done
give it execute rights:
chmod 700 /home/backup/del-old-data.sh
and create some cronjob to run this script every day:
crontab -e
add:
5 5 * * * /home/backup/del-old-data.sh
Powered by vBulletin™ Version 4.0.4 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.