Automation · Storage Automation
Filesystem Provisioning
Cheat sheet · https://pcornel.dk/topic.php?topic=5745
Answer
Filesystem provisioning automation creates file systems on new volumes with mkfs, labels them, mounts them and sets ownership and permissions consistently.
Remember
- mkfs with labels.
- Ownership and permissions.
- Idempotent checks.
First checks
mkfs.xfs /dev/<vg>/<lv>— create filesystemblkid /dev/<vg>/<lv>— UUIDansible <h> -m community.general.filesystem -a 'fstype=xfs dev=/dev/<vg>/<lv>' --check— idempotent module
Commands
findmnt <mountpoint>- Read-only/validation observation for mount source, target, filesystem type and options for the selected mountpoint.
Verify in this order
volume → filesystem (if absent) → UUID
Where it usually breaks
Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5745