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.
- Retrieve the PersistentVolume (PV) YAML:
kubectl get pv <pv-name> -o yaml
Locate the volume handle (e.g.,
csi-vol-<uuid>
) and identify the correct Ceph pool.Ensure you have a
rook-direct-mount
pod available to interact with RBD.In the
rook-direct-mount
pod, map the volume to create a local device:
rbd map csi-vol-<your-volume-id> --pool <your-pool-name>
Example Output:
/dev/rbd5
- Try mounting the volume to see the error:
mount /dev/rbd5 /mnt
If you see the “Structure needs cleaning” message, the filesystem needs repair.
- Run
xfs_repair
to inspect the filesystem:
xfs_repair /dev/rbd5
- 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):
xfs_repair -L /dev/rbd5
- After repair, try mounting again:
mount /dev/rbd5 /mnt
- Verify the filesystem:
ls -lah /mnt
- Once everything looks good, unmount and unmap the device:
umount /mntrbd unmap /dev/rbd5