Last active
December 1, 2021 11:35
-
-
Save ianblenke/e97786eaa0a24abe544d6c74b8c0a294 to your computer and use it in GitHub Desktop.
FreeBSD ZFS: Putting a ZIL mirror and an L2ARC on only 2 SSD drives
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Based on this blog post: https://clinta.github.io/FreeNAS-Multipurpose-SSD/ | |
set -xe | |
ssd1=ada2 | |
ssd2=ada3 | |
pool=tank | |
gpart create -s gpt $ssd1 | |
gpart create -s gpt $ssd2 | |
gpart add -a 4k -b 128 -t freebsd-zfs -s 30G $ssd1 | |
gpart add -a 4k -b 128 -t freebsd-zfs -s 30G $ssd2 | |
gpart add -a 4k -t freebsd-zfs $ssd1 | |
gpart add -a 4k -t freebsd-zfs $ssd2 | |
zil1=$(gpart list $ssd1 | grep rawuuid | head -1 | cut -c13-) | |
arc1=$(gpart list $ssd1 | grep rawuuid | tail -1 | cut -c13-) | |
zil2=$(gpart list $ssd2 | grep rawuuid | head -1 | cut -c13-) | |
arc2=$(gpart list $ssd2 | grep rawuuid | tail -1 | cut -c13-) | |
zpool add $pool log mirror gptid/$zil1 gptid/$zil2 | |
zpool add $pool cache gptid/$arc1 | |
zpool add $pool cache gptid/$arc2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment