Modify the Linux VPS host mounted hard disk folder directory configuration tutorial

Source: Internet
Author: User
Tags vps
This morning a netizen bought a bird cloud host product, because the system installed the default automatically mounted directory is the data directory, and this friend needs to install WDCP panel, in theory can also be in the background of the Panel designated directory, but he must follow the official directory www mount. So help him to deal with it can directly modify the Mount directory to resolve the existing directory replacement process.

First, the theoretical step method

In theory, there are a lot of ways to do this online, we just need to create a directory to be mounted, and then uninstall the existing mounted directory, and then go back to the new directory to mount the problem can be solved.

1. New WWW directory

The code is as follows Copy Code

Mkdir/www

2. Download the catalog that has been mounted

The code is as follows Copy Code

Umount/data

3. Mount to new catalogue

The code is as follows Copy Code

Mount/dev/sdb1/www

4, modify the configuration file

The code is as follows Copy Code

Echo '/dev/sdb1/www ext3 defaults 0 0 ' >>/etc/fstab

In theory such an operation can complete the replacement directory. But the old left side in the operation of the time there are some problems, in the umount when there are "Umount:/data:device is busy." In some cases useful info about processes this use the device was found by lsof (8) or fuser (1), the error cannot be unloaded.

Second, solve the problem

Here because the program is occupied, we only need to check the ID and then delete it so that the procedure can be done.

1, Fuser/data

The code is as follows Copy Code

/data:947c

We can see that there really is a program occupied.

2, view the process

The code is as follows Copy Code

[Root@niaoyun data]# ps-ef |grep 94c
Root 1435 947 0 22:47 pts/0 00:00:00 grep 94c
[Root@niaoyun data]# Ps-ef |grep 94
Root 944 2 0 22:30? 00:00:00 [flush-253:0]
Root 945 868 0 22:33? 00:00:00 sshd:root@pts/0
Root 947 945 0 22:34 pts/0 00:00:00-bash
Root 1468 947 0 22:48 pts/0 00:00:00 ps-ef
Root 1469 947 0 22:48 pts/0 00:00:00 grep 94

3. Delete Occupation

The code is as follows Copy Code

Kill-9 945

Finally, we can continue the operation to complete the umount of the replacement catalog.

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.