I have a problem on my dedicated server. I wrongly configured it at the beginning, today I got a php error saying that there was no space left on the device. I checked my directories and saw that /dev/md3 was full (logs and websites was filling the space completely) here's what it shows:

Filesystem      Size  Used Avail Use% Mounted on
udev            7.7G     0  7.7G   0% /dev
tmpfs           1.6G  912K  1.6G   1% /run
/dev/md3         20G   16G  3.0G  84% /
tmpfs           7.7G     0  7.7G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           7.7G     0  7.7G   0% /sys/fs/cgroup
/dev/md4        392G   71M  372G   1% /home
/dev/md2        487M  214M  244M  47% /boot
/dev/nvme0n1p1  510M  6.1M  504M   2% /boot/efi
tmpfs           1.6G     0  1.6G   0% /run/user/0

I cleared some logs and files and saved 3gb, but I would like to ask if someone can point me in the right direction, I know that I never had to install my lamp stack as root in this folder but didn't realize, I have lot of space on /dev/md4, is there any solution to move my lamp stack and websites to it ? or to resize my /dev/md3 partition ?

Thank's in advance!

1 Answer 1


I would recommend you to remount the devices so that /var is mounted on /dev/md4. The easiest way to do this would be a from-scratch setup of the server.

Alternativly you could migrate the data directories for apache2 and mysql to /home. A tutorial for mysql can be found here: https://www.digitalocean.com/community/tutorials/how-to-move-a-mysql-data-directory-to-a-new-location-on-ubuntu-18-04

For apache2 you could just create a folder /home/www with user permissions for www-data and adjust the Directory directive of you apache vhost file to point to that folder.

  • Moving /var is a bad idea. This must actually be on the root filesystem in most Linux distributions (maybe all?), or they will fail to boot. Better to move /var/lib/mysql or the speciific directory containing all the files. Oct 24, 2018 at 14:07
  • Yes right, and that's why I didn't suggest to move /var. The best thing would be to mount /var on the biggest device available, which in this case is /dev/md4. The tutorial describes how to move /var/lib/mysql to another directory.
    – digijay
    Oct 24, 2018 at 14:18
  • 1
    Wait, what? You didn't suggest to move /var, but then six words later you say the best thing is to move it? I'm very confused. Oct 24, 2018 at 14:20
  • I recommended mounting /var on the biggest device (/dev/md4). That's what I would do. Alternativly (e.g. if re-mounting should prove to be too tricky) Lio could move the contents of /var/lib/mysql to another directory as described in the digitalocean tutorial, but that would not be my choice. It is nevertheless possible, I did it once on a ha-cluster where /var should not be mounted on the drbd device. It worked but it isn't nice. I hope that this clears it up …
    – digijay
    Oct 24, 2018 at 15:28
  • OK, so you did recommend moving /var. Again, that will likely result in an unbootable system. Oct 24, 2018 at 15:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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