quickreference:zfs
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
quickreference:zfs [2022/12/17 14:10] – [iSCSI considerations] rodolico | quickreference:zfs [2025/01/06 23:05] (current) – [Create a zpool] rodolico | ||
---|---|---|---|
Line 22: | Line 22: | ||
zpool create -f storage raidz2 / | zpool create -f storage raidz2 / | ||
</ | </ | ||
+ | |||
+ | You can add extra functionality by creating //intent//, //dedup// and //cache// vdev's at the same time. Following example shows adding a vdev (mirror) to a pool. | ||
+ | <code bash> | ||
+ | zpool create -f -m /storage storage raidz2 da4 da5 da6 da7 da8 da9 dedup mirror da2 da3 | ||
+ | </ | ||
+ | |||
+ | This will create a pool named storage, mounted (-m) at /storage, forced to ignore most drive errors. The pool will be a raidz2 (aka RAID 6) with 6 drives (4-9), and have a dedup vdev consisting of a mirror from da2 and 3. | ||
===== Create a Dataset ===== | ===== Create a Dataset ===== | ||
Line 56: | Line 63: | ||
# turn swap back on (could also use swapon / | # turn swap back on (could also use swapon / | ||
swapon -aL | swapon -aL | ||
+ | </ | ||
+ | |||
+ | ===== Using a file for swap space ===== | ||
+ | |||
+ | Instead of using a swap partition or zvol, we can simply use a file. In this case, we can add swap space by deleting/ | ||
+ | |||
+ | Following code creates an 8G swap file. Note that after reading https:// | ||
+ | |||
+ | <code bash> | ||
+ | # create an 8G swap file | ||
+ | dd if=/ | ||
+ | # set permissions | ||
+ | chmod 0600 /swap | ||
+ | # look for an unused md device (ie, not listed) | ||
+ | mdconfig -lv | ||
+ | cp /etc/fstab / | ||
+ | # edit /etc/fstab and add the following line, using the correct md## | ||
+ | joe /etc/fstab | ||
+ | md42 none swap sw, | ||
+ | # save your file | ||
+ | # turn on swap | ||
+ | swapon -aq | ||
+ | # look at swap information | ||
+ | swapinfo -k | ||
</ | </ | ||
Line 158: | Line 189: | ||
* https:// | * https:// | ||
* https:// | * https:// | ||
+ | * https:// | ||
quickreference/zfs.1671307839.txt.gz · Last modified: 2022/12/17 14:10 by rodolico