What to do when the AMH website directory disk is full?

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.

  1. First, use an SSH tool to stop all AMH-related services with the following commands:
amh php stop
amh host stop
amh mysql stop
amh nginx stop
  1. 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

  2. Then, extract the newly packaged files to the new disk by running the command: tar -xzvf /mnt/home.tar.gz

  3. Delete the backup, mysql, www, and wwwroot folders under the /home directory by running the command: rm -rf backup mysql www wwwroot

  4. Create four symbolic links:

ln -s /mnt/backup /home
ln -s /mnt/mysql /home
ln -s /mnt/www /home
ln -s /mnt/wwwroot /home
  1. Finally, start the AMH-related services with the following commands:
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.


Comments