After creating a snapshot of an expanded disk and restoring it, the disk cannot be used

Symptom

  1. A virtual machine runs KylinV10SP3 2403. A data disk is attached, formatted as ext4, and mounted to the corresponding mount point.
  2. Data is written to the data disk.
  3. The data disk is expanded.
  4. A snapshot is created for the data disk.
  5. The virtual machine is shut down, the disk snapshot is restored, and the virtual machine is started. When re-mounting the disk inside the operating system, the following error appears: mount: $MOUNT_POINT: cannot mount; probably corrupted filesystem on $DEVICE

Cause

A bug was introduced in operating system kernel versions earlier than 4.19.90-89.19.v2401.ky10 (exclusive).

Solution

  1. Restore the affected disk to normal operation.

    If you have expanded a data disk, created a snapshot, and restored the snapshot, and the disk is now unusable, run the following command to mount and use the disk normally:

    [root@localhost~]# debugfs -w `$DEVICE`
    --------------------------
    debugfs: set_super_value checksum 0x0
    debugfs: quit
  2. Upgrade the virtual machine kernel to version 89.19 or later to prevent this issue from occurring when expanding disks and restoring snapshots in the future.

On this page