How can I increase the size of my /var und shrink it from /home or other patition?

How can I increase the size of my /var und shrink it from /home or other patition?

まず、私は Ubuntu サーバーや Linux 全般の初心者です。ですから、誰かが非常に簡単に説明してくれると嬉しいです。^^'

私のサーバーは、Strato (ドイツのホスティング会社) の Ubuntu 16.04 LTS サーバー 64 ビット + Plesk Onyx です。

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. :|

答え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

関連情報