GTK3 mount-policy indicator and block-device mounter for the BitCurator
environment. Replaces the legacy bc_mounter.py and bc_policyapp.py
scripts and the rbfstab fstab-rewriting mechanism.
Tested against Ubuntu 22.04, 24.04, and 26.04.
bc-mounterlists physical block devices (those backed by a real udisks2Drive) and lets the user mount or unmount them. Live-updates when devices are plugged or removed. When a device is read-only at the block layer (because the read-only policy is active), it is mounted read-only automatically.bc-policyappis an Ayatana AppIndicator that toggles the read-only USB mount policy. It callsbc-mountpolicyvia pkexec.bc-mountpolicyis a small privileged helper (replacingrbfstab) that activates or deactivates the policy by installing or removing one udev rule.
Both GUI apps share bitcurator_mounter.udisks, a thin dasbus wrapper
around the org.freedesktop.UDisks2 service.
The policy no longer rewrites /etc/fstab. Instead:
- Block-layer protection. When active, a udev rule
(
99-bitcurator-readonly.rules) matches USB block partitions and runsblockdev --setroon each, marking the device read-only at the block layer. Writes — including filesystem journal/log recovery — are rejected by the device itself, regardless of how it is later mounted. This is the modern equivalent ofrbfstab's loop-mount trick, and is stronger because it applies to every access path, not just fstab-driven mounts. - No automount race. The same rule sets
UDISKS_AUTO=0so USB devices do not automount ahead of the--setrocall. The user mounts explicitly viabc-mounter, which is the established BitCurator workflow. - Journal-safe mounting.
/etc/udisks2/mount_options.confsupplies per-filesystem*_ro_defaults(noload,norecovery,nointegrity,nolog) that udisks2 applies to read-only mounts, so journaled filesystems mount cleanly against a read-only block device instead of failing on a write attempt. - Writeable exemption. A partition labelled
BITCURATOR-SAVEis left writeable and automountable, to support user-created USB-persistent installs with a writeable save partition. This is the only label that grants writeability under the read-only policy — a device carrying it is writeable even when the policy is read-only. This is a deliberate sharp edge; see the warning below.
The policy state is indicated by the presence of
/etc/udev/rules.d/99-bitcurator-readonly.rules. bc-policyapp checks for
this file to choose its icon and watches the directory for external changes.
Write-blocker warning. The read-only policy is a convenience to avoid inadvertent writes to USB devices. It is not a substitute for a hardware write blocker for forensic acquisition. In particular, any partition labelled
BITCURATOR-SAVEis writeable regardless of policy.
Runtime dependencies, required on all three target releases. All are in the main or universe archives.
python3-dasbus
python3-gi
gir1.2-gtk-3.0
gir1.2-ayatanaappindicator3-0.1
gir1.2-glib-2.0
polkitd # + pkexec; on 22.04 both come from policykit-1
udisks2
util-linux # provides blockdev
For building the .deb from source — including the additional build
dependencies and the Ubuntu 22.04 setuptools requirement — see
BUILD.md.
| Source | Installed to | Role |
|---|---|---|
bitcurator_mounter/ |
python site-packages | the two GUI apps + udisks client |
data/sbin/bc-mountpolicy |
/usr/sbin/bc-mountpolicy (0755) |
privileged policy toggle helper |
data/udev/readonly.rules |
/usr/share/bitcurator-mounter/readonly.rules |
udev rule template (inactive) |
data/udisks2/mount_options.conf |
/etc/udisks2/mount_options.conf |
journal-safe RO mount options (static) |
data/polkit/io.bitcurator.mountpolicy.policy |
/usr/share/polkit-1/actions/ |
pkexec auth for bc-mountpolicy |
data/desktop/bc-mounter.desktop |
/usr/share/applications/ |
mounter launcher |
data/desktop/bc-policyapp.desktop |
/etc/xdg/autostart/ |
indicator autostart |
data/pixmaps/mounter/harddisk-readonly.png |
/usr/share/pixmaps/mounter/ |
indicator icon (read-only / safe) |
data/pixmaps/mounter/harddisk-writeable.png |
/usr/share/pixmaps/mounter/ |
indicator icon (writeable / danger) |
When the policy is active, bc-mountpolicy install additionally creates
/etc/udev/rules.d/99-bitcurator-readonly.rules (copied from the template).
That file is the only one whose presence changes with the policy state.
The existing states in bitcurator-salt need the following. There is no
upgrade path from previous BitCurator releases, so no migration of old
rbfstab/fstab.rules state is needed — but a clean install must not leave
any legacy artifacts behind.
- Remove rbfstab entirely. Ensure
rbfstabis absent from/usr/sbin, and that noKERNEL=="sd?*", RUN+="/usr/sbin/rbfstab"udev rule and nofstab.rulesfile are installed. Remove any state that dropped the legacy.pyscripts into/usr/local/bin. - Install the
bitcurator-mounterpackage (as a.deb) and add the system dependencies above to the apt package list for all three release maps inbitcurator/files/. - Verify the static files land at the destinations in the table above:
the udisks2 config, the polkit action, the udev rule template, the
helper in
/usr/sbin, the two desktop files, and the indicator pixmaps. These arefile.managedstates (or handled by the.deb). - Do not pre-create
99-bitcurator-readonly.rules. The default policy state is writeable (no rule present); the user opts into read-only via the indicator. If a deployment should default to read-only, add a state that runsbc-mountpolicy installonce at provision time.
The icon pixmaps at
/usr/share/pixmaps/mounter/harddisk-{readonly,writeable}.png are installed
by the package; the indicator falls back to themed icons if they are missing.
debian/— the Debian packaging tree. Build a.debwithdpkg-buildpackage -us -uc -b; seeBUILD.mdfor the full per-release instructions, including the Ubuntu 22.04 setuptools handling..github/workflows/release.yml— builds the.deband publishes a GitHub release when a version tag is pushed. A tag with a hyphen (e.g.0.4.3-rc.1) is published as a pre-release; a plain tag (e.g.0.4.3) as a full release..github/workflows/validate.yml— on every push to the main branch and every pull request, builds, installs, and tests the package in containers for all three target releases. This validates build dependencies, runtime-dependency resolution, file placement, and Python import compatibility — it does not perform functional (mount) testing, which requires real hardware.
libadwaita versions diverge across 22.04 (1.0), 24.04 (1.4), and 26.04 (1.6+). Targeting the lowest common denominator gives up most of the benefit of moving to GTK4, while targeting newer APIs breaks 22.04. GTK3 looks and behaves identically across all three and is fully supported on each. Revisit once 22.04 leaves standard support (April 2027).
- udisks2 already distinguishes real block devices from loop/zram/dm internals — no string-grepping device names.
- No
sudofrom a GUI session; udisks2 handles polkit, and the one privileged action (bc-mountpolicy) goes through pkexec. - Free live device updates via D-Bus signals.
- No
/etc/fstabmutation, no PID lock, no/mediacleanup — eliminating the class of bugsrbfstabaccumulated fixes for since 2011. - Stable interfaces across all three target releases.
UDisksClient can be exercised on any VM with at least one block device:
from bitcurator_mounter.udisks import UDisksClient
c = UDisksClient()
for d in c.list_devices(include_internal=True):
print(d.device, d.fstype, d.display_status, d.block_read_only)mount_options.confhonors the*_ro_defaults/*_ro_allowkeys (oldest udisks2 is on 22.04 — verify the key syntax there first).- After
bc-mountpolicy install, plugging a USB stick marks it read-only:blockdev --getro /dev/sdX1returns 1, and a write to the raw device fails. Confirm--setrois applied to the partition, not just the parent disk. - The device does not automount while the policy is active (
UDISKS_AUTO=0honored by the desktop automounter). - Mounting a journaled FS (ext4/xfs) via
bc-mounterwhile write-protected succeeds andfindmnt -no OPTIONS <mp>showsroplus the journal-safe option; no write reaches the device. - A partition labelled
BITCURATOR-SAVEstays writeable and automountable while a sibling USB stick goes read-only. pkexec bc-mountpolicy install|removeproduces a graphical auth prompt.- Toggling the policy updates the indicator icon within ~1s (both via the
menu and when
bc-mountpolicyis run directly from a terminal). - Whether NTFS is handled by the kernel
ntfs3driver orntfs-3g, so the correctmount_options.confstanza (ntfs3vsntfs) applies.
- The optional polkit rule governing
org.freedesktop.udisks2.filesystem-mount-other(defense-in-depth on top of--setro). The block-layer protection is the real control; add this later only if tighter governance of writeable mounting is wanted. - udisks2
LoopSetup/Encrypted.Unlockoperations (mounting disk images, unlocking encrypted devices) — useful forensic features, but a scope expansion rather than a translation of the existing apps.
Visit the BitCurator wiki on GitHub to find the latest version of our Quickstart Guide.
Have a question or need help? Visit the bitcurator-users Google Group.
Some community maintained documentation and resources are available at the BitCurator documentation hosted on GitHub Pages. Note that the information on this site may lag behind the latest release(s).
A BitCurator Discussions board is also available for ideas or comments.
The BitCurator logo, BitCurator project documentation, and other non-software products of the BitCurator team are subject to the the Creative Commons Attribution 4.0 Generic license (CC By 4.0).
Unless otherwise indicated, software items in this repository are distributed under the terms of the GNU General Public License v3.0. See the LICENSE file for additional details.
In addition to software produced by the BitCurator team, BitCurator packages and modifies open source software produced by other developers. Licenses and attributions are retained here where applicable.
The BitCurator environment is volunteer-maintained. BitCurator was originally developed in the School of Library and Information Science at the University of North Carolina at Chapel Hill with funding provided by the Andrew W. Mellon Foundation (2011-2014).
Community support is managed by the BitCurator Consortium. Find out more at:
