Move file Mount Disk

Source: Internet
Author: User

Two pieces of this plate are now mounted on a piece
[Email protected] data]# DF-HT
Filesystem Type Size used Avail use% mounted on
/DEV/VDA1 ext4 40G 5.8G 32G 16%/
Tmpfs tmpfs 16G 16K 16G 1%/DEV/SHM

Requirements: Format VDB new Hard disk, the VDA disk in the original/data/directory to remove the file, the VDB disk partition and mount to the/data directory, and the original VDA disk/data/file moved to the VDB of the/data hard drive mount Directory

Error action method:
mv/data/*/opt
mount/dev/vdb1/data/
mv/opt/*/data/
This approach will cause the data to be moved back to the/vda hard drive when the current drive is removed and moved back, in which case the principle please check the relevant disk data yourself

At this time umount/dev/vdb1
Will report Umount.nfs:/data:device is busy
Workaround:
[Email protected] data]# Lsof | grep data
Bash 8571 root cwd DIR 252,17 4096 2/data
Lsof 8657 root cwd DIR 252,17 4096 2/data
grep 8658 root cwd DIR 252,17 4096 2/data
Lsof 8659 root cwd DIR 252,17 4096 2/data
Kill-9 8571
Note: Because the process is in use at that time, if the kill process is executed directly, you must add 9 to force the kill.

Correct method of operation
Turn off services that depend on the/data/disk
Mkdir/data_1
Mount/dev/vdb1/data_1
mv/data/*/data_1
MOUNT/DEV/VDB/1/data
Umount/data_1
Rm-rf/data_1

Move file Mount Disk

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.