Skip to content

User PVC Issues

Fixing XFS Corruption in Rook Ceph RBD Volumes

If the user’s PersistentVolume and PVC becomes XFS-corrupted and shows errors like:

mount: /mnt: mount(2) system call failed: Structure needs cleaning.

  1. Retrieve the PersistentVolume (PV) YAML:
Terminal window
kubectl get pv <pv-name> -o yaml
  1. Locate the volume handle (e.g., csi-vol-<uuid>) and identify the correct Ceph pool.

  2. Ensure you have a rook-direct-mount pod available to interact with RBD.

  3. In the rook-direct-mount pod, map the volume to create a local device:

Terminal window
rbd map csi-vol-<your-volume-id> --pool <your-pool-name>

Example Output:

/dev/rbd5
  1. Try mounting the volume to see the error:
Terminal window
mount /dev/rbd5 /mnt

If you see the “Structure needs cleaning” message, the filesystem needs repair.

  1. Run xfs_repair to inspect the filesystem:
Terminal window
xfs_repair /dev/rbd5
  1. If it asks to mount the volume first, force the repair and discard the log (this may cause minor data loss but recovers the structure):
Terminal window
xfs_repair -L /dev/rbd5
  1. After repair, try mounting again:
Terminal window
mount /dev/rbd5 /mnt
  1. Verify the filesystem:
Terminal window
ls -lah /mnt
  1. Once everything looks good, unmount and unmap the device:
Terminal window
umount /mnt
rbd unmap /dev/rbd5