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
On this page
Help Center/ Elastic Cloud Server/ User Guide (Paris Regions)/ FAQs/ Disk Partition, Attachment, and Expansion/ Why Does the Disk Drive Letter Change After the ECS Is Restarted?

Why Does the Disk Drive Letter Change After the ECS Is Restarted?

Updated on 2025-01-27 GMT+08:00

Symptom

For a Linux ECS, the drive letter may change after an EVS disk is detached and then attached again, or after an EVS disk is detached and then the ECS is restarted.

Root Cause

When a Linux ECS has multiple disks attached, it allocates drive letters in the attachment sequence and names the disks as /dev/vda1, /dev/vdb1, and /dev/vdc1, etc.

After a disk is detached and then attached again, or after a disk is detached and the ECS is restarted, the drive letter may change.

For example, an ECS has three disks attached: /dev/vda1, /dev/vdb1, and /dev/vdc1. The mounting parameters in /etc/fstab are as follows:

cat /etc/fstab

UUID=b9a07b7b-9322-4e05-ab9b-14b8050bdc8a  /  ext4  defaults  0  1 
/dev/vdb1                       /data1   ext4  defaults  0  0 
/dev/vdc1                       /data2   ext4  defaults  0  0

After /dev/vdb1 is detached and the ECS is restarted, /dev/vdc1 becomes /dev/vdb1 and is mounted to /data1. In such a case, no disk is mounted to /data2.

The change of drive letters can affect the running of applications. To solve this problem, you are advised to use the universally unique identifiers (UUIDs) to replace /dev/vdx because a UUID uniquely identifies a disk partition in the Linux OS.

Solution

  1. Log in to the ECS.
  2. Run the following command to obtain the partition UUID:

    blkid Disk partition

    In this example, run the following command to obtain the UUID of the /dev/vdb1 partition:

    blkid /dev/vdb1

    Information similar to the following is displayed:

    [root@ecs-test-0001 ~]# blkid /dev/vdb1 
    /dev/vdb1: UUID="b9a07b7b-9322-4e05-ab9b-14b8050cd8cc" TYPE="ext4"

    The UUID of the /dev/vdb1 partition is displayed.

  3. Run the following command to open the fstab file using the vi editor:

    vi /etc/fstab

  4. Press i to enter the editing mode.
  5. Move the cursor to the end of the file and press Enter. Then, add the following information:
    UUID=b9a07b7b-9322-4e05-ab9b-14b8050cd8cc    /data1   ext4    defaults        0 0

    The parameters are defined as follows:

    • UUID=b9a07b7b-9322-4e05-ab9b-14b8050cd8cc: UUID of a disk partition.
    • /data1: directory on which the partition is mounted. You can run df -TH to query the directory.
    • ext4: File system format of the partition. You can run df -TH to query the format.
    • defaults: partition mount option. Normally, this parameter is set to defaults.
    • 0 (the first one): whether to use Linux dump backup.
      • 0: Linux dump backup is not used. Normally, dump backup is not used, and you can set this parameter to 0.
      • 1: Linux dump backup is used.
    • 0 (the second one): fsck option, that is, whether to use fsck to check disks during startup.
      • 0: fsck is not used.
      • If the mount point is the root partition (/), this parameter must be set to 1.

        When this parameter is set to 1 for the root partition, this parameter for other partitions must start with 2 so that the system checks the partitions in the ascending order of the values.

  6. Repeat steps 2 to 5 to replace the UUID of /dev/vdc1.
  7. Run the following command again to check the disk mounting parameters:

    cat /etc/fstab

    The following information is displayed:

    UUID=b9a07b7b-9322-4e05-ab9b-14b8050bdc8a  /  ext4  defaults  0  1 
    UUID=b9a07b7b-9322-4e05-ab9b-14b8050cd8cc   /data1   ext4  defaults  0  0 
    UUID=b9a07b7b-9322-4e05-ab9b-14b8050ab6bb   /data2   ext4  defaults  0  0

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