Publish: 2014-09-26 | Modify: 2014-09-26
AMH is an open source hosting panel that integrates the LNMP environment, which is very convenient for beginners. In general, website data is stored in the /home directory. If a separate disk is not mounted to the /home directory, then the website data will occupy the / directory. However, the disk space in the root directory is limited, and there may be some issues when the / directory is full.
If another disk is not initially mounted to the /home directory, but now the / directory is full and you want to move the website data to another disk, you can achieve this by using symbolic links. Here's how to do it.
Assuming your disk structure is as follows: the default disk sda1 is mounted to the / directory, and the new disk sdb1 is mounted to the /mnt directory. Now what we need to do is move the website data from the /home directory to the /mnt directory.
amh php stop
amh host stop
amh mysql stop
amh nginx stop
Package the backup, mysql, www, and wwwroot folders under the /home directory to the new disk by running the command: tar -zcvf /mnt/home.tar.gz backup mysql www wwwroot
Then, extract the newly packaged files to the new disk by running the command: tar -xzvf /mnt/home.tar.gz
Delete the backup, mysql, www, and wwwroot folders under the /home directory by running the command: rm -rf backup mysql www wwwroot
Create four symbolic links:
ln -s /mnt/backup /home
ln -s /mnt/mysql /home
ln -s /mnt/www /home
ln -s /mnt/wwwroot /home
amh php start
amh host start
amh mysql start
amh nginx start
By following the above steps, the files under the /home directory on the sda1 disk are linked to the /mnt directory on the new sdb1 disk. From now on, website data will be stored on the new sdb1 disk.
I come from China and I am a freelancer. I specialize in Linux operations, PHP, Golang, and front-end development. I have developed open-source projects such as Zdir, ImgURL, CCAA, and OneNav.