ZFS - how to use a file as a ZIL


Unix is user-friendly — it's just choosy about who its friends are.

ZFS sometimes benefits from having a logging drive. Usually, you need to assign a whole device or partition to it. Unfortunately, I had already partitioned my SSD and didn't feel like repartitioning it. So, here's how to create a file, mount it as a loopback, and then assign it to your ZFS pool as a logging drive. Create a 1GB file somewhere on your SSD: fallocate -l 1G zil.img Mount the file as a loopback device: sudo losetup -fP zil.img Find the name of the new loopback device: …

Continue reading →