Skip to main content

ENV_DISK_MOUNTS

Constant ENV_DISK_MOUNTS 

Source
pub const ENV_DISK_MOUNTS: &str = "MSB_DISK_MOUNTS";
Expand description

Environment variable carrying disk-image volume mount specs for guest init.

Each spec describes one virtio-blk device attached for the sole purpose of being mounted at a guest path by agentd (distinct from the rootfs block device, which is described by ENV_BLOCK_ROOT).

Format: id:guest_path[:opts][;id:guest_path[:opts];...]

  • id — the virtio_blk_config.serial value set by the VMM. Agentd resolves it to a device node via /dev/disk/by-id/virtio-<id>, or by scanning /sys/block/*/serial as a fallback.
  • guest_path — absolute mount path in the guest (required).
  • fstype=... — inner filesystem type (optional). When absent, agentd probes /proc/filesystems to find a type that mounts cleanly.
  • ro / rw — access mode option (optional).
  • noexec — disable direct execution from the mount (optional).
  • nosuid — mount with nosuid flag (optional).
  • nodev — mount with nodev flag (optional).

Entries are separated by ;. Options are comma-separated flags or key-value pairs in the final option block.

Examples:

  • MSB_DISK_MOUNTS=data_12ab:/data:fstype=ext4 — ext4 disk at /data
  • MSB_DISK_MOUNTS=seed_7f:/seed:ro — autodetect fstype, read-only
  • MSB_DISK_MOUNTS=a_1:/a:fstype=ext4;b_2:/b:ro,noexec — two disks