Interview Prep/Kubernetes/Storage and volumes

A Pod fails with `MountVolume.MountDevice failed for volume "pvc-..." : rpc error: code = Internal desc = ... mount failed: exit status 32 ... wrong fs type, bad option, bad superblock`.

AdvancedTroubleshootingStorage and volumes
Answer

Likely causes → Filesystem problem on the volume: it was restored from a snapshot of an unclean filesystem, created with a different fsType than the StorageClass declares, or the device is corrupt. Sometimes an XFS volume formatted with features the node kernel does not support.

Diagnose →

kubectl get pv pvc-... -o jsonpath='{.spec.csi.fsType}{"\n"}'
# On the node the volume is attached to
lsblk -f
sudo dmesg | tail -30

Fix → Run fsck/xfs_repair on the device from a debug node (with the volume unmounted), or restore from a known-good snapshot. Make the StorageClass csi.storage.k8s.io/fstype match the data.

Prevent → Take application-consistent snapshots (freeze or pre-backup hooks) and test restores regularly.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Storage and volumes