# 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 /dev/ [/dev/]` - Example: `sudo stratis pool create mypool /dev/sdb` - List pools: `sudo stratis pool list` - Destroy pool: `sudo stratis pool destroy ` (unmount filesystems first) - Add data device: `sudo stratis pool add-data /dev/` - Initialize cache: `sudo stratis pool init-cache /dev/` - Add cache device: `sudo stratis pool add-cache /dev/` ## Filesystem Management - Create filesystem: `sudo stratis filesystem create ` - Example: `sudo stratis filesystem create mypool myfs` - List filesystems: `sudo stratis filesystem list []` - Destroy filesystem: `sudo stratis filesystem destroy ` - Mount: Filesystems are at `/stratis//`. Use `sudo mount /stratis// /mnt/point` - Unmount: `sudo umount /mnt/point` ## Snapshot Management - Create snapshot: `sudo stratis filesystem snapshot ` - 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 ` ## Encryption Stratis supports encrypted pools (available in RHEL 9+ and confirmed for 10). - Create encrypted pool: `sudo stratis key set --keyfile-path ` - Then: `sudo stratis pool create --key-desc /dev/` - Unlock pool: `sudo stratis pool unlock ` - 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 []` - 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)."