guestunmount(1)
π guestunmount(1) β the manual page bestie
okay so you're reading guestunmount(1) β that's the guestunmount manual page, living in the Virtualization Support section of your friendly neighbourhood man pages. Buckle up, this one's short and iconic β¨
πΈ NAME πΈ
guestunmount β unmount a guestmounted filesystem. that's it. that's the whole job. she's a cleanup queen π
π¦ SYNOPSIS π¦
guestunmount mountpoint
guestunmount --fd=<FD> mountpoint
β¨ DESCRIPTION β¨
so guestunmount is a utility that cleans up mounted filesystems automatically. guestmount(1) mounts filesystems using libguestfs, and then this little icon unmounts the filesystem once a program or script is done with it. very "i'll take it from here, bestie" of her π«Ά
guestunmount is a wrapper around the FUSE fusermount(1) program, and that program must exist on the current PATH. no fusermount, no slay. π
there are two ways to use guestunmount. when you call it like:
guestunmount mountpoint
it unmounts mountpoint immediately. zero chill, instant cleanup. π₯
when you call it like:
guestunmount --fd=FD mountpoint
it waits until the pipe FD is closed. this is the sophisticated main-character mode: you use it to monitor another process and clean up its mountpoint when that process exits, exactly as described below. π
π FROM PROGRAMS π
you can just call guestunmount mountpoint from your program, but the more sophisticated way to use guestunmount is to have it monitor your program so it can clean up the mount point if your program exits unexpectedly. lowkey genius.
in your program, create a pipe (eg. by calling pipe(2)). let FD be the file descriptor number of the read side of the pipe (ie. pipefd[0]).
after mounting the filesystem with guestmount(1) (on mountpoint), fork and run guestunmount like this:
guestunmount --fd=FD mountpoint
close the read side of the pipe in the parent process.
now, when the write side of the pipe (ie. pipefd[1]) is closed for any reason β either explicitly or because the parent process exits β guestunmount notices and unmounts the mountpoint. no cap, she's watching π
if your operating system supports it, you should set the FD_CLOEXEC flag on the write side of the pipe. this is so that other child processes don't inherit the file descriptor and keep it open. fr fr, don't skip this one π
guestunmount never daemonizes itself. she stays present. she's not leaving the chat. π
π FROM SHELL SCRIPTS π
since bash doesn't provide a way to create an unnamed pipe, use a trap to call guestunmount on exit like this:
trap "guestunmount mountpoint" EXIT INT QUIT TERM
one line, whole vibe handled. periodt. β
π OPTIONS π
--fd=FDβ specify the pipe file descriptor to monitor, and delay cleanup until that pipe is closed.--helpβ display brief help and exit. short and sweet π-q,--quietβ don't display error messages fromfusermount. the return status is still set (seeEXIT STATUSbelow), so you're not flying blind, just flying quiet π€«--no-retry,--retry=Nβ by default,guestunmountwill retry thefusermountoperation up to 5 times (that is, it will run it up to 6 times = 1 try + 5 retries).
use --no-retry to make guestunmount run fusermount only once.
use --retry=N to make guestunmount retry N times instead of 5.
guestunmount performs an exponential back-off between retries, waiting 1 second, 2 seconds, 4 seconds, etc before each retry. patient queen. she will wait for you π
-V,--versionβ display the program version and exit.
π§ ENVIRONMENT VARIABLES π§
PATHβ thefusermount(1)program (supplied by FUSE) must be available on the currentPATH. if it's not on yourPATH, she cannot find it, and that's a whole situation π
π EXIT STATUS π
this program returns 0 if successful, or one of the following error codes:
- program error, eg. could not allocate memory, could not run
fusermount. see the error message printed for more information. - the mount point could not be unmounted even after retrying. see the error message printed for the underlying
fusermounterror. - the mount point is not mounted.
πΈ SEE ALSO πΈ
guestmount(1), fusermount(1), pipe(2), MOUNT LOCAL in guestfs(3), http://libguestfs.org/, http://fuse.sf.net/.
go read the friends of the show, they're all iconic in their own right π«Ά
π AUTHORS π
Richard W.M. Jones (rjones at redhat dot com) β the legend himself π
π COPYRIGHT π
Copyright (C) 2013 Red Hat Inc.
π LICENSE π
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
(yeah, the all-caps warranty disclaimer is giving serious energy, and you should take it seriously β it means what it says π)
π BUGS π
to get a list of bugs against libguestfs, use this link: https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools
to report a new bug against libguestfs, use this link: https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools
when reporting a bug, please supply:
- the version of libguestfs.
- where you got libguestfs (eg. which Linux distro, compiled from source, etc)
- describe the bug accurately and give a way to reproduce it.
- run
libguestfs-test-tool(1)and paste the complete, unedited output into the bug report.
bestie please don't trim the output. unedited. complete. the maintainers are begging π
and that's the whole page, mwah π this was libguestfs-1.61.3, dated 2026-09-16 β go unmount something responsibly, ily, bye! π¦β¨
π¦ where this page comes from
- centos-stream 10: libguestfs 1:1.61.3-1.el10 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms