There is no additional data disk in the default Tencent ECS, and the default Linux system disk is only 8GB, which is sufficient for general websites. If the additional data disk purchased after installing the system may not be automatically loaded into the specified data disk directory according to the different panels and system paths, we need to load the data disk manually, That is what we often call mount. Just as it happened, yesterday the netizen @ Tianya gave me a Tencent cloud server with a 250GB data disk. It's not right to write a tutorial when installing the website environment.
There are previous articles about mount:
The Linux VPS host mounts the unused data disk and specifies the WDCP panel installation data disk directory
Complete Linux VPS mounting without hard disk tutorial method
In order to meet the needs of most users using the panel, I will mount the data disk for users who are about to install the AMH panel, because the WDCP panel has also been introduced in previous articles. Even though AMH panels are currently charged, the free version 4.2 is relatively complete. After the security of the WDCP panel was previously exposed, many users are looking for other panels of the same kind to use, at least not to put eggs in one basket. Without saying much, Lao Zuo continued to organize this article.
First, check whether the hard disk device has a data disk
Of course, at the time of writing this article, I knew that there was a data disk. However, sometimes the VPS we purchased, such as 30GB by default, may have 20GB unmounted, so you need to check this operation first.
fdisk -l
Check the data disk of Tencent ECS
We can see that 268GB data disks are not attached. Watch the path/dev/vdb ahead
Second, data hard disk partition
fdisk /dev/vdb
Enter n, p, 1, enter, enter, wq in sequence
The VDB here is the name of the data hard disk we saw above. If you are not, you need to replace it according to your real disk name. If it is the same as mine, you can copy it directly.
Third, ext3 format partition
mkfs.ext3 /dev/vdb1
Fourth, attach a new partition
A - New Directory
mkdir /home
Because the AMH panel is installed in the HOME directory, we need to create a new directory. If it is a WDCP panel, we should know that it is the WWW directory.
B - Mount partition
mount /dev/vdb1 /home
Fifth, write in the fstab to set the auto mount after startup
echo '/dev/vdb1 /home ext3 defaults 0 0' >> /etc/fstab
Sixth, check whether the mount is successful (df - h)
Here we can see that 247GB (250GB) has been mounted, which is in the HOME directory. At this time, we can install AMH panel( Installation of AMH panel )。
Finally, the AMH panel database is mounted
If we use the AMH 4.2 version, the database of the default system is also in the system disk. We can also mount it to the data disk together to make a soft connection.
mv /usr/local/mysql/data /home/mysql/data
cd /usr/local/mysql/
ln -s /home/mysql/data
After that, we can restart the AMH panel MYSQL database. The command is amh mysql restart. So far, we have completed the data disk mounting of all Tencent ECS and the installation of the AMH panel.
In conclusion, if our VPS data disk is large and our website can't be used up, there is no need to mount it. If our data will be large in the future, or we don't want to waste data disks, we can mount them for use.
Scan the code to follow the official account
Get more news about webmaster circle!
Entrepreneurship, operation and new knowledge