π Longhorn CSI Mount Issue Fix
β Issue
Pods using Longhorn volumes may fail to start due to errors in longhorn-csi-plugin
, specifically related to mount failures caused by multipathd
.
π Error Message
Mounting command: mount
Mounting arguments: -t ext4 -o defaults /dev/longhorn/pvc-xxxx /var/lib/kubelet/pods/xxx/mount
Output: mount: /var/lib/kubelet/pods/xxx/mount: /dev/longhorn/pvc-xxxx already mounted or mount point busy.
π― Root Cause
The multipath daemon (multipathd
) automatically creates multipath devices for block devices, including Longhorn volumes. This results in conflicts when mounting Longhorn volumes, preventing pods from starting.
β Solution
1οΈβ£ Check Longhorn Devices
Run the following command to list devices created by Longhorn:
lsblk
πΉ Longhorn devices typically have names like /dev/sd[x]
.
2οΈβ£ Modify multipath.conf
- Create the configuration file (if it doesnβt exist):
sudo touch /etc/multipath.conf
- Add the following blacklist rule:
blacklist {
devnode "^sd[a-z0-9]+"
}
3οΈβ£ Restart Multipath Service
Apply the changes by restarting the multipath daemon:
sudo systemctl restart multipathd.service
4οΈβ£ Verify Configuration
Check if the new configuration is applied:
multipath -t
π Your pods should now be able to mount Longhorn volumes correctly!
π Additional Tips
- Ensure that
longhorn-csi-plugin
logs are clear of mount errors. - If the issue persists, consider rebooting the node after applying the fix.
- Check the status of multipath with:
systemctl status multipathd.service
π οΈ Need More Help?
πΉ Visit the Longhorn Documentation
πΉ Join the Longhorn Community
π Happy Deploying!
Top comments (0)