Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| zfsquickstartguide [2008/06/17 21:37] – converted to 1.6 markup 127.0.0.1 | zfsquickstartguide [2021/05/04 10:51] (current) – Fix 1 broken link. SashaVigole | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | <callout type=" | ||
| + | **Warning** | ||
| + | This document is outdated, start with the %%FreeBSD%% Handbook' | ||
| + | </ | ||
| + | |||
| Ok, [[ZFS]] is now in the tree, what's now? Below you'll find some | Ok, [[ZFS]] is now in the tree, what's now? Below you'll find some | ||
| instructions how to quickly get it up and running. | instructions how to quickly get it up and running. | ||
| April 8, 2008: **Just because ZFS is in 7.0-RELEASE does *not* mean it works with the default GENERIC kernel!** | April 8, 2008: **Just because ZFS is in 7.0-RELEASE does *not* mean it works with the default GENERIC kernel!** | ||
| + | |||
| + | December 2009: It is probably best to use ZFS only with %%FreeBSD%% 7.3 and newer versions. | ||
| With that said, on to getting started... | With that said, on to getting started... | ||
| Line 11: | Line 18: | ||
| Add a line to your / | Add a line to your / | ||
| - | < | ||
| # echo ' | # echo ' | ||
| - | </ | ||
| Now, setup one pool using RAIDZ: | Now, setup one pool using RAIDZ: | ||
| - | < | ||
| # zpool create tank raidz da0 da1 da2 | # zpool create tank raidz da0 da1 da2 | ||
| - | </ | ||
| It should automatically mount /tank/ for you. | It should automatically mount /tank/ for you. | ||
| Line 27: | Line 30: | ||
| directory and once we are ready, we will just change the mountpoint to /usr. | directory and once we are ready, we will just change the mountpoint to /usr. | ||
| - | < | ||
| # zfs create tank/usr | # zfs create tank/usr | ||
| - | </ | ||
| Create ports/ file system and enable gzip compression on it, because | Create ports/ file system and enable gzip compression on it, because | ||
| Line 36: | Line 37: | ||
| directory are already compressed: | directory are already compressed: | ||
| - | < | + | # zfs create tank/ |
| - | # zfs create tank/ | + | # zfs set compression=gzip tank/ |
| - | # zfs set compression=gzip tank/ | + | # zfs create tank/ |
| - | # zfs create tank/ | + | # zfs set compression=off tank/ |
| - | # zfs set compression=off tank/ | + | |
| - | </ | + | |
| (You do see how your life is changing, don't you?:%%))%% | (You do see how your life is changing, don't you?:%%))%% | ||
| Line 49: | Line 48: | ||
| stuff, so I'll define that each block has to be stored in three copies: | stuff, so I'll define that each block has to be stored in three copies: | ||
| - | < | + | # zfs create tank/ |
| - | # zfs create tank/ | + | # zfs create tank/ |
| - | # zfs create tank/ | + | # zfs create tank/ |
| - | # zfs create tank/ | + | # zfs set copies=3 tank/ |
| - | # zfs set copies=3 tank/ | + | |
| - | </ | + | |
| I'd like to have directory with music, etc. that I NFS share. I don't | I'd like to have directory with music, etc. that I NFS share. I don't | ||
| Line 61: | Line 58: | ||
| benchmark before doing it, because it's most likely not worth it!): | benchmark before doing it, because it's most likely not worth it!): | ||
| - | < | + | # zfs create tank/music\\ |
| - | # zfs create tank/ | + | # zfs set checksum=off tank/music\\ |
| - | # zfs set checksum=off tank/ | + | # zfs set sharenfs=on tank/music\\ |
| - | # zfs set sharenfs=on tank/music | + | |
| - | </ | + | |
| Oh, I almost forget. Who cares about access time updates? | Oh, I almost forget. Who cares about access time updates? | ||
| - | < | ||
| # zfs set atime=off tank | # zfs set atime=off tank | ||
| - | </ | ||
| Yes, we set it only on tank and it will be automatically inherited by | Yes, we set it only on tank and it will be automatically inherited by | ||
| Line 78: | Line 71: | ||
| Would be also good to be informed if everything is fine with our pool: | Would be also good to be informed if everything is fine with our pool: | ||
| - | < | ||
| # echo ' | # echo ' | ||
| - | </ | ||
| For some reason you still need UFS file system, for example you use ACLs | For some reason you still need UFS file system, for example you use ACLs | ||
| Line 87: | Line 78: | ||
| snapshots, UFS clones, etc. by simply using ZVOLs. | snapshots, UFS clones, etc. by simply using ZVOLs. | ||
| - | < | + | # zfs create -V 10g tank/ufs\\ |
| - | # zfs create -V 10g tank/ufs | + | # newfs / |
| - | # newfs / | + | # mount / |
| - | # mount / | + | \\ |
| - | + | # zfs snapshot tank/ | |
| - | # zfs snapshot tank/ | + | # mount -r / |
| - | # mount -r / | + | \\ |
| - | + | # zfs clone tank/ | |
| - | # zfs clone tank/ | + | # fsck_ffs -p / |
| - | # fsck_ffs -p / | + | # mount / |
| - | # mount / | + | |
| - | </ | + | |
| Want to encrypt your swap and still use [[ZFS]]? Nothing more trivial: | Want to encrypt your swap and still use [[ZFS]]? Nothing more trivial: | ||
| Line 104: | Line 93: | ||
| :!: WARNING: Due the way ZFS is currently implemented (also in Solaris), this might not work in low memory conditions (i.e. at those times you really need the swap space). See http:// | :!: WARNING: Due the way ZFS is currently implemented (also in Solaris), this might not work in low memory conditions (i.e. at those times you really need the swap space). See http:// | ||
| - | < | + | # zfs create -V 4g tank/swap\\ |
| - | # zfs create -V 4g tank/swap | + | # geli onetime -s 4096 / |
| - | # geli onetime -s 4096 / | + | # swapon / |
| - | # swapon / | + | |
| - | </ | + | |
| Trying to do something risky with your home? Snapshot it first! | Trying to do something risky with your home? Snapshot it first! | ||
| - | < | ||
| # zfs snapshot tank/ | # zfs snapshot tank/ | ||
| - | </ | ||
| Turns out it was more stupid than risky? Rollback your snapshot! | Turns out it was more stupid than risky? Rollback your snapshot! | ||
| - | < | + | # zfs rollback tank/ |
| - | # zfs rollback tank/ | + | # zfs destroy tank/ |
| - | # zfs destroy tank/ | + | |
| - | </ | + | |
| Ok, everything works, we may set tank/usr as our real /usr: | Ok, everything works, we may set tank/usr as our real /usr: | ||
| - | < | ||
| # zfs set mountpoint=/ | # zfs set mountpoint=/ | ||
| - | </ | ||
| - | Don't forget to read zfs(8) and zpool(8) manual pages and SUN's [[http://www.opensolaris.org/ | + | Don't forget to read zfs(8) and zpool(8) manual pages and SUN's [[https://web.archive.org/ |
| For a more light-hearted introduction to ZFS' features, see this humorous presentation given by Pawel at %%EuroBSDCon%% 2007: http:// | For a more light-hearted introduction to ZFS' features, see this humorous presentation given by Pawel at %%EuroBSDCon%% 2007: http:// | ||
| + | |||
| + | ---- | ||
| + | |||
| + | {{tag> | ||