Skip to content

fstab Integration

FlexFS volumes can be mounted automatically at boot by adding entries to /etc/fstab. The mount.flexfs init fstab command generates the correct entry and optionally mounts the volume immediately.

Terminal window
sudo mount.flexfs init fstab <volume-name> /mnt/data

This appends a line to /etc/fstab:

<volume-name> /mnt/data flexfs _netdev,nofail,nosuid,x-systemd.mount-timeout=660 0 0

The command also creates the mount point directory if it does not exist.

See the mount.flexfs CLI reference for the full list of init fstab flags, including types and defaults.

Mount with additional options:

Terminal window
sudo mount.flexfs init fstab <volume-name> /mnt/data \
--mountOptions "ro,acl,verbose"

Produces:

<volume-name> /mnt/data flexfs _netdev,nofail,nosuid,x-systemd.mount-timeout=660,ro,acl,verbose 0 0

Mount immediately and replace any existing entry:

Terminal window
sudo mount.flexfs init fstab <volume-name> /mnt/data --now --force

Use a non-default credentials file:

Terminal window
sudo mount.flexfs init fstab <volume-name> /mnt/data \
--credsFile /etc/flexfs/<volume-name>-creds

Produces:

<volume-name> /mnt/data flexfs credsFile=/etc/flexfs/<volume-name>-creds,_netdev,nofail,nosuid,x-systemd.mount-timeout=660 0 0

A flexFS fstab entry uses the following fields:

<name> <mount-point> <type> <options> <dump> <pass>
FieldValueDescription
nameVolume nameThe flexFS volume name
mount-pointAbsolute pathWhere the filesystem will be mounted
typeflexfsThe filesystem type
optionsComma-separatedMount options (see below)
dump0Not used by flexFS
pass0Not used by flexFS
  • _netdev — Tells the system this is a network filesystem, ensuring network is available before mounting.
  • nofail — Prevents boot failure if the mount cannot be completed (e.g., if the admin server is unreachable).
  • nosuid — Ignores the set-user-ID and set-group-ID bits on files under the mount — the safe default for a user-space (FUSE) filesystem. flexFS disables SUID/SGID automatically for any mount a non-root user starts, and init fstab sets nosuid explicitly so that boot-time mounts (which systemd runs as root) get it too. This is deliberate: on modern Ubuntu, AppArmor’s confinement for the FUSE helper (fusermount3) blocks a FUSE mount that would honor SUID, so a mount attempted without nosuid fails outright. If you genuinely need SUID/SGID bits to be honored, a system administrator must add extra AppArmor/OS configuration to permit it; otherwise leave nosuid in place.
  • x-systemd.mount-timeout=660 — Gives the mount job 11 minutes, just past the 10 minutes the mount client itself allows for the filesystem to come up. systemd’s default is 90 seconds, which would kill a mount that was still legitimately working. Because nofail is also set, the longer timeout never delays boot.

When using systemd, you can add additional directives to control mount behavior:

<volume-name> /mnt/data flexfs _netdev,nofail,x-systemd.after=network-online.target 0 0

Common systemd directives:

DirectiveDescription
x-systemd.after=<unit>Wait for the specified systemd unit before mounting
x-systemd.requires=<unit>Require the specified systemd unit to be active
x-systemd.automountMount on first access rather than at boot
x-systemd.mount-timeout=<seconds>Override the mount timeout. init fstab writes 660 by default; supplying your own value via --mountOptions replaces it rather than adding a second one, provided you spell the option exactly as shown here in lower case. Note systemd applies this to the unmount job as well.

Once the fstab entry exists, mount the volume with:

Terminal window
sudo mount /mnt/data

Or mount all fstab entries:

Terminal window
sudo mount -a

At boot, systemd reads /etc/fstab and creates mount units automatically. The _netdev flag ensures flexFS mounts wait for network availability.

Use the deinit fstab subcommand to remove flexFS entries for a mount point from /etc/fstab. It requires root and does not unmount — unmount separately with umount /mnt/data:

Terminal window
sudo mount.flexfs deinit fstab /mnt/data

When mount.flexfs start detects that it was invoked from an fstab-triggered mount (detected via environment), it silently exits if the volume is already mounted. This prevents errors during mount -a when the volume is already active.