Ubuntu: How can I increase the size of my /var und shrink it from /home or other patition? [duplicate]



Question:

This question already has an answer here:

first of all I'm a newbie with ubunutu servers or generell with linux. So I'll be glad if someone can explain it very simple. ^^'

My Server is a Ubuntu 16.04 LTS Server 64bit + Plesk Onyx from Strato (German Hoster).

I've the problem that my FTP webspace is on my /var directory and I've just 70GB on this /var of 2*240GB SSD.

Unfortunately the server was preset with the webinterface installation (however I've a dedicated server).

My /home on the one hard disk of 240GB has 118GB and I'm still using 500MB ... Can I shrink this /home for example to 25GB and give the 'free space' my /var? (If it's possible without shutting down the server?)

Hopefully I've explained my problem well enough. I hope anyone can give me accurate instructions to do this task. :|


Solution:1

Some filesystems allow hot (as in during operation) size adjustments (expand & shrink), others do not, and I can't comment on your fs (filesystem) as I don't know what it is (nor your host-image or host service sorry).

There are other ways to accomplish your desired result anyway; from links (hard ideally, soft if desired; ln command), but for some uses this is easy, others no so, and I don't fully know what you need.

Another solution requiring less work is to create a directory in your /home that is then mounted to an appropriate directory in your existing structure with something like

mkdir /home/space mount --bind /home/space /wherever/youneed/thespace

note: i'm ignoring permissions as I don't know what you'll require; which may be as little as sudo for each command, plus of course your testing to ensure it'll work with your use-case. This will only work if the /wherever/youneed/thespace is useful to you, so adjust to suit your needs


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »