Skip to content

Running fsck on a LUKS encrypted partition in LVM

Coming back from a reboot yesterday afternoon, I ran into some bad attribute blocks that fsck couldn’t handle in the boot space and shelled me out to take care of it. Since I was not in the office or staying there for much longer, I powered down to take care of when I got home.

Doing this fsck was a bit needlessly complicated, especially as it was not at all like what I’ve done before nor what the boot shell recommended, which was to run fsck without -a or -p. I couldn’t find enough pieces to figure it out from Google. I eventually got pretty far but was stuck in something weird that Red Hat’s helpdesk helped me figure out. Note that world — Red Hat has a helpdesk that actually helps people.

Skipping all the false pathways I took, here are the steps that worked:

  1. You need a better environment than the Fedora 8 rescue CD. The rescue CD does not have the kernel modules to handle the LUKS decryption. I used an F8 live CD.  (This sounds like it’s fixed in the rescue mode currently in rawhide.)
  2. Decrypt the partition at the command line, for example: cryptsetup openLuks /dev/mapper/ VolGroup00-LogVol02 home
    • Note that you have given the name of ‘home’ to the decrypted partition; a name is required by cryptsetup
    • The unlocked volume is now /dev/mapper/home
  3. Run fsck on the unlocked volume: fsck.ext3 /dev/mapper/home

Ah, three simple steps … that took more than 3 hours to figure out. But all is good now. 🙂