Files
cheatsheets/stratis_cheatsheet.md
2025-08-31 23:24:28 +02:00

3.8 KiB

Stratis Cheatsheet for RHEL 10

This cheatsheet covers common Stratis commands for storage management on Red Hat Enterprise Linux 10, based on official documentation and recent guides (e.g., RHEL 9/10 RHCSA resources from 2025). Stratis simplifies local storage with pools, thin provisioning, snapshots, and encryption. It builds on LVM and XFS.

Prerequisites: Ensure block devices are available and not in use. Stratis requires stratisd service running.

Installation

  • Install packages: sudo dnf install stratisd stratis-cli
  • Enable and start service: sudo systemctl enable --now stratisd
  • Verify: sudo systemctl status stratisd

Pool Management

  • Create a pool: sudo stratis pool create <pool_name> /dev/<blockdev> [/dev/<another>]
    • Example: sudo stratis pool create mypool /dev/sdb
  • List pools: sudo stratis pool list
  • Destroy pool: sudo stratis pool destroy <pool_name> (unmount filesystems first)
  • Add data device: sudo stratis pool add-data <pool_name> /dev/<blockdev>
  • Initialize cache: sudo stratis pool init-cache <pool_name> /dev/<cachedev>
  • Add cache device: sudo stratis pool add-cache <pool_name> /dev/<cachedev>

Filesystem Management

  • Create filesystem: sudo stratis filesystem create <pool_name> <fs_name>
    • Example: sudo stratis filesystem create mypool myfs
  • List filesystems: sudo stratis filesystem list [<pool_name>]
  • Destroy filesystem: sudo stratis filesystem destroy <pool_name> <fs_name>
  • Mount: Filesystems are at /stratis/<pool_name>/<fs_name>. Use sudo mount /stratis/<pool_name>/<fs_name> /mnt/point
  • Unmount: sudo umount /mnt/point

Snapshot Management

  • Create snapshot: sudo stratis filesystem snapshot <pool_name> <source_fs> <snapshot_name>
    • Example: sudo stratis filesystem snapshot mypool myfs mysnapshot
  • List snapshots: Included in stratis filesystem list
  • Revert to snapshot: Destroy current FS and rename snapshot, or use as needed (snapshots are writable)
  • Destroy snapshot: sudo stratis filesystem destroy <pool_name> <snapshot_name>

Encryption

Stratis supports encrypted pools (available in RHEL 9+ and confirmed for 10).

  • Create encrypted pool: sudo stratis key set --keyfile-path <keyfile> <key_desc>
  • Then: sudo stratis pool create --key-desc <key_desc> <pool_name> /dev/<blockdev>
  • Unlock pool: sudo stratis pool unlock <key_desc>
  • List keys: sudo stratis key list
  • For TPM: Use --capture-key or specific options for binding.

Monitoring and Status

  • List block devices: sudo stratis blockdev list [<pool_name>]
  • Daemon rediscover: sudo stratis daemon rediscover
  • Version: sudo stratis daemon version
  • Check service: sudo systemctl status stratisd
  • Debug: sudo journalctl -u stratisd

Advanced Features

  • Thin provisioning: Enabled by default; overprovision with care (pools can grow dynamically).
  • Expand pool: Add devices with add-data or add-cache.
  • Rename pool: Not directly supported; export/import or recreate.
  • Integration with VDO: Can be used underlying, but Stratis manages on top.

Tips and Best Practices

  • Always back up data before destructive operations.
  • Monitor pool usage: Use stratis pool list for free space.
  • For RHEL 10 specifics: Commands are consistent with RHEL 9; check man stratis for updates.
  • Resources: Red Hat Documentation (Chapter on Stratis in Managing File Systems), stratis-storage.github.io.
  • Common error: If pool not found, run stratis daemon rediscover.

Troubleshooting

  • Service issues: journalctl -u stratisd
  • Rediscover devices: sudo stratis daemon rediscover
  • Encryption unlock: sudo stratis pool unlock

For more details, refer to man stratis or Red Hat's official docs (https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/managing_file_systems/setting-up-stratis-file-systems_managing-file-systems)."