Repository navigation
mount: list the current borg mounts when no MOUNTPOINT is given, fixes #2579 - #10514
Open
ThomasWaldmann wants to merge 1 commit into
Open
ThomasWaldmann wants to merge 1 commit into
ThomasWaldmann wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10514 +/- ##
==========================================
+ Coverage 89.29% 89.30% +0.01%
==========================================
Files 104 104
Lines 19941 19990 +49
Branches 3127 3135 +8
==========================================
+ Hits 17806 17853 +47
- Misses 1478 1479 +1
- Partials 657 658 +1 ☔ View full report in Codecov by Harness. |
ThomasWaldmann
force-pushed
the
mount-list-2579
branch
from
October 11, 2026 16:05
40beca1 to
7d30ae0
Compare
…borgbackup#2579 "borg mount" without a MOUNTPOINT now prints the mountpoints of all file systems mounted by borg mount, one per line (--json: a JSON list with mountpoint, source and fstype). This needs neither a repository nor FUSE. borgfs still requires the mountpoint. New platform API platform.list_mounts() returning the mount table as MountEntry (source, fstype, mountpoint) tuples, implemented in the per-OS platform modules: - Linux: /proc/self/mountinfo (fields after the "-" separator, octal escapes) - illumos: /etc/mnttab - macOS, FreeBSD: getmntinfo() as a Cython extern (the header maps it to getmntinfo$INODE64 on x86_64 macOS) - NetBSD: getvfsstat() as a Cython extern (the header maps it to the libc symbol of the current struct layout, __getvfsstat90) - Windows: GetLogicalDriveStringsW + GetVolumeInformationW, i.e. drive letter mounts only - directory mountpoints (junctions) can not be enumerated. - other platforms: empty list, with a warning. vfs.is_borgfs_mount() has the recognition rule in one place: source "borgfs" (Linux, macOS, FreeBSD, illumos) or an fstype ending in "borgfs" (NetBSD shows "puffs|borgfs", Linux "fuse.borgfs"); on Windows the fs name "FUSE" with a volume label containing "borgfs". On Linux, parse_mount_options now also gives libfuse "subtype=borgfs", so the file system type is "fuse.borgfs" (as in the fstab examples) and the mount is recognized even if the user overrides fsname. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ThomasWaldmann
force-pushed
the
mount-list-2579
branch
from
October 11, 2026 19:54
7d30ae0 to
06bc7c1
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2579.
borg mountwithout a MOUNTPOINT now prints the mountpoints of all file systems mounted byborg mount, one per line;--jsongives a JSON list withmountpoint,sourceandfstype. This needs neither a repository nor FUSE (no passphrase prompt, no FUSE binding import).borgfsstill requires the mountpoint.Per-OS mount table findings (measured on the test boxes)
How a FUSE file system mounted with
fsname=borgfsshows up, and which API enumerates it:borgfsfuse(nowfuse.borgfs, see below)/proc/self/mountinfoborgfsmacfusegetmntinfo()via ctypes (getmntinfo$INODE64on x86_64, 2168-bytestruct statfs)borgfsfusefsgetmntinfo()via ctypes/dev/puffspuffs|borgfs(the fsname lands in the fstype)__getvfsstat90()via ctypes (the plaingetvfsstatsymbol is the pre-9 compat version and returns nothing)borgfsfuse/etc/mnttab(5 tab-separated fields)volname)FUSEGetLogicalDriveStringsW+GetVolumeInformationWChanges
platform.list_mounts()returning the mount table asMountEntry(source, fstype, mountpoint)tuples, implemented in the per-OS platform modules:/proc/self/mountinfoparser inlinux.pyx,/etc/mnttabparser insolaris.py,getmntinfo()/getvfsstat()as Cython externs indarwin.pyx,freebsd.pyxandnetbsd.pyx(the C headers provide the struct layouts and thegetmntinfo$INODE64/__getvfsstat90symbol mapping), drive letter enumeration inwindows.pyx; other platforms get an empty list with a warning.vfs.is_borgfs_mount()holds the recognition rule in one place:source == "borgfs" or fstype.endswith("borgfs"); on Windows: fs nameFUSEand a volume label containingborgfs.parse_mount_optionsaddssubtype=borgfsto the libfuse options, so the file system type isfuse.borgfs(matching the fstab examples in the docs) and a borg mount is recognized even with a user-supplied-o fsname=. Verified with llfuse on Debian 13; the llfuse / pyfuse3 / mfusepy CI jobs cover the three bindings. Not added on other platforms (FreeBSD ignores it).mountinfo/mnttablines, a livelist_mounts()test, rule tests, output/JSON tests with a faked mount table, and a FUSE test that mounts a repo and checks it is listed (and no longer listed after unmounting).Limitations
-o fsname=othermakes the fstypepuffs|other, which is then not recognized (macOS and FreeBSD ignore such an override, Linux is covered by the subtype).The enumerators were run on the Debian 13, OmniOS r151058, FreeBSD 15.1 and NetBSD 11 test boxes (the FreeBSD and NetBSD extensions compiled there against the real headers) and on macOS 27 (where the end-to-end listing of a real borg mount, including a mountpoint with a space, was checked).
🤖 Generated with Claude Code