Kubernetes "MountVolume.SetUp failed for volume: mount failed: exit status 32"
Fixes the Kubernetes mount failure where MountVolume.SetUp fails with exit status 32. Shows how to read the device path from the event, check the filesystem on the node, and fix fstype mismatches or corrupt volumes. Reach for it when a pod cannot mount an attached block volume.
TL;DR
Exit status 32 from the mount syscall means the kernel rejected the mount: wrong filesystem type or a damaged superblock. Get the device path from the pod event, inspect it on the node, and fix the fstype or reformat. The volume attached fine; the mount step is what failed.
Verbatim error
Warning FailedMount [AGE] kubelet MountVolume.SetUp failed for volume "[PV-NAME]" : mount failed: exit status 32Steps
- Get the full event, which usually names the device and the attempted filesystem type.
kubectl describe pod [POD] -n [NAMESPACE]Expected: the FailedMount message includes the volume name and sometimes the device path and fstype the kubelet tried. Note both.
- On the node, check what is actually on the device.
lsblk -f
dmesg | tail -n 30Expected: lsblk shows the device and its real filesystem type (or none, if unformatted). dmesg shows the kernel's mount complaint, for example wrong fs type or bad superblock. Run these on the node via your node access method.
- Compare against the PV spec's fstype.
kubectl get pv [PV-NAME] -o yamlExpected: the fstype field (often ext4 or xfs). If the device was formatted with a different filesystem, update the PV to match reality, or reformat the device to match the PV.
- If the filesystem is corrupt, check and repair it. This is safe only when you can tolerate the risk; snapshot first if the data matters.
fsck -n [DEVICE]Expected: fsck reports whether the filesystem is clean or damaged. The -n flag makes it read-only. Repair only after you have a backup or have accepted data loss.
- If the volume is new and unformatted, format it to the expected type.
mkfs.ext4 [DEVICE]Expected: the device now carries a fresh filesystem. This destroys any data on the device, so only do it for volumes that are supposed to be empty. Then delete the pod to retry the mount.
kubectl delete pod [POD] -n [NAMESPACE]Expected: the replacement pod mounts the volume and starts.
When to use
- FailedMount with mount failed: exit status 32 in the message
- A block volume attached successfully but will not mount
- The failure followed a manual format, a PV edit, or a node rebuild
When not to use
- The error is exit status 1 or a permission denied; that is usually a driver or credential issue, not the filesystem
- The volume never attaches; that is an attach-layer problem (FailedAttachVolume)
- The pod uses NFS or another network filesystem; exit 32 there means something different (mount helper or server issue)
Why it happens
Attaching a block device and mounting a filesystem are separate steps. Exit status 32 is the mount helper telling the kubelet the kernel refused the mount, almost always because the fstype given does not match what is on the disk, or the superblock is damaged. The CSI attacher did its job; the filesystem layer did not.
Edge cases
- xfs volumes formatted without the right features can fail on older kernels; check dmesg for the specific xfs complaint.
- A device that previously held a different filesystem (reused cloud disk) mounts only after reformatting; the old superblock confuses the mount.
- ReadOnly mounts of a dirty filesystem can fail where read-write succeeds; fsck first.
- Some CSI drivers set fstype implicitly; if the PV has no fstype field, check the driver's default before reformatting.
Provenance
Resolved from the public thread: https://vectle.com/posts/pstQHcptMjQcxkyEoDEL9uyw