Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to make some room on /dev/sda1 without necessarily having to remove a whole bunch of applications (I've already gone through and deleted all frivolous apps).

This is the state of /dev/sda1 currently:

Dir: /
Type: ext3
Total: 9.4GiB
Free: 488.6MiB
Available: 0bytes
Used: 8.9GiB

EDIT added du output from comments below:

769068 /var/lib/mysql
351208 /usr/lib
297060 /usr/local/bin/eclipse/plugins
184124 /usr/bin
175924 /usr/lib/openoffice/program
143940 /usr/local/bin/eclipsePHP/plugins
 92520 /boot
 81200 /opt/android-sdk-linux/add-ons/google_apis-6_r01/images
 79964 /opt

That's funny, because the tables in /var/lib/mysql are the reason that I ran out in the first place. But I need them, and room for many more possibly large db's.

share|improve this question

migrated from May 19 '10 at 10:21

This question came from our site for system and network administrators.

up vote 2 down vote accepted

How about log files? You could delete and/or compress them. While you're at it, make sure you have logrotate set up - that will take care of automatically compressing, rotating, and deleting your logs on a regular basis.

share|improve this answer
I do have logrotate set up and compression is enabled. I didn't make any custom configurations, though. On top of that, I followed this walkthrough:… Even after all of that, /dev/sda1 only has 240MB free. I'd like more! Any suggestions? – rvs May 18 '10 at 18:08
Well, if you've deleted everything you can, then really the only recourse you're left with is adding another hard drive. – EEAA May 18 '10 at 18:39
I'm swapping it out for a 250GB drive. Yay! Thanks, all. – rvs May 20 '10 at 2:05

First, find out what's using your space...

# du -k -x -S / | sort -r -n
  • -k - output in kB instead of blocks
  • -x - don't check other filesystems mounted in the tree
  • -S - don't include subdir values

EDIT From the disk space report you added it seems you have two disk hogs:

  1. MySQL - move the data to a different partition, and either reconfigure MysQL (via /etc/my.cnf) or put in a symlink from the old location to the new one

  2. Development tools - that's a lot of Eclipse plugins, and an Android SDK too...

share|improve this answer
xdiskusage is the visualization tool for this. – MikeyB May 18 '10 at 16:33
sure, if you want to go all GUI on me... ;-) – Alnitak May 18 '10 at 16:34
Some may prefer the visualization of kdirstat or gtkfree. However xdiskusage (and it's grandpa xdu) allow you to visualize a file containing the output of du. So then you can do things like ssh server2 "du -k /usr"|xdiskusage – Bribles May 18 '10 at 16:57
Here are the first several lines of the output from Alnitak's command: ************************************************************** 769068 /var/lib/mysql 351208 /usr/lib 297060 /usr/local/bin/eclipse/plugins 184124 /usr/bin 175924 /usr/lib/openoffice/program 143940 /usr/local/bin/eclipsePHP/plugins 92520 /boot 81200 /opt/android-sdk-linux/add-ons/google_apis-6_r01/images 79964 /opt That's funny, because the tables in /var/lib/mysql are the reason that I ran out in the first place. But I need them, and room for many more possibly large db's. – rvs May 18 '10 at 18:29

Sometimes there's packages that you don't really need taking up a lot of space. Ie open-office. The debian-goodies package contains a script called dpigs that will list the top ten disk space offenders. Example:

~$ dpigs
264088 ubuntu-docs
94652 linux-image-2.6.32-22-generic
93752 linux-image-2.6.28-16-generic
92204 linux-image-2.6.27-11-generic
88180 linux-image-2.6.31-21-generic
86024 inkscape
79672 wine1.2
75348 openjdk-6-jre-headless
74320 linux-headers-2.6.32-22

If that's not enough you have to consider the point of running mySQL on a drive of a measly ten gigs. If this is for development testing, consider pruning the data. If it's production, consider moving it to it's own server or at least it's own disk. I can buy a terrabyte disk for under a hundred dollars now -- the time spent pruning an install and prioritizing useful software seems like a waste in comparison. Just format it, take mysql offline move everything over from /var/lib/mysql and remount the drive to that location.

share|improve this answer

You can reduce the percentage of usage reserved for privileged processes see: man tune2fs. Default is 5% of your disk space. Maybe an option is to reduce it to 2% ?

# tune2fs -m2 /dev/sda1
share|improve this answer
That one seems a bit too risky -- I don't want to hose my system because the OS didn't have room (and I'm not Unix-smart enough to deal with that). – rvs May 18 '10 at 18:23
Your call. I'm always reducing it on larger drives. – Casual Coder May 18 '10 at 18:33
What would you consider a 'larger drive'? Mine? – rvs May 18 '10 at 18:59
Try reducing to 3%. Check how much space you gain. You can always switch back to 5%. This is space reserved for privileged processes when there is no space left on device system has to have disk space for sockets, named pipes, temp files, etc. to operate. – Casual Coder May 18 '10 at 19:12
Also check that /var/lib/mysql maybe you have large binary log files ? sudo du -h /var/lib/mysql/* – Casual Coder May 18 '10 at 19:19

If the problem are binary logs check that how-to-free-up-var-lib-mysql-virtualbox-vm

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .