- Documentation
Elastic Compute Service
Elastic Compute Service
Troubleshooting
Instance unable to start issue
Repair solution for corrupted file systems of Linux instances
Instance unable to start issue
Repair solution for corrupted file systems of Linux instances
Repair solution for corrupted file systems of Linux instances
This topic describes how to repair corrupted file systems of a Linux instance, with /dev/vdb used as an example.
Prerequisites
We recommend creating a snapshot first to back up instance data. This improves your fault tolerance and ensures data security. Procedure
- Execute the following command to confirm whether a file system is mounted on the instance.
- (Optional) If a file system is mounted, execute the following command to unmount it.
- Execute the following command to view the file system type of the target partition or storage device.
-
- Execute commands to check and repair the file system based on the file system type.
EXT3/EXT4 file system
XFS file system
VFAT/FAT32 file system
- Execute the following command to check whether an error exists in the file system.
tip
If the output contains an error about The super block Cloud no be read or does not describe a correct ext2 filesystem when you check for file system errors, skip to Step 3 for repair.
- If an error exists in the file system, execute the following command to repair it.
- If the superblock is corrupted, follow the steps below to repair it.
- Execute the following command to obtain backup superblock numbers.
- If the following output is displayed, it indicates that the backup superblock numbers for /dev/vdb are 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, and 4096000.
-
- When you cannot obtain the backup superblock numbers using the command, perform the following steps to obtain common backup superblock numbers.
- Execute the following command to obtain the block size.
sudo blockdev --getbsz /dev/vdb
- When the following output is displayed, it indicates that the block size of /dev/vdb is 4096 bytes:
-
- Refer to the following table to obtain the common backup superblock numbers corresponding to the block size.
- Execute the following command to repair the superblock using a backup superblock.
sudo e2fsck -b 32768 /dev/vdb
tip
- Replace 32768 with the actual backup superblock number. If the first backup superblock number is invalid, you can try other backup blocks in order.
- Replace /dev/vdb with the actual disk name rather than the partition name.
- Execute the following command to check whether an error exists in the file system.
sudo xfs_repair -n /dev/sdb
- If an error exists in the file system, execute the following command to repair it.
sudo xfs_repair /dev/sdb
- Execute the following command to check whether an error exists in the file system.
sudo fsck.vfat -n /dev/sdb
- If an error exists in the file system, execute the following command to repair it.
sudo fsck.vfat -a /dev/sdb
- After the repair is completed, execute the following command to restart the instance.
- (Optional) If the target volume is a system volume, mount the file system. If the target volume is a data volume, skip this step.
- Execute the following command to mount a file system.
tip
Replace /mnt with the actual mount point.
- Execute the corresponding command again to check the mounted file system.
- For XFS file system: xfs_repair /dev/vdb
- For EXT3 and EXT4 file systems: fsck -y /dev/vdb
- Here, fsck -y /dev/vdb is used as an example. Output similar to the following information indicates that the repair succeeds.
-
Last updated: 2026.06.18 17:49:51