When you need to mount an elastic cloud disk with the disk attribute set to Data Disk to another CVM, you can proactively unmount the elastic cloud disk from the CVM and mount it to another CVM. Unmounting an elastic cloud disk will not erase the data on the disk.
Currently, only elastic cloud disks with the disk attribute set to Data Disk can be unmounted. System disks and non-elastic cloud disks cannot be unmounted. Before unmounting a cloud disk, you must first execute theumount(Linux) or offline (Windows) operation, otherwise, the CVM may not recognize the elastic cloud disk when it is mounted again.
Preparations
Before unmounting the data disk, make sure you understand the following prerequisites:
Windows OS
Linux OS
To prevent data loss, we recommend that you suspend read and write operations on all file systems of the disk. Otherwise, data that has not been read or written will be lost.
Ensure that no processes are occupying the cloud disk that needs to be unmounted (such as Task Manager processes). Before unmounting an elastic cloud disk, you need to set the disk to offline status. Otherwise, without rebooting the CVM, you may not be able to mount the elastic cloud disk again. See below:
You need to first log in to the instance and perform the umount operation on the elastic cloud disk that needs to be unmounted. If it is forcibly unmounted without performing the umount operation, problems as shown in the following figure may occur during shutdown and startup:
If you have created a Logical Volume Manager (LVM) within the CVM, directly unmounting the disk from the console will leave some device data in the CVM's memory. If an application within the CVM tries to traverse or access the device, a system error will occur. Therefore, you need to perform the following operations in advance (this example assumes that a logical volume /dev/test/lv1 is created based on /dev/vdb1 and mounted in the /data directory):
a. Run the umount /data command to unmount the corresponding disk mount point within the CVM.
b. Run the lvremove /dev/test/lv1 command to remove the Logical Volume (LV). If there are multiple LVs, remove all LVs in sequence.
c. Run the vgremove test command to remove the volume group.
d. Run the pvremove /dev/vdb1 command to remove the physical volume.
e. Modify the /etc/fstab file to prevent the corresponding LV from being mounted again at the next startup.
2. You can unmount the cloud disk in the following ways:
a. Single unmount: Click on More > Unmount in the row of the target cloud disk with the status Mounted.
b. Batch unmount: Select multiple target cloud disks with the status Mounted and click Unmount at the top of the list.
3. In the pop-up Unmount Cloud Disk dialog box, confirm the warning items and click Confirm to complete the unmounting process.
You can use the DetachDisks interface to unmount the cloud disk. For more details, please refer to Unmounting Cloud Disk.
FAQs
If you cannot unmount the cloud disk from your Windows CVM via the console, please refer to Windows CVM Unable to Unmount Cloud Disk to troubleshoot and resolve the issue.