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.

Mounts from /etc/fstab run as root, so an entry without credsFile reads root’s credentials file (/root/.flexfs/mount/creds/<volume-name>); create it with sudo mount.flexfs init creds. To mount as another user, use mount.flexfs start instead of fstab (see Mounting without root).

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

Spaces, tabs, newlines, and backslashes in the mount point or mount options (including the credentials file path) are written as fstab octal escapes (\040, \011, \012, \134). A credentials file path cannot contain a comma, because commas separate mount options.

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 set-user-ID and set-group-ID bits under the mount. FlexFS always applies it to non-root mounts, and init fstab adds it for boot-time root mounts. Removing it lets a root mount honor SUID/SGID bits unless the volume or its token carries the nosuid flag. On Ubuntu 25.04 and later, the AppArmor profile for fusermount3 rejects mounts made through it (non-root mounts, or systems whose /etc/mtab is a regular file) without nosuid.
  • 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,nosuid,x-systemd.mount-timeout=660,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 sudo umount /mnt/data:

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

When mount runs mount.flexfs for an fstab entry (recognized by the mount helper argument form <volume-name> <mount-point> -o <options>), mount.flexfs exits without an error if the volume is already mounted and working at that mount point. This prevents errors during mount -a when the volume is already active.