All Documents
Current Document

Content is empty

If you don't find the content you expect, please try another search term

Documentation

Mount a local data disk

Last updated:2021-08-03 18:56:33

After a KEC instance is created, you must log in to its operating system and mount local data disks. Optional login methods include console (WebVNC) login, SSH login, and remote connection. For more information, see Connect to instances.

This topic describes how to mount a local data disk. The formatting method described in this topic applies to a data disk of up to 2 TB. If the data disk is larger than 2 TB, refer to Partition and format a data disk of over 2 TB.

Mount a local data disk in Linux

Format a data disk

  1. Enter fdisk -l to view information about the data disks mounted to the KEC instance.

    View data disk information.png

  2. Partition the data disks. A data disk named vdb is used as an example.

    a. Enter fdisk/dev/vdb to partition the data disk.

    b. Enter n to create a partition.

    c. Enter p to create a single partition, or e to create multiple partitions.

    d. Enter the partition number. Optional values are 1 to 4.

    e. Set the first sector of the partition. If you press the Enter key, the value 2048 is used by default.

    f. Set the last sector of the partition. If you press the Enter key, the maximum value is used by default.

    g. Enter w to complete the partitioning and exit.

    Data disk partitioning.png

  3. Format the new partition vdb1 of the data disk. The ext4 file system is used as an example. Enter mkfs.ext4 /dev/vdb1.

    Format the data disk using ext4.png

Create a mount point and mount the data disk

  1. Create a mount point. In this example, the mount point is named data. Enter mkdir /data.

    Mount point mkdir.png

  2. Enter mount /dev/vdb1 /data to manually mount the partition vdb1 to the mount point data.

    mount.png

  3. Enter df -h to view the mounted file system.

    dfh.png

Configure auto-mount at startup

You must set the partition vdb1 to automatically mount at startup. Otherwise, you cannot see the file system upon startup.

  1. Enter vim /etc/fstab to open the /etc/fstab file.
  2. Append /dev/vdb1 /data ext4 defaults 0 0 to the end of the file.

    image.png

Mount a local data disk in Windows

Bring a data disk online

  1. Log in to the KEC instance and open Computer Manager.

  2. On the left navigation pane, choose Storage > Disk Management.

  3. Right-click the target data disk and select Online.

  4. Initialize the disk. You can select the MBR or GPT partition format. If the disk size is larger than 2 TB, select the GPT partition format.

Create a volume

  1. Right-click the mounted data disk and select New Volume.

  2. In the New Volume Wizard, use the default server and disk settings and click Next.

  3. Set the volume size and click Next.

    Set the volume size.png

  4. Assign a drive letter or folder and click Next.

  5. Select a file system, set the allocation unit size and a volume label name, and then click Next. This example uses the default settings.

  6. Confirm your parameter values and click Create.

Verify the mounting result

  1. Launch This PC.

  2. Check for any new volume in the Devices and Drives section. In this example, you can see New Volume (D:), which indicates that the data disk is mounted.

You can perform data read and write operations on the partition where a volume is created.

On this page
Pure ModeNormal Mode

Pure Mode

Click to preview the document content in full screen
Feedback