Help Center> Intelligent EdgeCloud> User Guide> Common Operations> Detaching Data Disks from an Edge Instance

Detaching Data Disks from an Edge Instance

Scenarios

If multiple data disks are attached to an edge instance used to create a private image, the edge instances created from the image may be unavailable. Therefore, you need to detach all data disks from the edge instance before you use it to create a private image.

This section describes how to detach all data disks from an edge instance.

Prerequisites

You have logged in to the edge instance used to create a Linux private image.

Procedure

  1. Check whether the edge instance has data disks.

    Check the number of data disks attached to the edge instance.

    fdisk -l

    • If the number is greater than 1, the edge instance has data disks. Go to 2.
    • If the number is 1, no data disk is attached to the edge instance. Go to 3.

  2. Check the data disks attached to the edge instance.

    mount

    • If the command output does not contain any data disk information, no data disks need to be detached.
    /dev/vda1 on / type ext4 (rw,relatime,data=ordered)
    • If information similar to the following is displayed, go to 3.
    /dev/vda1 on / type ext4 (rw,relatime,data=ordered) 
    /dev/vdb1 on /mnt/test type ext4 (rw,relatime,data=ordered)

  3. Delete the configuration information in the fstab file.

    1. Edit the fstab file.

      vi /etc/fstab

    2. Delete disk configuration from the fstab file.

      The /etc/fstab file contains information about the file systems and storage devices automatically attached to the edge instance when the edge instance starts. The configuration about data disks automatically attached to the edge instance needs to be deleted, for example, the last row shown in the following figure.

      Figure 1 Data disk configuration in the fstab file

  4. Detach data disks from the edge instance.

    Ensure that no data read and write operations are being performed on the data disks that will be detached. Otherwise, the detaching operation will fail.

    umount /dev/vdb1

  5. Check the data disks attached to the edge instance.

    mount

    If the command output contains no information about the data disks, they have been detached from the edge instance.