tencent cloud

Feedback

Login Failure Due to /etc/fstab Configuration Errors

Last updated: 2024-01-06 17:32:18

    Error Description

    Error: Unable to remotely log in to the Linux CVM via SSH. After logging in to the CVM via VNC, you can check the system start-up failure and view the prompt message "Welcome to emergency mode".
    
    

    Possible Causes

    The /etc/fstab is not properly configured. For example, you've configured the auto-attaching of disk based on device name in the /etc/fstab file. If the device name is changed when the CVM restarts, this configuration will cause the system to fail to start up normally.

    Solutions

    See Steps to repair the /etc/fstab configuration file. Then, restart the CVM to verify the repaired file.

    Steps

    You can access the instance in the following 2 methods for troubleshooting:
    Method 1: Login via VNC (recommended)
    Method 2: Use rescue mode
    2. After entering the VNC interface, you see the interface shown in Error Description. Enter the root account password and press Enter to log in to the server.
    The entered password is not displayed by default.
    If you do not have or forgot the root account password, see Method 2 for troubleshooting.
    3. 
    Run the following command to back up the /etc/fstab file to the /home directory, for example:
    
    cp /etc/fstab /home
    4. Run the following command to use VI editor to open the /etc/fstab file.
    vi /etc/fstab
    5. Press i to enter the edit mode. Move the cursor to the beginning of the error line and enter # to comment out this configuration.
    Note:
    If you cannot determine the error, it is recommended that you comment out the configurations of all attached disks except the system disks, and then configure the file as instructed in Step 8 after the server recovers.
    
    
    
    6. 
    Press Esc, enter :wq, and press Enter to save the configuration and exit the editor.
    
    7. Restart the instance in the CVM console to see if it can be started and logged in properly.
    Note:
    Restart the instance through the console. For more information, see Restarting Instances.
    8. After successful login, if you need to configure the auto-attaching of the disk, see Cloud Disk Automount Failed upon Linux CVM Restart.
    1. Enter the instance rescue mode, see Using Rescue Mode.
    Note:
    Run the mount and chroot commands as instructed in Using rescue mode to repair system, and make sure that you have entered the target system.
    2. Follow Step 3 - Step 6 in Method 1 to repair the /etc/fstab file.
    3. Exit the rescue mode as instructed in Exiting rescue mode.
    4. After the instance exits the rescue mode, it is still shut down. Start it up as instructed in Starting Up Instances. Then, verify whether the system can be started up and logged in normally.
    5. After successful login, if you need to configure the auto-attaching of the disk, see Cloud Disk Auto-mount Failed upon Linux CVM Restart.
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support