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.
Creating an fstab entry
Section titled “Creating an fstab entry”sudo mount.flexfs init fstab <volume-name> /mnt/dataThis appends a line to /etc/fstab:
<volume-name> /mnt/data flexfs _netdev,nofail,nosuid,x-systemd.mount-timeout=660 0 0The 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).
init fstab flags
Section titled “init fstab flags”See the mount.flexfs CLI reference for the full list of init fstab flags, including types and defaults.
Examples
Section titled “Examples”Mount with additional options:
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 0Mount immediately and replace any existing entry:
sudo mount.flexfs init fstab <volume-name> /mnt/data --now --forceUse a non-default credentials file:
sudo mount.flexfs init fstab <volume-name> /mnt/data \ --credsFile /etc/flexfs/<volume-name>-credsProduces:
<volume-name> /mnt/data flexfs credsFile=/etc/flexfs/<volume-name>-creds,_netdev,nofail,nosuid,x-systemd.mount-timeout=660 0 0Spaces, 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.
fstab entry format
Section titled “fstab entry format”A flexFS fstab entry uses the following fields:
<name> <mount-point> <type> <options> <dump> <pass>| Field | Value | Description |
|---|---|---|
| name | Volume name | The flexFS volume name |
| mount-point | Absolute path | Where the filesystem will be mounted |
| type | flexfs | The filesystem type |
| options | Comma-separated | Mount options (see below) |
| dump | 0 | Not used by flexFS |
| pass | 0 | Not used by flexFS |
Recommended options
Section titled “Recommended options”_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, andinit fstabadds it for boot-time root mounts. Removing it lets a root mount honor SUID/SGID bits unless the volume or its token carries thenosuidflag. On Ubuntu 25.04 and later, the AppArmor profile forfusermount3rejects mounts made through it (non-root mounts, or systems whose/etc/mtabis a regular file) withoutnosuid.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. Becausenofailis also set, the longer timeout never delays boot.
systemd directives
Section titled “systemd directives”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 0Common systemd directives:
| Directive | Description |
|---|---|
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.automount | Mount 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. |
Mounting from fstab
Section titled “Mounting from fstab”Once the fstab entry exists, mount the volume with:
sudo mount /mnt/dataOr mount all fstab entries:
sudo mount -aAt boot, systemd reads /etc/fstab and creates mount units automatically. The _netdev flag ensures flexFS mounts wait for network availability.
Removing an fstab entry
Section titled “Removing an fstab entry”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:
sudo mount.flexfs deinit fstab /mnt/dataDuplicate mount protection
Section titled “Duplicate mount protection”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.