Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I've tried it all (removing all the packages associated with MySQL) but keep getting stuff like this:

Preconfiguring packages ...
(Reading database ... 142196 files and directories currently installed.)
Unpacking mysql-server-5.1 (from .../mysql-server-5.1_5.1.63-0ubuntu0.11.10.1_amd64.deb) ...
ERROR: There's not enough space in /var/lib/mysql/
dpkg: error processing /var/cache/apt/archives/mysql-server-5.1_5.1.63-0ubuntu0.11.10.1_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

Here is my drive space map.

root@kyle:/# df
Filesystem           1K-blocks      Used Available Use% Mounted on
                      59361428  59021768         0 100% /
udev                   1014052         8   1014044   1% /dev
tmpfs                   409304      1476    407828   1% /run
none                      5120         0      5120   0% /run/lock
none                   1023256         0   1023256   0% /run/shm
/dev/sda1               233191     46888    173862  22% /boot
/dev/md0             1922858288 1048513192 776669500  58% /media/array

The root volume actually only has about 10 gigabytes in use on the hard drive (which has a 60 gig partition). /dev/md0 is a 2 TB raid array.

share|improve this question

closed as off-topic by Seth Jun 23 '14 at 23:21

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This describes a problem that can't be reproduced that seemingly went away on its own or was only relevant to a very specific period of time. It's off-topic as it's unlikely to help future readers." – Seth
If this question can be reworded to fit the rules in the help center, please edit the question.

I don't have a solution, but I think that if your MySQL server was to grow large, and for purposes of data safety/disk performance, especially with index seeks, it would be better to mount /var/lib/mysql on the RAID array. – hexafraction Oct 10 '12 at 19:08
I've actually got the MySQL databases on the RAID array. My problem is different. However I can create a new logical volume for /var and move all the stuff presently in the root var to the new logical volume - then there is room... – Robin McCain Oct 10 '12 at 20:23

2 Answers 2

First of all you need to get some disk space on the root partition. Try to use Disk Usage Analyzer option "Scan the filesystem" to find what is using your space (in Preferences, check your root partition as the only to get included in filesystem scans).

If your mysql data is important make a backup before trying those steps.

Then you should move your mysql data folder to the disk array (if you want to keep the previous database data):

sudo mv /var/lib/mysql /media/array/mysql

After that install mysql as always, edit /etc/mysql/my.cnf changing the location of the data folder:

datadir         = /media/array/mysql

and restart MySQL.

share|improve this answer

Ubuntu. Find large files fast from command line

Use these searches to find the largest files on your server.

Find files over 1GB

sudo find / -type f -size +1000000k -exec ls -lh {} \;

Find files over 100MB

sudo find / -type f -size +100000k -exec ls -lh {} \;

Find files over 10MB

sudo find / -type f -size +10000k -exec ls -lh {} \;

Perhaps mysql logs (.bin) in /var/lib/mysql full all the space of your disk.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.