1: # ZFS on NetBSD
2:
3: This page attempts to do two things: provide enough orientation and
4: pointers to dstandard ZFS documentation for NetBSD users who are new to
5: ZFS, and to describe NetBSD-specific ZFS information. It is
6: emphatically not a tutorial or an introduction to ZFS.
7:
8: Many things are marked with \todo because they need a better
9: explanation, and some have question marks, indicating that the
10: statement needs verification.
11:
12: # Documentation Pointers
13:
14: See the man pages for zfs(8) and zpool(8).
15:
16: - [Oracle ZFS Administration Manual](https://docs.oracle.com/cd/E26505_01/html/E37384/index.html)
17: - [FreeBSD Handbook ZFS Chapter](https://www.freebsd.org/doc/handbook/zfs.html)
18:
19: # Status of ZFS in NetBSD
20:
21: ## Sources
22:
23: \todo Verify/fix.
24:
25: Currently, there are multiple ZFS projects/codebases:
26:
27: - ZFS as released under the CDDL (common ancestor)
28: - [OpenZFS](http://www.open-zfs.org/wiki/Main_Page)
29: - [zfsonlinux](https://zfsonlinux.org/)
30: - proprietary ZFS in Solaris (not relevant in open source)
31:
32: OpenZFS is a coordinating project to align open ZFS codebases. There
33: is a notion of a shared core codebase and OS-specific adaptation code.
34:
35: ## NetBSD code history
36:
37: \todo This section really needs help.
38:
39: Before NetBSD 8, NetBSD imported ZFS code from ?
40:
41: Before NetBSD 9, NetBSD imported updated ZFS code from FreeBSD. That
42: FreeBSD code came from ?
43:
44: ## NetBSD 8 and earlier
45:
46: While there is some ZFS code, it is old, and seems to have significant
47: problems. If one wants to use ZFS, first upgrade to NetBSD 9. It is
48: unlikely that anyone is interested in helping, other than telling you
49: to upgrade to 9.
50:
51: (Reports of how well NetBDS 8 works are welcome on netbsd-users, if it
52: can actually be recommended for use.)
53:
54: ## NetBSD 9
55:
56: There have been fixes since 9.0 RELEASE. It is best to upgrade along
57: the netbsd-9 branch, but the release should be ok. Most aspects work solidly.
58:
59: \todo Explain this in terms of versions of FreeBSD OpenZFS and/or
60: zfsonlinux.
61:
62: \todo This supports pool version 28/5000 (really true?). Of the
63: feature flags found in modern OpenZFS, \todo are supported.
64:
65: Generally, fixes to ZFS in current will be pulled up to 9, but new
66: features typically will not be.
67:
68: ## NetBSD current
69:
70: The ZFS code in current is very similar to that in 9.
71:
72: There is initial support for [[ZFS root|wiki/RootOnZFS]], via booting from
73: ffs and pivoting.
74:
75: One can make a ccd using a zvol as a component. This allows reading a
76: GPT label from the zvol, which is useful in case the zvol had been
77: exported via iscsi and some other system created a label.
78:
79: ## things that aren't suported yet
80:
81: \todo hotswap (maybe - not clear exactly what this means)
82:
83: \todo direct boot into zfs root (via bootblocks reading zfs)
84:
85: ## Architectures
86:
87: Most people seem to be using amd64.
88:
89: To build zfs, one puts MKZFS=yes in mk.conf. This is default on amd64
90: and aarch64 on netbsd-9. In current, it is also default on sparc64.
91:
92: More or less, zfs can be enabled on an architecture when it is known
93: to build and run reliably. (Of course, users are welcome to build it
94: and report.)
95:
96: # NetBSD-specific information
97:
98: ## rc.conf
99:
100: The main configuration is to put zfs=YES in rc.conf, so that the rc.d
101: scripts bring up ZFS and mount ZFS filesystems.
102:
103: ## legacy vs ? mount points
104:
105: \todo Explain, if this is NetBSD specific. Explain consequences, as
106: this seems to have something to do with mount ordering.
107:
108: ## mount order
109:
110: NetBSD 9 mounts other filesystems and then ZFS filesystems. This can
111: be a problem if /usr/pkgsrc is on ZFS and /usr/pkgsrc/distfiles is on
112: NFS. A workaround is to use noauto and do the mounts in
113: /etc/rc.local.
114:
115: NetBSD current after 20200301 mounts ZFS first. \todo Explain
116: consequences.
117:
118: ## TRIM
119:
120: There is some notion of TRIM and zfs using it.
121:
122: \todo Explain how this relates to NetBSD.
123:
124: # Memory usage
125:
126: Basically, ZFS uses lots of memory and most people run it on systems
127: with large amounts of memory. NetBSD works well on systems with
128: comparatively small amounts of memory. So a natural question is how
129: well ZFS works on one's VAX with 2M of RAM :-)
130:
131: More seriously, one might ask if it is reasonable to run ZFS on a RPI3
132: with 1G of RAM, or even if it is reasonable on a system with 4G.
133:
134: \todo Give ballpark level for minimum sane RAM, and the amount which
135: is cleanly enough.
136:
137: For now, a good guess is that a 4G system with only 1T of disk is
138: probably ok, 1G is very likely not ok.
139:
140: FreeBSD has some documentation about memory use. There is a notion of
141: a minimum of 1G, and using 1G for 1T of storage, and more if
142: deduplication is enabled. FreeBSD considers all i386 systems to be
143: low memory; this appears to be a clue.
144:
145: \todo Explain if the FreeBSD sysctl list applies, or if not what we
146: should do instead.
147:
148: - [FreeBSD low memory documentation](https://www.freebsd.org/doc/handbook/zfs-advanced.html)
149:
150: # Interoperability with other systems
151:
152: \todo Explain pool version and feature flags relationship to FreeBSD,
153: Linux, OpenIndiana/Illumos/?, and ?
154:
155:
CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb