Cloud Server ECS Linux system disk data transfer method

Source: Internet
Author: User

Transferred from: https://help.aliyun.com/knowledge_detail/41400.html

Problem Description

When purchasing ECS Linux servers, no data disks were purchased, and after a period of time, the existing system disks were unable to meet the business requirements as the business increased. Execution df-h query space usage is close to 100%, and data needs to be transferred to the newly purchased data disk.

Treatment Methods

For this kind of situation, you can refer to the following ideas to solve.

Note: data manipulation is involved, before the operation, please be careful to backup by means of snapshots.

1. Purchase the data disk, after creating the partition, mount the data disk to the/mnt/shujupan directory within the system.

2. Create a snapshot backup of the system disk so that the operation fails to roll back.

3. For data security purposes, stop the running service program to ensure that the transfer is progressing smoothly. Reference Example:

/etc/init.d/nginx stop/etc/init.d/httpd stop/etc/init.d/mysqld stop/etc/init.d/php-fpm stop/etc/init.d/vsftpd Stop

4. Assuming that the current system disk/mnt/www directory is a directory where data transfer is required, all files within the WWW directory are moved to the data disk (XVDB1) via the MV command.

mv/mnt/www/*/mnt/shujupan/

5, modify the Fstab file, specify the data disk mount directory, realize the boot from start.

$ vi/etc/fstab......# After adding the following content, save restart:/dev/xvdb1/mnt/www ext4 defaults 0 0
Note that EXT4 is the file system type of the data disk, XVDB1 is the data disk partition, please adjust according to the actual situation.

6. After restarting, check whether the program service in the system is running normally, test site, database, etc. can be connected to the normal access.

If there is no exception, the data migration succeeds. At this time for the system and program, the access to the/mnt/www directory is not changed, but this directory is located on the data disk, the execution of DF-H system disk space utilization to return to normal.

Cloud Server ECS Linux system disk data transfer method

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.