ZFS Storage
Benefits#
| Feature | Benefit |
|---|---|
| Copy-on-write | Fast container creation |
| Snapshots | Easy backup/restore |
| Compression | Smaller storage footprint |
| Checksums | Data integrity |
Create a ZFS dataset#
# Create dataset (adjust 'zroot' to your pool name)
zfs create zroot/containers
zfs set mountpoint=/var/db/containers/storage zroot/containersConfigure Podman#
Edit /usr/local/etc/containers/storage.conf:
[storage]
driver = "zfs"
runroot = "/var/run/containers/storage"
graphroot = "/var/db/containers/storage"
[storage.options.zfs]
mountopt = "nodev"
Verify configuration#
podman info | grep -A 5 "store"Expected output:
graphDriverName: zfs
graphRoot: /var/db/containers/storage
graphStatus:
Dataset: zroot/containers
Separate config storage#
Keep container configs on a separate dataset for easy backup:
zfs create zroot/data/config
zfs set mountpoint=/data/config zroot/data/config
# Snapshot before upgrades
zfs snapshot zroot/data/config@before-upgradeTroubleshooting#
"driver zfs is not supported"
Make sure:
- Your ZFS pool is imported and healthy
- The
graphrootdirectory exists and is a ZFS dataset - You are running Podman as root
Permission issues
chown -R root:wheel /var/db/containersReset storage
# Stop all containers first
podman stop -a
podman system resetAlready have containers running?
Snapshot before you experiment — zfs snapshot makes rollback a one-line command.