I have recently added two 480 GB SSDs to a 10 x HDD raidz2 system. The SSDs will be mainly used for spooling to tape during backups, but I’m going to use a small part of it for a SLOG. Not all systems benefits from a SLOG (Separate intent LOG), but synchronous writes, such as databases, do. All ZFS systems have a ZIL (ZFS Intent Log); it is usually part of the zpool. Putting the ZIL on a separate device, such as a SSD can boost performance.
Partitioning the drives
My drives are ada1 and ada2.
# gpart create -s gpt ada1 ada1 created # gpart create -s gpt ada2 ada2 created # gpart add -t freebsd-zfs -s 8G ada1 ada1p1 added # gpart add -t freebsd-zfs -s 8G ada2 ada2p1 added
See what that created:
# gpart show ada1 ada2 => 34 937703021 ada1 GPT (447G) 34 6 - free - (3.0K) 40 16777216 1 freebsd-zfs (8.0G) 16777256 920925799 - free - (439G) => 34 937703021 ada2 GPT (447G) 34 6 - free - (3.0K) 40 16777216 1 freebsd-zfs (8.0G) 16777256 920925799 - free - (439G)
Creating the log device in the zpool
Let’s create a log device, as a mirror. The zpool we are add it to is system.
# zpool add system log mirror ada1p1 ada2p1
And here is what we have:
# zpool status pool: system state: ONLINE scan: scrub repaired 0 in 38h52m with 0 errors on Fri Mar 4 18:36:22 2016 config: NAME STATE READ WRITE CKSUM system ONLINE 0 0 0 raidz2-0 ONLINE 0 0 0 da0p3 ONLINE 0 0 0 da1p3 ONLINE 0 0 0 da2p3 ONLINE 0 0 0 da3p3 ONLINE 0 0 0 da4p3 ONLINE 0 0 0 da5p3 ONLINE 0 0 0 ada0p3 ONLINE 0 0 0 da6p3 ONLINE 0 0 0 ada3p3 ONLINE 0 0 0 da7p3 ONLINE 0 0 0 logs mirror-1 ONLINE 0 0 0 ada1p1 ONLINE 0 0 0 ada2p1 ONLINE 0 0 0 errors: No known data errors
All done. Thank you for flying Air FreeBSD.