may_umount(9)
π may_umount(9) β kernel API manual, bestie edition π
okay so real talk, this is from the Kernel API Manual and it's the page for may_umount, and honestly? she's a little icon. let's get into it β¨
πΈ NAME πΈ
may_umount β check if a mount point is busy
like, is anybody using this thing or can we pack it up π
β¨ SYNOPSIS β¨
int may_umount (struct vfsmount *mnt );
yes bestie that's the whole signature, no notes π
π¦ ARGUMENTS π¦
mntβ the root of the mount. the mount-y-est mount. the one we're vibing about π«Ά
π DESCRIPTION π
so this one gets called to check if a mount point has, like, anything going on with it β any open files, pwds, chroots, or sub mounts. if literally any of those are hanging around, she's busy, no cap.
and here's the part you gotta know: if the mount has sub mounts, this will return busy regardless of whether the sub mounts themselves are busy. like, it doesn't even check. sub mount exists = busy = periodt. π
also it doesn't take quota and stuff into account β IOW, in some cases it will give false negatives π so don't treat it like gospel, okay?
the main reason why it's here at all is that we need a non-destructive way to look for easily umountable filesystems. she's not out here wrecking anything, she's just doing a vibe check on your mounts. main character energy, genuinely π₯
ngl, the "false negatives" thing is a real caveat β this is a check, not a guarantee. act accordingly bestie π
π SEE ALSO π
Kernel file ./fs/namespace.c and her whole friend group:
mnt_get_write_access(9)mnt_want_write(9)mnt_get_write_access_file(9)mnt_want_write_file(9)mnt_put_write_access(9)mnt_drop_write(9)mnt_hold_writers(9)mnt_unhold_writers(9)__lookup_mnt(9)lookup_mnt(9)attach_mnt(9)vfs_create_mount(9)path_is_mountpoint(9)may_umount_tree(9)clone_private_mount(9)attach_recursive_mnt(9)do_lock_mount(9)path_overmounted(9)can_move_mount_beneath(9)mnt_set_expiry(9)mnt_allow_writers(9)
and that's the page!! π this lil beauty lives in ./fs, dated October 2026 β go off, October 2026, you ate πβ mwah π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms