This article is a mirror article of machine translation, please click here to jump to the original article.

View: 19535|Reply: 8

[Website Building Tutorial] Alibaba Cloud data disk mounting and uninstalling, as well as deleting new partition information

[Copy link]
Posted on 8/14/2017 2:22:12 PM | | | |
Why reprint this article. Because the data disk mounting tutorial on Alibaba Cloud's official website only teaches you how to mount, not how to uninstall it, this article has!
If you selected a data disk when you created an instance, you need to format the data disk before mounting the data disk after logging in to the instance.
In addition, you can configure multi-partition configurations for data disks according to business needs. It is recommended to use the tools that come with the system for partitioning operations.
Note: ECS only supports secondary partitioning of data disks, not system disks (whether Windows or Linux). If you forcibly use a third-party tool to perform secondary partitioning operations on the system disk, it may cause unknown risks, such as system crashes and data loss.
This operation is applicable to non-I/O optimization + SSD Linux (Redhat, CentOS, Debian, Ubuntu) instances.
  • Use the management terminal or remote connection tool to log in to the instance by entering the username, root, and password.
  • Run the fdisk -l command to view the data disk. Note: The disk cannot be seen using the df -h command until there is no partitioning and formatting the disk. In the example below, there is a 5 GB data disk that needs to be mounted.
    If /dev/xvdb is not found after executing the fdisk -l command, it means that your instance does not have a data disk and therefore does not need to be mounted. This chapter can be ignored.
  • Run fdisk /dev/xvdb to partition the data disk. As prompted, enter n, p, 1, enter twice, wq, and partition to start.
  • Run the fdisk -l command to see the new partition. The new partition xvdb1 has been created. /dev/xvdb1 in the example below.
  • Run mkfs.ext3 /dev/xvdb1 to format the new partition. The time required for formatting depends on the disk size. You can also choose other file formats such as ext4.
  • Run echo /dev/xvdb1 /mnt ext3 defaults 0 0 >> /etc/fstab to write the new partition information. Once done, you can use the cat /etc/fstab command to view it.

    Note: Ubuntu 12.04 does not support barrier, so the correct command for this system is: echo /dev/xvdb1 /mnt ext3 defaults 0 0 >> /etc/fstab
    If you need to mount the data disk separately to a folder, such as for storing web pages separately, you can modify the /mnt part of the above command.
  • Run mount /dev/xvdb1 /mnt to mount the new partition, and then do df -h to view the partition. If the data disk information appears, it means that the mount is successful and the new partition can be used.
    • mount /dev/xvdb1 /mnt
    • df -h
    • Filesystem      Size  Used Avail Use% Mounted on
    • /dev/xvda1       40G  1.5G   36G   4% /
    • tmpfs           498M     0  498M   0% /dev/shm
    • /dev/xvdb1      5.0G  139M  4.6G   3% /mnt

    If you had a mounting error before, here is to help you solve it!
2. Uninstall
            umount /dev/xvdb1
            The device is busy and cannot be mounted
            fuser -km /dev/xvdb1
            umount /dev/xvdb1
3. If you wrote the wrong partition information before, you can delete it
Deleting partition information, if it means deleting the mount information of this partition, you can directly edit fstab, comment or delete the mount record.
sudo vi /etc/fstab to enter the vi interface, delete the record, and then double-click the two uppercase z to save and exit vi, and return to the shell interface


Score

Number of participants1MB+10 contribute+10 Collapse reason
Little scum + 10 + 10 Banana Program Rewards

See all ratings





Previous:Things to do during the testing phase of website building
Next:Alibaba Cloud data disk I know how to mount which directory is generally mounted to
Posted on 8/14/2017 3:06:50 PM |
I really didn't pay attention to how the data disk was uninstalled   

Alibaba Cloud's SSD data disk to be mounted manually,

The script in the Alibaba Cloud one-click installation environment cannot perform normal mounting for the SSD database, which I found out later
 Landlord| Posted on 8/14/2017 3:16:04 PM |
Xiao Zhazha Posted on 2017-8-14 15:06
I really didn't pay attention to how the data disk was uninstalled   

Alibaba Cloud's SSD data disk to be mounted manually,

I mounted to the /home/wwwroot directory today no don't know the pro no
Posted on 8/14/2017 3:21:23 PM |
Summer Posted on 2017-8-14 15:16
I mounted to the /home/wwwroot directory today no don't know the pro no

Yes, /home/wwwroot is the root of all websites  

What control panel do you use?
 Landlord| Posted on 8/14/2017 3:38:54 PM |
Xiao Zhao Zha Posted on 2017-8-14 15:21
Yes, /home/wwwroot is the root of all websites  

What control panel do you use?

I mounted the data disk, all the other data was lost, and the amh I installed was also lost, but it's okay, I'm just practicing my hands, the control panel is amh
 Landlord| Posted on 8/14/2017 3:51:43 PM |
Before installing AMH, mount the data disk to home, and then install AMH
amh5.0 website file data and database data are under /home.
All environment directories /home/wwwroot/
Database directory /home/usrdata/
Create a backup directory /home/backup/
The amh software is under the /usr/local/ directory
 Landlord| Posted on 8/14/2017 4:00:46 PM |
This post was last edited by Summer on 2017-8-15 09:02

Solved the problem of modifying the default MYSQL database storage path method in the AMH system panel

First, copy the AMH panel database to the mount directory folder

Here you can see that the mounted data disk is in the HOME directory, which is generally like this, we can copy /usr/local/mysql/data to the /home/mysql folder.

cp -R /usr/local/mysql/data/ /home/mysql/

Execute SSH commands in one step.

Second, create a new database directory with soft links

Run the ln -s /home/mysql/data command in the /usr/local/mysql/ directory to create a soft link, and delete or change the name of the old DATA database folder, or change the name first.

Third, set the new MYSQL directory folder permissions

cd /home

chown -R mysql:mysql mysql/

Finally, restart the VPS to fix the problem

Posted on 8/14/2017 4:23:31 PM |
Summer Posted on 2017-8-14 15:38
I mounted the data disk, the other data is lost, the amh I installed is also lost, but it's okay, I'm just practicing my hands, the control panel is amh...

First of all, data is not lost! No data loss

After you mount, you access the files in the data disk, if you delete the mount, you access the system disk, and the data is not lost


Do you mount first, or install amh first?  It should be mounted first!
 Landlord| Posted on 8/14/2017 4:30:55 PM |
Xiao Zhao posted on 2017-8-14 16:23
First of all, data is not lost! No data loss

After you mount, you access the files in the data disk, if you delete the mount, you will access ...

Yes, it should be mounted first!
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com