Phenomenon

My LUKS partition used for system live backup couldn’t pass disk checking during system booting.

img

img

Cause

When fsck detects an error during system boot, it seems it will not try to correct the error. A manual check is needed.

Solution

  1. Enter the maintenance mode.
  2. Disable the automatic disk check in /etc/fstab by changing the last field below from the original 2 to 01. Then the system can start without disk checking. Maybe this step can be omitted and execute the following steps directly in the maintenance model.

    /dev/mapper/live-backup /media/backup ext4 rw,relatime 0 0
    
  3. After system reboot, backup all LUKS partition headers, in case they are broken someday in the future.

    sudo cryptsetup luksHeaderBackup /dev/sda4 --header-backup-file home.img
    sudo cryptsetup luksHeaderBackup /dev/sdb1 --header-backup-file live-backup.img
    
  4. Umount /dev/mapper/live-backup and manually perform disk checking and repairing.

    sudo fsck -y /dev/mapper/live-backup
    
  5. Restore the last field for /dev/mapper/live-backup in /etc/fstab to 2 in /etc/fstab, then restart the system.

Footnotes

1 The value 2 means the disk check will be checked after the root file system and 0 means disable this checking.