All Products
Search
Document Center

CloudOps Orchestration Service:Automated repair for a damaged Linux ECS system disk

Last Updated:Jun 02, 2026

To repair an ECS instance with a damaged Linux system disk, use the OOS one-click repair feature.

Prerequisites

A RAM user is created with the AliyunOOSFullAccess, AliyunROSFullAccess, AliyunECSFullAccess, and AliyunVPCFullAccess policies attached. Create a RAM user, Policy overview.

Usage notes

Scenarios

An ECS instance with a damaged Linux system disk may appear as Running in the ECS console, but applications are inaccessible and the instance cannot be reached via ping, Workbench, or SSH. When you connect via VNC, you may see one of the following errors:

  • unexpected inconsistency;RUN fsck MANUALLY
  • Give root password for maintenance (or type CTRL-D to continue)
  • Enter 'help' for a list of built-in commands.
    (initramfs)

Possible causes:

  • Forced shutdown or restart.

  • Unexpected crash causing file system inconsistency.

  • A data disk was detached without removing its entry from /etc/fstab.

  • Missing or corrupted /etc/fstab file.

  • Corrupted initrd file.

  • Other file system damage.

Solution overview

This solution uses an OOS template tested by Alibaba Cloud for automated one-click repair. The template performs the following steps:

  1. Create an image backup of the instance.

  2. Detach the system disk and attach it to a temporary instance.

  3. Check and repair the system disk on the temporary instance.

  4. Reattach the repaired system disk to the original instance and try to restart it.

  5. Release the temporary instance.

Supported operating systems

  • CentOS: 7.2 64-bit, 7.3 64-bit, 7.4 64-bit, 7.5 64-bit, 7.6 64-bit, 7.7 64-bit, and 8.0 64-bit

  • Debian: 8.9 64-bit, 8.11 64-bit, 9.8 64-bit, 9.9 64-bit, and 9.11 64-bit

  • openSUSE: 42.3 64-bit and 15.1 64-bit

  • SUSE Linux Enterprise Server: 12 SP4 64-bit and 12 SP2 64-bit

  • Alibaba Cloud Linux: 2.1903 64-bit

  • Ubuntu: 18.04 64-bit

Important

This solution cannot repair all startup failures. A temporary instance is created during repair, incurring a fee typically less than USD 0.2. The solution modifies the fstab and initrd files. An image backup is automatically created before modification for data recovery. You are charged for the image backup. Snapshots. After repair, delete the backup to reduce costs.

Procedure

  1. Log on to the CloudOps Orchestration Service console.

  2. In the left-side navigation pane, choose Automated Task > Public Template. Search for the ACS-ECS-RescueUnreachableInstance-Linux template.image

  3. Click Create an execution.

  4. Click Next Step: Parameter Settings.image

  5. Set the following parameters:

    • UnreachableInstanceId: required. ID of the instance to repair.

    • CredentialType: required. Authentication type for reattaching the repaired disk. Valid values: KeyPairName, Password.

    • Credential: required. The key pair name or password, depending on CredentialType.

    • ImagePrefix: optional. Prefix for the backup image name. Default: OOSRescueBackup-.

    • HelperInstanceTypes: optional. Instance type for the temporary instance. Defaults to the lowest-priced type available.

    • OOSAssumeRole: Select Use Existing Permissions of Current Account.

  6. Click Next Step: OK. In the OK step, click Create.image

View the execution status on the details page, or check repair script output via the rtCommandOutput parameter. Execution takes 5 to 10 minutes. After successful execution, the instance is repaired and enters the Running state.

(Optional) Attach the system disk and repair the instance

If template execution is canceled or interrupted, the system disk may not be reattached. To reattach it manually:

  1. Log on to the ECS console and find the instance.

  2. Click the instance ID to go to the instance details page.

  3. Click the Block Storage (Disks) tab. On this tab, you can view the ID of the system disk on the Cloud Disk tab.

  4. Click Attach Disk.

  5. The system disk ID prefixed with d-bp is displayed.

  6. Copy the system disk ID and paste it to the search box to search for the system disk.

    • If the disk ID is found:

      1. Select the disk ID.

      2. Specify the logon credential: a key pair or a custom password.

      3. Click OK, and then click Attach.

      4. If the mount is successful, the instance status changes to Stopped.

    • If the disk ID is not found:

      1. View the execution details of the OOS template, and find the HelperInstanceId parameter in the output of the untilStackReady task.

      2. Copy the instance ID that is prefixed with i-.

      3. Search for the instance ID in the ECS console and release the temporary instance.

      4. After the instance is released, repeat the previous steps to search for the system disk by its ID (prefixed with d-bp) and attach it to the instance.

Implementation logic

Repair the /etc/fstab file

  • Check if /etc/fstab exists. If it does, create a backup.

  • Repair /etc/fstab. If the file is missing or unparseable, create a default.

  • Add the nofail option if not set to prevent startup failures.

  • Disable fsck if enabled.

Update the ramdisk file

  • Check if the ramdisk file exists in /boot. If it does, create a backup.

  • Rebuild the ramdisk file.