3

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.

squircle
  • 6,773
rvs
  • 33
  • 1
  • 4

5 Answers5

4

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...

Alnitak
  • 786
2

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.

EEAA
  • 1,878
1

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
119940 openoffice.org-core
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.

jldugger
  • 294
0

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
Casual Coder
  • 4,092
0

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

Casual Coder
  • 4,092