El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

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 Cloud Server/ Troubleshooting/ Linux ECS Issues/ Why Is My Linux ECS Not Booting and Going Into Emergency Mode?

Why Is My Linux ECS Not Booting and Going Into Emergency Mode?

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

Symptom

Your Linux ECS enters the emergency mode during startup, and displays the message "Welcome to emergency mode", asking you to enter the password of user root for maintenance.

Figure 1 Emergency mode

Possible Cause

The emergency mode allows you to recover the system even if the system fails to enter the rescue mode. In emergency mode, the system installs only the root file system for data reading. It does not attempt to install any other local file systems or activate network interfaces.

The system enters the emergency mode when:

  • An error occurred in the /etc/fstab file, leading to the failure in mounting the file system.
  • An error occurred in the file system.

Constraints

The operations in this section are applicable to Linux. The operations involve recovering the file system, which may lead to data loss. You need to back up data before recovering the file system.

Solution

  1. Enter the password of user root and press Enter to enter the recovery mode.
  2. Run the following command to mount the root partition in read-write mode to modify the files in the root directory:

    mount -o rw,remount /

  3. Run the following command to try to mount all unmounted file systems:

    mount -a

    • If the message "mount point does not exist" is displayed, the mount point is unavailable. In such a case, create the mount point.
    • If the message "no such device" is displayed, the file system device is unavailable. In such a case, comment out or delete the mount line.
    • If the message "an incorrect mount option was specified" is displayed, the mount parameters have been incorrectly set. In such a case, correct the parameter setting.
    • If no error occurs and the message "UNEXPECTED INCONSISTENCY;RUN fsck MANUALLY" is displayed, the file system is faulty. In such a case, go to 7.
  4. Run the following command to open the /etc/fstab file and correct the error:

    vi /etc/fstab

    The /etc/fstab file contains the following parameters separated by space:

    [file system] [dir] [type] [options] [dump] [fsck]

    Table 1 /etc/fstab parameters

    Parameter

    Description

    [file system]

    Specifies the partition or storage device to be mounted.

    You are advised to set file system in UUID format. To obtain the UUID of a device file system, run the blkid command.

    Format for reference:

    # <device> <dir> <type> <options> <dump> <fsck>

    UUID=b411dc99-f0a0-4c87-9e05-184977be8539 /home ext4 defaults 0 2

    UUIDs are independent from the disk order. If the sequence of storage devices is changed manually or undergoes some random changes by some BIOSs, or the storage devices are removed and installed again, UUIDs are more effective in identifying the storage devices.

    [dir]

    Specifies the mount point of a file system.

    [type]

    Specifies the type of the file system to which a device or partition is mounted. The following file systems are supported: ext2, ext3, ext4, reiserfs, xfs, jfs, smbfs, iso9660, vfat, ntfs, swap, and auto.

    If type is set to auto, the mount command will speculate on the type of the file system that is used, which is useful for mobile devices, such as CD-ROM and DVD.

    [options]

    Specifies the parameters used for mounting. Some parameters are available only for specific file systems. For example, defaults indicates the default mounting parameters of a file system will be used. The default parameters of the ext4 file system are rw, suid, dev, exec, auto, nouser, and async.

    For more parameters, run the man mount command to view the man manual.

    [dump]

    Specifies whether file system data will be backed up.

    The value can be 0 or 1. 0 indicates that data will not be backed up, and 1 indicates that data will be backed up. If you have not installed dump, set the parameter to 0.

    [fsck]

    Specifies the sequence of checking file systems.

    The parameter value can be 0, 1, or 2. 0 indicates that the file systems will not be checked by fsck. 1 indicates the highest priority of the root directory to be checked by fsck, and 2 indicates the lower priority of other systems to be checked.

  5. After the modification, run the following command to check the fstab file:

    mount -a

  6. Run the following command to restart the ECS:

    reboot

  7. Run the following command to check for file system errors:

    dmesg |egrep "ext[2..4]|xfs" |grep -i error

    NOTE:
    • If the error message "I/O error... inode" is displayed, the fault is caused by a file system error.
    • If no error is found in the logs, the fault is generally caused by the damaged superblock. The superblock is the header of the file system. It records the status, size, and idle disk blocks of the file system.
    • If the superblock of a file system is damaged, for example, data is written to the superblock of the file system by mistake, the system may fail to identify the file system. As a result, the system enters the emergency mode during startup. The ext2fs file system backs up the superblock and stores the backup at the block group boundary of the driver.
  8. Run the following command to unmount the directory where the file system error occurred:

    umount Mount point

  9. Recover the damaged file system.
    NOTICE:

    Recovering the file system may lead to data loss. Back up data before the recovery.

    • For the ext file system, run the following command to check whether the file system is faulty:

      fsck -n /dev/vdb1

      NOTE:

      If the message "The super block Cloud no be read or does not describe a correct ext2 filesystem" is displayed, go to step 10.

      To recover the file system, run the following command:

      fsck /dev/vdb1

    • For the xfs file system, run the following command to check whether the file system is faulty:

      xfs_repair -n /dev/vdb1

      To recover the file system, run the following command:

      xfs_repair /dev/vdb1

  10. (Optional) If the message "The super block Cloud no be read or does not describe a correct ext2 filesystem" is displayed, the superblock is damaged. In such a case, use the superblock backup for recovery.
    Figure 2 Damaged superblock

    Run the following command to replace the damaged superblock with the superblock backup:

    e2fsck -b 8193 Device name

    As shown in Figure 3, the damaged superblock has been replaced.

    Figure 3 Replacing the damaged superblock
    NOTE:

    -b 8193 indicates that the backup of superblock 8193 in the file system is used.

    The location of the superblock backup varies depending on the block size of the file system. For a file system with a 1 KB block size, locate the backup at superblock 8193; for a 2 KB block size, locate the backup at superblock 16384; for a 4 KB block size, locate the backup at superblock 32768.

  11. Run the following command to restart the ECS:

    reboot

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback