Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Elastic Volume Service/ Getting Started/ Quickly Buying an EVS Disk and Using It on a Linux Server

Quickly Buying an EVS Disk and Using It on a Linux Server

Updated on 2024-10-10 GMT+08:00

Scenarios

You can use EVS disks as system disks or data disks. System disks are purchased together with servers, while data disks can be purchased together with servers or separately. If you buy data disks separately, you must attach and initialize them before they can be used.

This section describes how a non-shared data disk can be purchased on the EVS console, attached to a Linux server, and initialized on the server.

Operation Process

Procedure

Description

Making Preparations

  • Sign up for a HUAWEI ID, enable Huawei Cloud services, and top up your account.
  • Buy a cloud server.

Step 1: Purchase an EVS Disk

Buy a data disk on the EVS console.

Step 2: Attach the EVS Disk

Attach the data disk to a Linux server.

Step 3: Initialize the EVS Disk

Initialize the data disk on the server.

Making Preparations

  1. Sign up with Huawei Cloud.
  2. Top up your account.
  3. Ensure that a server has been purchased.

Step 1: Purchase an EVS Disk

  1. Go to the Buy Disk page.
  2. Configure mandatory parameters based on the following table and retain the default settings for other parameters.

    Parameter

    Example Value

    Description

    Region

    CN South-Guangzhou

    Resources are region-specific and cannot be used across regions through internal network connections. For low network latency and quick resource access, select the nearest region.

    AZ

    AZ1

    You can only attach EVS disks to servers in the same AZ. After a disk is purchased, its AZ cannot be changed.

      

    Later

    You can attach the disk after it is purchased.

    Billing Mode

    Pay-per-use

    To learn more about EVS pricing, see Billing.

    Data Source

    Do not configure it.

    If you want to create an empty data disk, do not configure a data source.

    Disk Type

    Ultra-high I/O

    To learn more about disk types, see Disk Types and Performance.

    Capacity

    100 GiB

    Enter a disk capacity.

    Automatic Backup

    Do not use

    Automatic backup allows you to back up the disk data to ensure your data security and integrity.

    More > Share

    Do not selection this option.

    A non-shared disk can only be attached to one server. The sharing attribute of a disk cannot be changed after the disk has been purchased.

    More > SCSI

    Select this option.

    A SCSI disk allows the server OS to directly access the underlying storage media and send SCSI commands to the disk. The device type of a disk cannot be changed after the disk has been purchased.

    More > Encryption

    Select this option and use the default key.

    EVS uses the industry-standard XTS-AES-256 cryptographic algorithm and keys to encrypt EVS disks. The encryption attribute of a disk cannot be changed after the disk has been purchased.

    Disk Name

    volume-0001

    Enter a disk name.

    Quantity

    1

    The preset disk quantity is 1, which means only one disk is created.

  3. Click Next.
  4. Go back to the disk list page. When the status of the volume-0001 disk changes to In-use, the disk is successfully created.

Step 2: Attach the EVS Disk

EVS disks cannot be used alone. You need to attach them to cloud servers first.

  1. In the disk list, find the volume-0001 disk and click Attach in the Operation column.
  2. Attach the volume-0001 disk to your desired server. Ensure that the server and disk are in the same AZ.

  3. Click OK to go back to the disk list page. When the status of the volume-0001 disk changes to In-use, the disk is successfully attached.

Step 3: Initialize the EVS Disk

