How to perform xfs_repair on encrypted partition

I got problems with xfs partition, I would perform an xfs_repair on that partition. According documentation of xfs_repair the partition should not be mounted and some post suggest to boot on usb key and then perform the repair. My problem is the partition is encrypted and I have no idea how to open an encrypted partition.

My question is: How to perform an xfs_repair when the partition is encrypted ?


  1. I can boot on the computer because the corrupted system is /home but after the boot the /home is mounted and xfs_repair couldn’t be perform
  2. I can boot using an usb key but I don’t know how open the partition

Thanks for your help or advice’s.

Information’s about partition:
Périphérique : /dev/sdb1
Taille : 0.91 TiB
Chiffrement : Oui
Chemin d’accès au périphérique : pci-0000:00:17.0-ata-3-part1
ID du périphérique 1 : ata-TOSHIBA_MQ01ABD100_66KNT23WT-part1
ID du périphérique 2 : scsi-0ATA_TOSHIBA_MQ01ABD1_66KNT23WT-part1
ID du périphérique 3 : scsi-1ATA_TOSHIBA_MQ01ABD100_66KNT23WT-part1
ID du périphérique 4 : scsi-35000039711b092c7-part1
ID du périphérique 5 : scsi-SATA_TOSHIBA_MQ01ABD1_66KNT23WT-part1
ID du périphérique 6 : wwn-0x5000039711b092c7-part1
ID de partition : Linux natif
Système de fichiers :
Système de fichiers : XFS
Point de montage : /home

I’ve avoided “xfs”, so I am mainly commenting on the encryption aspect.

Boot to rescue media. Make sure that the rescue media has the tools for “xfs” file systems. Booting the DVD installer or the NET installer to the rescue system should work.

Decrypt the partitiion. For that, use a command something like:

cryptsetup luksOpen /dev/sdXY cr_mypartition

Change “/dev/sdXY” to the actual partition device name (perhaps something like “/dev/sda3”.

Then use

ls /dev/mapper

That should give you the device name. If you used the command above as I suggested it, then you should find “/dev/mapper/cf_mypartition”.

That’s the unmounted device on which you need to use the “xfs” repair tools.

I answered too quickly. I see you actually provided more details.

Use the command

cryptsetup luksOpen /dev/sdb1 cr_mypartition

and then use “xfs” repair tools on “/dev/mapper/cr_mypartition”.

Thanks for your answers.
I use an alternative way which is :

  1. comment in fstab the partition I need to check
  2. Boot
  3. check with xfs_repair the partition /dev/mapper/cr_dataxxxx instead of /dev/sdbx

The third point was the missing point for me.

Concerning XFS I had a really strange behaviour, the Documents directory disappears. I don’t find any command in my history that I delete the repo. or documents in the basket or if I move it by mistake somewhere. The repair doesn’t find any problems and I tried to recover deleted file I don’t find any fragment of my data … It’s so strange I reinstall the laptop from scratch and I use btrfs for data instead of xfs.


I’m glad you have things working.

I have been staying with “ext4”, though I have not run into problems with “xfs” when I have used it.