0

I have a Linux server running Ubuntu 16.04.

I ran in to an issue this morning where one of my partitions ran out of space, I managed to free up some space as a temporary solution but need to transfer/reallocate some space from one partition to another.

Running df -h I get:

Filesystem      Size  Used Avail Use% Mounted on
udev             16G     0   16G   0% /dev
tmpfs           3.2G  318M  2.9G  10% /run
/dev/md1         20G   19G   25M 100% /
tmpfs            16G  4.0K   16G   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            16G     0   16G   0% /sys/fs/cgroup
/dev/md2        201G  943M  190G   1% /home
tmpfs           3.2G     0  3.2G   0% /run/user/1004
tmpfs           3.2G     0  3.2G   0% /run/user/1000

As you can see /dev/md1 is pretty much out of space, I am wanting to transfer some of the free space on /dev/md2 to this partition as I am never going to use 201G on my /home directory.

How can I do this or put / on /dev/md2?

James
  • 325
  • 2
  • 11

1 Answers1

1

How can I do this or put / on /dev/md2? Reinstall but if you're going to do that then it's probably worth fixing the partitions and use LVM too.


This is what i would probably do. I'm going to guess that most of md1 is filled with log files, so

  • Shut the system down and then bring it up in single user mode.
  • Make a directory under /home for /var/log e.g. /home/varlog
  • Transfer the contents of /var/log to /home/varlog
  • Delete the contents of /var/log and the /var/log directory
  • Link /var/log to /home/varlog

Then restart the system.

user9517
  • 114,104
  • 20
  • 206
  • 289
  • It's actually elastic search that is soaking up all the space in my `/var/lib` folder – James Feb 05 '17 at 23:19
  • Why don't you just tell elastic search to use a different directory then ? It would have been good for you to say that in your original question. – user9517 Feb 05 '17 at 23:24
  • 1
    Sorry, I didn't realise I could do that - and I get now that it would've helped to mention that. Following a similar approach to what you suggested worked. In that I moved elasticsearch in to a directory inside `/home` and then told elasticsearch to use that instead - which free'd up a tonne of space. Thanks for your help! – James Feb 05 '17 at 23:45