Method of LNMP Aliyun ECS mounted data hard disk

Source: Internet
Author: User
Tags aliyun

Aliyun host default is not to help you mount the data disk, the data disk naming is not the same as the traditional. The concrete can be viewed with fdisk-l:

# fdisk-l

disk/dev/hda:21.4 GB, 21474836480 bytes
255 heads, Sectors/track, 2610 cylinders
Units = Cylinders of 16065 * 8225280 bytes

Device Boot Start End Blocks Id System
/DEV/HDA1 * 1 2610 20964793+ Linux

disk/dev/xvdb:21.4 GB, 21474836480 bytes
255 heads, Sectors/track, 2610 cylinders
Units = Cylinders of 16065 * 8225280 bytes

Disk/dev/xvdb doesn ' t contain a valid partition table
See, the data disk is on the/DEV/XVDB, and there is no file system,/DEV/HDA1 is the system disk. Do not install important data into the/dev/hda1 Oh, otherwise there are some major accidents, crying is too late. General use Aliyun Host Basic is to establish a website, then if install CentOS, will/dev/xvdb1 mount to/var/www directory, the specific operation is as follows:

SSH Name@aliyunhost
Switch to Root
Run the FDISK/DEV/XVDB command, and follow the prompts to partition the operation
Format partition: MKFS.EXT3/DEV/XVDB1
Mount Directory: mount/dev/xvdb1/var/www
Modify the Fstab so that the boot is mounted:/dev/xvdb1/var/www ext3 defaults 0 0

Of course, you can also use the latest Ext4 file system. The Mount catalogue is determined by your purpose.

If you are installing the system environment using the common LNMP one-click installation package, the site root defaults to:/home/wwwroot

There are two ways

1. Mount directly to directory/home/wwwroot
This can be done directly by Aliyun official tutorial, just need to build directory # Mkdir/home/wwwroot

Then replace the/mnt with the/home/wwwroot.
After the operation of these, and then install LNMP a key package can be.
2. The software is installed on the system disk, but the website data is placed on the data disk
LNMP or installed in the system disk, Aliyun server's data disk mount also according to the original operation
Just modify the default directory to/mnt when you add a Web site
There are two points to this benefit:
1. You can use more data disk space
2. Reloading the system or environment will not affect the site data, of course, the format of the data disk will not affect the system and the environment.
* In addition, the data disk can be divided into one more area, one of the partitions mounted to the database directory, such as/usr/local/mysql, method ditto
-----------
If the site has been built under the system disk, there is still a way to migrate to the data disk? Site at home, can the data disk be loaded into the home directory?
Of course, you can move the files in the/home directory to another directory, and then mount the data to/home, and move the data back.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.