Mount Commands
This domain covers local filesystem mounting through K3 mount daemons.
Quick Post-Mount Checklist (5 Commands)
Assuming your bucket is mounted at /mnt/kb-dev, run this fast sanity checklist:
dodil k3 mount list
ls -lah /mnt/kb-dev
find /mnt/kb-dev -maxdepth 2 -type f | head
head -n 20 /mnt/kb-dev/docs/sample.txt
dodil k3 unmount /mnt/kb-devMount Commands
Public commands:
dodil k3 mount <bucket> <mount-path> --type <fuse|nfs>dodil k3 mount listdodil k3 unmount <mount-path>
Internal command:
dodil k3 mount-daemon <bucket> <mount-path> <type>(hidden, started bymount)
Flags
| Command | Flag | Default | Purpose |
|---|---|---|---|
mount | --type | fuse | Mount backend (fuse or nfs) |
Arguments
| Argument | Meaning |
|---|---|
<bucket> | K3 bucket name to expose locally |
<mount-path> | Local directory used as mount target |
Backend Selection
fuse:- User-space mount backend via go-fuse.
- Good default for developer workstations.
nfs:- Starts a local loopback NFS server and mounts it to the target path.
- Requires local NFS tooling and non-interactive sudo for smooth automation.
Examples
dodil k3 mount kb-dev /mnt/kb-dev --type fuse
dodil k3 mount list
dodil k3 unmount /mnt/kb-devNFS example:
dodil k3 mount kb-dev /mnt/kb-dev --type nfsWhat You Can Do After Mount
After the mount is active, the bucket path behaves like a local directory for common file workflows.
1. Browse and inspect objects
ls -lah /mnt/kb-dev
find /mnt/kb-dev -maxdepth 2 -type f | head2. Read files with local tools
head -n 40 /mnt/kb-dev/myproj/src/main.rs
grep -R "invoice" /mnt/kb-dev/docs3. Use local applications against remote content
- Open files in editors/IDEs directly from the mount path.
- Run local scripts and analytics tools against mounted files.
- Use shell pipelines (
cat,awk,sed,jq) without downloading objects first.
4. Export subsets locally
cp /mnt/kb-dev/docs/sample.pdf ./sample.pdf
tar -czf docs-snapshot.tgz /mnt/kb-dev/docs5. Write behavior guidance
- Treat mounted paths as read-heavy for production workflows.
- For critical writes and deletes, prefer explicit CLI/API operations:
dodil k3 object create ...dodil k3 object remove ...
- If you test writes through mount, verify results using
dodil k3 object list --bucket <bucket>.
Mount Lifecycle
mountvalidates/creates the mount directory and spawns a background daemon process.- The daemon is recorded in the local mount registry at
~/.k3/mounts.jsonwith:- bucket
- absolute mount path
- mount type
- daemon PID
- creation timestamp
mount listreads the registry and prints tracked mounts.unmountlooks up registry metadata, sends interrupt to the daemon PID, runs backend-specific unmount, and then unregisters the mount path.
Backend Behavior Details
FUSE path
- Uses
StorageServicelist/info APIs to surface files and metadata. - Reads file bytes with ranged HTTP GET requests against object URLs.
- Unmount cleanup uses
fusermount -uz <mount-path>.
NFS path
- Starts a local NFS server bound to
127.0.0.1on an ephemeral port. - Attempts secure automount with
sudo -n mount -t nfs .... - If automount fails, CLI prints a manual
sudo mount -t nfs ...command. - Unmount cleanup attempts
sudo -n umount -fandsudo -n umount -l.
Data Sync and Write Expectations
- Mount runtime includes a local spooler under
~/.k3/spool/<bucket>. - Current spooler implementation is best treated as development-grade behavior.
- For critical write workflows, prefer explicit
object create/removecommands or API writes.
Troubleshooting
mount listshows entry but directory is not accessible:- Check whether daemon PID is still running.
- Retry
unmountthen mount again.
unmountsays path not found:- Use the exact path that was mounted (registry is keyed by absolute path).
- NFS mount fails immediately:
- Ensure NFS client tools are installed.
- Ensure non-interactive sudo permissions for mount/umount commands.
- FUSE unmount fails:
- Verify
fusermountis available on host.
- Verify
Common Use Cases
- Local analyst workflows over remote bucket files.
- Integration tests that need file-system style access.
- Operational mount lifecycle verification and local daemon tracking.