core.mount
Manage mount points and /etc/fstab entries.
core.mount manages two things independently: the /etc/fstab entry (persist across a reboot) and the actual mount (runtime). present holds both sides at once (an fstab entry + mounted), absent removes both; mounted and unmounted touch only runtime, without touching fstab. The current status is read via findmnt, and all states are idempotent. Requires root.
Requirements
- Rootrequired
- Side
soul-side - Collection
soulstack.system - Category
system
run_as_rootexec_subprocessfs_write_rootStates
core.mount.present — The entry is in /etc/fstab AND the filesystem is mounted (persist + runtime).
fstab changed (an entry was added or updated), or the filesystem was not mounted and is mounted now.
The entry is already in fstab and the filesystem is already mounted — both conditions held.
Parameters
| Param | Type | Required / default | Description |
|---|---|---|---|
path | string | required | Mount point (target). |
source | string | required | Source (device/UUID/network share). |
fstype | string | required | Filesystem type (ext4/nfs/…). |
opts | string | optional | Mount options (default "defaults"). |
Example — Persistent mount of a data volume
- name: Mount data volume persistently module: core.mount.present params: path: /data source: /dev/sdb1 fstype: ext4 opts: "defaults,noatime"Output
| Field | Type | Description |
|---|---|---|
path | string | |
source | string | |
fstype | string | |
mounted | true | |
in_fstab | true |
core.mount.absent — The filesystem is unmounted AND the entry is removed from /etc/fstab.
The entry was in fstab and got removed, or the filesystem was mounted and got unmounted.
There was no entry in fstab and the filesystem is not mounted.
Parameters
| Param | Type | Required / default | Description |
|---|---|---|---|
path | string | required | Mount point (target). |
Example — Unmount and drop the fstab entry
- name: Unmount and drop fstab entry module: core.mount.absent params: path: /dataOutput
| Field | Type | Description |
|---|---|---|
path | string | |
mounted | false | |
in_fstab | false |
core.mount.mounted — The filesystem is mounted "as is", without editing fstab (a runtime mount).
The filesystem was not mounted and is mounted now.
The filesystem is already mounted.
Parameters
| Param | Type | Required / default | Description |
|---|---|---|---|
path | string | required | Mount point (target). |
source | string | required | Source (device/UUID/network share). |
fstype | string | required | Filesystem type (ext4/nfs/…). |
opts | string | optional | Mount options (default "defaults"). |
Example — A runtime mount for this run only
- name: Mount scratch volume for this run only module: core.mount.mounted params: path: /mnt/scratch source: /dev/sdc1 fstype: ext4Output
| Field | Type | Description |
|---|---|---|
path | string | |
mounted | true |
core.mount.unmounted — The filesystem is unmounted, without removing the entry from fstab (the entry remains).
The filesystem was mounted and got unmounted.
The filesystem is already unmounted.
Parameters
| Param | Type | Required / default | Description |
|---|---|---|---|
path | string | required | Mount point (target). |
Example — Unmount without touching fstab
- name: Unmount without touching fstab module: core.mount.unmounted params: path: /dataOutput
| Field | Type | Description |
|---|---|---|
path | string | |
mounted | false |
Notes
- present and absent touch both axes (fstab + runtime); mounted and unmounted touch only runtime and do not touch the fstab entry.
- An erroneous present writes a persistent fstab entry and tries to mount the source at every boot — the cost of a mistake in source/opts repeats on every boot, unlike a one-time mounted.
- The mount point is created at mount time if the directory does not exist (mkdir -p, mode 0755).
- The dump and pass fields in fstab are fixed at 0 0 (not controlled by params); the entry line is <source> <path> <fstype> <opts> 0 0.
- fstab is edited preserve-by-default: atomically (temp+rename), preserving the existing mode and owner; fstab owner/group are not accepted as params.
- Requires root: mount / umount and editing /etc/fstab.
Security & defaults
- Mounting an untrusted source (especially a network NFS/SMB) is the main risk: the module trusts the contents of the mounted filesystem. A source under an attacker's control can slip in setuid files or a symlink outside the mount point.
- source, path, fstype, opts must come from the Destiny/scenario author, not from untrusted input.
- Protection against setuid/devices is set by the author via opts (nosuid,nodev,noexec) — the module does not impose them (default defaults).
- DoS through options and source: a hard NFS mount to an unreachable host hangs and blocks processes that access the mount point; tmpfs without size= will exhaust memory.
- Argument injection is closed: the positional source/path are separated by -- from the mount/umount options, and no shell is involved.