0

I have a root partition of 20G in size and it is running out of space because the /var/lib/mysql/ibdata1 is getting too large (13G now, the whole /var/lib is 15G in size).

lsblk command shows something like this:

sda 
-sda1
-sda2 (mountpoint /)
-sda3
--volgroup1-lvol0 (mountpoint /home)
-sda4 ([swap])
sdb
-volgroup1-lvol0 (mountpoint /home)

So basically the sda2 is the / partition with the 20G of space and sda3 + sdb is /home partition with space of 3.6T created with LVM. /dev/sda2 and /dev/mapper/volgroup1-lvol0 are both ext4.

1) What is the best way of resizing the root partition? I can shut off the system for an hour or two as I don't run any high traffic sites. This would not be an issue.

2) Is there any way of solving the issue of the ibdata1 growing too large?

Tom Smith
  • 13
  • 2
  • Your root partition is not in LVM? Format and reinstall, and this time leave it as part of the LVM. – Michael Hampton Dec 17 '16 at 15:56
  • ibdata grows because your database grows. Regularly prune data which you no longer need. You could create a new LV for mysql and move /var/lib/mysql there. – Joshua Griffiths Dec 17 '16 at 16:54
  • Do you use the `innodb_file_per_table` option in mysql? That saves having a big `ibdata` file. You do have to drop/recreate your DBs, though. There's plenty to find on that. – Halfgaar Dec 17 '16 at 20:27

1 Answers1

2

As you root partition is not on LVM, you will have a very hard time extending it.

It should be way simpler to move /var/lib/mysql to your home partition (with appropriate permissions), reconfiguring MySQL to use the new path (or creating an appropriate symlink).

shodanshok
  • 47,711
  • 7
  • 111
  • 180