Skip to content

B1-3: Add /sbin/mount.objectfs fstab helper #136

Closed

Description

@scttfrdmn

Context

NFS's most important operational feature for sysadmins is /etc/fstab integration — mount at boot, survive reboots, declarative configuration. ObjectFS has no equivalent. Without a mount helper binary at /sbin/mount.objectfs, the kernel's mount -t objectfs command fails and _netdev fstab entries don't work.

What to implement

Create cmd/mount.objectfs/main.go following the kernel mount helper calling convention:

mount.objectfs <device> <mountpoint> [-sfnv] [-t type] [-o options]

Parse the -o options string (comma-separated key=value pairs):

  • config=<path> → passes --config to objectfs mount
  • uid=<n> → passes through to objectfs
  • gid=<n> → passes through
  • ro → passes --read-only
  • cache-size=<size> → passes --cache-size
  • log-level=<level> → passes --log-level

After parsing, exec /usr/bin/objectfs mount [translated flags] <device> <mountpoint> --foreground.

This enables the fstab entry:

s3://my-bucket  /mnt/data  objectfs  _netdev,config=/etc/objectfs/data.yaml  0  0

Add as a second build target in .goreleaser.yaml. Add to DEB/RPM packages at /sbin/mount.objectfs. Update scripts/postinstall.sh to create the symlink if not present.

Acceptance criteria

  • mount.objectfs s3://bucket /mnt/point -o config=/etc/objectfs/config.yaml works (calls objectfs mount ...)
  • mount -t objectfs s3://bucket /mnt/point -o config=/etc/objectfs/config.yaml works
  • fstab entry with _netdev and objectfs type mounts on mount -a
  • Binary included in DEB and RPM packages at /sbin/mount.objectfs

Sequencing

Depends on B1-1 (objectfs mount subcommand must exist first).

Activity

  1. added
    type: enhancement
    priority: high
    area: core
    on Apr 7, 2026
  2. added
    effort: medium
    on Aug 3, 2026
  3. scttfrdmn commented on Aug 9, 2026

    @scttfrdmn
    OwnerAuthor

    Scoping note before implementation: three of the six -o options this issue specifies map to flags that do not exist.

    newMountFlagSet (cmd/objectfs/main.go:172-183) declares exactly: --config, --foreground, --mount-point, --log-level, --cache-size, --max-concurrency, --dry-run, --debug.

    Against the issue's table:

    -o key maps to exists?
    config=<path> --config yes
    log-level=<level> --log-level yes
    cache-size=<size> --cache-size yes
    ro --read-only no such flag
    uid=<n> "passes through to objectfs" no flag, and no config field
    gid=<n> "passes through" no flag, and no config field

    internal/vfs has an ErrReadOnly, so the concept exists below the CLI, but nothing at the mount boundary turns it on. uid/gid have no yaml field in internal/config at all — internal/vfs/attr.go derives ownership from objectfs-uid/objectfs-gid object metadata falling back to the mounting user, which is a different mechanism from a mount-wide override.

    So a helper written to this table would accept four fstab options and silently drop two of them, plus fail on ro — and ro in an fstab line is the one an operator is most likely to expect to be honoured. That is worse than not accepting them: an option that parses and does nothing reads as a working read-only mount.

    Two ways to resolve, and it is a real choice rather than a detail:

    1. Implement the missing flags first (--read-only, --uid, --gid with config fields behind them), then map all six. Larger, and --read-only needs a decision about where it is enforced — refusing at Open is not the same as refusing at flush.
    2. Ship the helper with the four that work, and have it reject ro/uid/gid with a message naming the gap rather than accepting and ignoring them. Smaller, honest, and leaves an fstab line that fails loudly instead of mounting writable when the operator asked for read-only.

    Also worth noting for the exec line: the issue says exec objectfs mount ... --foreground. That flag's own help text says foreground "is the only mode ObjectFS has", so passing it is right, but a mount helper that never returns is not what mount -a expects — the systemd _netdev path and the fork/daemonize question need settling as part of this, not after it.

    Sequenced behind the packaging work (#207/#137), since the helper has to be installed at /sbin/mount.objectfs by a package for any of it to be reachable.

  4. scttfrdmn commented on Aug 9, 2026

    @scttfrdmn
    OwnerAuthor

    Deferred this round, deliberately. The -o table above needs --read-only, --uid and --gid to exist before a helper can honour it, and --read-only is a design question rather than a flag: refusing at Open is not the same as refusing at flush, and a mount-wide uid/gid override would be a second authority alongside the per-object objectfs-uid/objectfs-gid metadata that internal/vfs/attr.go already derives ownership from. Two authorities that can disagree is the defect class this project has spent several releases removing.

    So this waits until that is settled, rather than shipping a helper that accepts six options and honours three.

    #149 (full install-to-fstab CI on Rocky Linux 9) is sequenced behind both this and the packaging work — it cannot install a package that does not exist yet, and its mount -a step needs this helper. Note also that #149's body specifies LocalStack, which this project rules out; see the comment there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreeffort: mediumpriority: hightype: enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions