[Webmin+virtualmin] Change /home to other partition

2 posts / 0 new
Last post
#1 Thu, 12/06/2012 - 02:56
masterP

[Webmin+virtualmin] Change /home to other partition

I am pretty new to linux/virtualmin/webmin/tomcat.

I have setup a new webserver which currently hosts 5-10 websites.

Setup:

Webmin

Virtualmin

Apache

Mysql

Tomcat

Now one of my websites has uploaded so much data, that the default homefolder location(/home) has used 100% of the available space.

More info:

Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda3 2922628 574032 2202116 21% / udev 5112444 4 5112440 1% /dev tmpfs 2048600 304 2048296 1% /run none 5120 0 5120 0% /run/lock none 5121500 0 5121500 0% /run/shm /dev/sda2 5842452 1262056 4287432 23% /usr /dev/sda5 1495816 1420856 4 100% /home /dev/sdb2 1332188 52716 1212708 5% /tmp /dev/mapper/vol_data-lv_var 101870948 1604140 95099628 2% /var /dev/mapper/vol_data-lv_var_log 1459032 195272 1190648 15% /var/log

I want to move /home to: /dev/mapper/vol_data-lv_var

How can I do that, and how can I make sure that all the websites keep running correctly?

Please help!

Thu, 12/06/2012 - 09:24
Locutus

Easiest would be (including a bit of downtime): Make a new filesystem on the destination device, mount that as e.g. /home2, shut down Apache, MySQL and other servers that might change data, copy everything from /home to /home2 (e.g. using rsync -Phax), then change the mountpoint for /home to the new device in /etc/fstab. Re-mount /home, and done.

Virtualmin doesn't really care on which device /home is, as long as the mountpoint doesn't change.

Topic locked