After attaching the volume-0001 disk, you need to initialize it before it can be used. The following example uses fdisk to format the disk into two primary MBR partitions, with one 40 GiB and the other 60 GiB.

  1. Log in to the server.

    For how to log in to an ECS, see Logging In to an ECS.

    For how to log in to a BMS, see Logging In to a BMS.

  2. Create two primary partitions, /dev/vdb1 and /dev/vdb2 for data disk /dev/vdb.

    1. Check that the capacity of the /dev/vdb data disk is 100 GiB.
      lsblk
      [root@ecs-centos76 ~]# lsblk
      NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
      vda    253:0    0  40G  0 disk
      ├vda1 253:1    0   1G  0 part /boot
      └vda2 253:2    0  39G  0 part /
      vdb    253:16   0  100G 0 disk
    1. Create the first primary partition /dev/vdb1.

      fdisk /dev/vdb

      n

      p

      1
      NOTE:
      • Entering p for Partition type creates a primary partition, and entering e creates an extended partition.
      • Value 1 is the primary partition number.
      [root@ecs-test-0001 ~]# fdisk /dev/vdb
      Welcome to fdisk (util-linux 2.23.2).
      
      Changes will remain in memory only, until you decide to write them.
      Be careful before using the write command.
      
      Device does not contain a recognized partition table
      Building a new DOS disklabel with disk identifier 0x38717fc1.
      
      Command (m for help): n
      Partition type:
         p   primary (0 primary, 0 extended, 4 free)
         e   extended
      Select (default p): p
      Partition number (1-4, default 1): 1

      Set First sector to 2048 and Last sector to 83886079 for partition /dev/vdb1 (40 GiB).

      First sector (2048-209715199, default 2048): 2048
      Last sector, +sectors or +size{K,M,G} (2048-209715199, default 209715199):83886079
      Partition 1 of type Linux and of size 40 GB is set
    1. Create the second primary partition /dev/vdb2.

      n

      p

      2

      Command (m for help): n
      Partition type:
         p   primary (0 primary, 0 extended, 4 free)
         e   extended
      Select (default p): p
      Partition number (1-4, default 2): 2

      Set the First sector to 83886080 and Last sector to 209715199 for partition /dev/vdb2.

      First sector (83886080-209715199, default 83886080): 83886080
      Last sector, +sectors or +size{K,M,G} (83886080-209715199, default 209715199):209715199
      Partition 2 of type Linux and of size 60 GB is set
      NOTE:

      First and last sectors of the partitions in this example are calculated as follows:

      Sector value = Capacity/512 bytes, 1 GiB = 1073741824 bytes

      • First sector (2048-209715199, default 2048) shows the sector value range of the /dev/vdb data disk (100 GiB).

        First sector = 2048

        Last sector = Sector value – 1 = (100 x 1073741824/512) – 1 = 209715200 – 1=209715199

      • For the first partition /dev/vdb1 (40 GiB) of the /dev/vdb data disk:

        First sector = 2048 (The start sector of the /dev/vdb data disk is used.)

        Last sector = Sector value – 1 = (40 x 1073741824/512) – 1 = 83886079

      • For the second partition /dev/vdb2 (60 GiB) of the /dev/vdb data disk:

        First sector = Last sector of /dev/vdb1 + 1 = 83886079 + 1 = 83886080

        Last sector = First sector + Sector value – 1 = 83886080 + (60 x 1073741824/512) – 1 = 209715199

  3. Check the sizes and partition styles of the new partitions.

    1. Check whether the partitioning is successful.
      p
      Command (m for help): p
      
      Disk /dev/vdb: 107.4 GB, 107374182400 bytes, 209715200 sectors
      Units = sectors of 1 * 512 = 512 bytes
      Sector size (logical/physical): 512 bytes / 512 bytes
      I/O size (minimum/optimal): 512 bytes / 512 bytes
      Disk label type: dos
      Disk identifier: 0x994727e5
      
         Device Boot       Start         End      Blocks   Id  System
      /dev/vdb1             2048    83886079    41942016   83  Linux
      /dev/vdb2         83886080   209715199    62914560   83  Linux
      
      Command (m for help):
      NOTE:

      In case that you want to discard the changes made before, you can exit fdisk by entering q and press Enter. Then, re-create the partitions by referring to step 1.

    1. Write the changes to the partition table and synchronize the new partition table to the OS.

      w

      partprobe

      NOTE:

      If error message -bash: partprobe: command not found is returned, the system cannot identify the command. In this case, run yum install -y parted to install the command. Then run the command again.

    1. Confirm that the partition style is MBR.

      parted /dev/vdb

      p
      NOTE:

      If Partition Table: msdos is returned, the partition style is MBR.

      [root@ecs-test-0001 ~]# parted /dev/vdb
      GNU Parted 3.1
      Using /dev/vdb
      Welcome to GNU Parted! Type 'help' to view a list of commands.
      (parted) p
      Model: Virtio Block Device (virtblk)
      Disk /dev/vdb: 107GB
      Sector size (logical/physical): 512B/512B
      Partition Table: msdos
      Disk Flags:
      
      Number  Start   End      Size     Type     File system  Flags
       1      1049kB  42.9GB   42.9GB   primary
       2      42.9GB  107GB    64.4GB   primary             
      
      (parted) q
      [root@ecs-test-0001 ~]# 

      Enter q and press Enter to exit parted.

  4. Create ext4 file systems for partitions /dev/vdb1 (40 GiB) and /dev/vdb2 (60 GiB).

    mkfs -t ext4 /dev/vdb1

    mkfs -t ext4 /dev/vdb2

    NOTE:

    It takes some time to create file systems. Do not exit before the system returns the following information:

    [root@ecs-test-0001 ~]# mkfs -t ext4 /dev/vdb1
    mke2fs 1.42.9 (28-Dec-2013)
    Filesystem label=
    OS type: Linux
    Block size=4096 (log=2)
    Fragment size=4096 (log=2)
    Stride=0 blocks, Stripe width=0 blocks
    2621440 inodes, 10485504 blocks
    524275 blocks (5.00%) reserved for the super user
    First data block=0
    Maximum filesystem blocks=2157969408
    320 block groups
    32768 blocks per group, 32768 fragments per group
    8192 inodes per group
    Superblock backups stored on blocks:
            32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
            4096000, 7962624
    
    Allocating group tables: done
    Writing inode tables: done
    Creating journal (32768 blocks): done
    Writing superblocks and filesystem accounting information: done

    Check whether the file system format is ext4.

    parted /dev/vdb

    p

    [root@ecs-test-0001 ~]# parted /dev/vdb
    GNU Parted 3.1
    Using /dev/vdb
    Welcome to GNU Parted! Type 'help' to view a list of commands.
    (parted) p
    Model: Virtio Block Device (virtblk)
    Disk /dev/vdb: 107GB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    Disk Flags:
    
    Number  Start   End      Size     Type     File system  Flags
     1      1049kB  42.9GB   42.9GB   primary  ext4
     2      42.9GB  107GB    64.4GB   primary  ext4            
    
    (parted) q
    [root@ecs-test-0001 ~]#

    Enter q and press Enter to exit parted.

  5. Create directories (mount points) and mount the new partitions on the created mount points.

    mkdir -p /mnt/sdc

    mkdir -p /mnt/sdd

    mount /dev/vdb1 /mnt/sdc

    mount /dev/vdb2 /mnt/sdd

    lsblk

    View the mount results.

    [root@ecs-test-0001 ~]# lsblk
    NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    vda    253:0    0  40G  0 disk
    ├vda1 253:1    0  40G  0 part /
    vdb    253:16   0 100G  0 disk
    ├vdb1 253:17   0  40G  0 part /mnt/sdc
    ├vdb2 253:18   0  60G  0 part /mnt/sdd

    You should now see that partitions /dev/vdb1 and /dev/vdb2 are mounted on /mnt/sdc and /mnt/sdd.

  6. Use the partition UUIDs to configure auto mount at startup.

    NOTE:
    • Mounts become invalid after a system reboot. You can configure auto mount at startup by adding information of the new partition into the /etc/fstab file.
    • You are advised not to use device names to identify disks in the /etc/fstab file because device names are assigned dynamically and may change (for example, from /dev/vdb1 to /dev/vdb2) after a stop or start. This can even prevent your server from booting up.
    • UUIDs are the unique character strings for identifying partitions in Linux.
    • This operation will not affect the existing data on the ECS.
    1. Query the partition UUIDs.

      blkid /dev/vdb1

      blkid /dev/vdb2

      [root@ecs-test-0001 ~]# blkid /dev/vdb1
      /dev/vdb1: UUID="0b3040e2-1367-4abb-841d-ddb0b92693df" TYPE="ext4"
      /dev/vdb2: UUID="0d6769k2-1745-9dsf-453d-hgd0b34267dj" TYPE="ext4"

      The UUIDs of partitions /dev/vdb1 and /dev/vdb2 are 0b3040e2-1367-4abb-841d-ddb0b92693df and 0d6769k2-1745-9dsf-453d-hgd0b34267dj.

    1. Configure auto mount at startup.

      vi /etc/fstab

      Press i to enter the editing mode, move the cursor to the end of the file, press Enter, and add the following content:

      UUID=0b3040e2-1367-4abb-841d-ddb0b92693df    /mnt/sdc     ext4    defaults     0    2
      UUID=0d6769k2-1745-9dsf-453d-hgd0b34267dj    /mnt/sdd     ext4    defaults     0    2

      Press Esc, enter :wq, and press Enter to save the settings and exit the vi editor.

      Table 1 Parameter description

      Example Value

      Description

      UUID=0b3040e2-1367-4abb-841d-ddb0b92693df

      The UUID of the partition.

      /mnt/sdc

      The mount point of the partition.

      ext4

      The file system format of the partition.

      defaults

      The partition mount option. Normally, this parameter is set to defaults.

      0

      • The Linux dump backup option.
        • 0: Linux dump backup is not used. Usually, dump backup is not used, and you can set this parameter to 0.
        • 1: Linux dump backup is used.

      2

      • The fsck option, which means whether to use fsck to check the disk during startup.
        • 2: The check starts from the partitions whose mount points are non-root directories. / is the root directory.
        • 1: The check starts from the partitions whose mount points are root directories.
        • 0: The fsck option is not used.

  7. Verify that auto mount takes effect.

    umount /dev/vdb1

    umount /dev/vdb2

    mount -a

    The system reloads all the content in the /etc/fstab file.

    Query file system mounting information.

    mount | grep /mnt/sdc

    mount | grep /mnt/sdd

    If information similar to the following is displayed, auto mount has taken effect:

    root@ecs-test-0001 ~]# mount | grep /mnt/sdc
    /dev/vdb1 on /mnt/sdc type ext4 (rw,relatime,data=ordered)
    root@ecs-test-0001 ~]# mount | grep /mnt/sdd
    /dev/vdb2 on /mnt/sdd type ext4 (rw,relatime,data=ordered)

You can use the disk after it is initialized.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback