LVM adds flexibility, ZFS combines filesystem and volume manager.
Basics¶
lsblk mkfs.ext4 /dev/sdb1 mount /dev/sdb1 /mnt/data
LVM¶
pvcreate /dev/sdb /dev/sdc vgcreate data-vg /dev/sdb /dev/sdc lvcreate -L 50G -n app-data data-vg lvextend -r -L +20G /dev/data-vg/app-data lvcreate -s -L 10G -n snap /dev/data-vg/app-data
ZFS¶
zpool create tank mirror /dev/sdb /dev/sdc zfs create tank/data zfs set compression=lz4 tank/data zfs snapshot tank/data@backup zfs rollback tank/data@backup
Monitoring¶
df -h du -sh /var/* iostat -x 1 sudo smartctl -a /dev/sda
When LVM vs ZFS¶
LVM (Logical Volume Manager) is the standard choice on most Linux servers. Key advantages: online resize (enlarging and shrinking logical volumes), snapshotting for backups, and thin provisioning for efficient space utilization. LVM is part of the Linux kernel and works with any filesystem (ext4, XFS).
ZFS combines volume manager and filesystem in one — offering copy-on-write, automatic bit rot repair, transparent compression (lz4 is default), and native snapshots. ZFS snapshots are instant and consume no space until data changes. For data servers and NAS, ZFS is the preferred choice due to data integrity guarantees. The downside is higher RAM consumption (recommended 1 GB RAM per 1 TB storage) and the CDDL license, which prevents ZFS from being part of the Linux kernel.
LVM pro servery, ZFS pro data¶
LVM is a flexible standard, ZFS for snapshots and data integrity.