Diff for /wikisrc/zfs.mdwn between versions 1.26 and 1.27

version 1.26, 2020/06/24 15:19:56 version 1.27, 2021/02/12 14:28:54
Line 13  statement needs verification. Line 13  statement needs verification.
   
 See the man pages for zfs(8) and zpool(8).  See the man pages for zfs(8) and zpool(8).
   
   - [Oracle ZFS Administration Manual](https://docs.oracle.com/cd/E26505_01/html/E37384/index.html)    - [OpenZFS Documentation](https://openzfs.github.io/openzfs-docs/)
   - [FreeBSD Handbook ZFS Chapter](https://www.freebsd.org/doc/handbook/zfs.html)  
   - [OpenZFS admin docs index page](https://github.com/openzfs/zfs/wiki/Admin-Documentation)    - [OpenZFS admin docs index page](https://github.com/openzfs/zfs/wiki/Admin-Documentation)
     - [FreeBSD Handbook ZFS Chapter](https://www.freebsd.org/doc/handbook/zfs.html)
     - [Oracle ZFS Administration Manual](https://docs.oracle.com/cd/E26505_01/html/E37384/index.html)
   - [Wikipedia](https://en.wikipedia.org/wiki/ZFS)    - [Wikipedia](https://en.wikipedia.org/wiki/ZFS)
   
 # Status of ZFS in NetBSD  # Status of ZFS in NetBSD
   
 ## Sources of ZFS code  ## NetBSD 8
   
 \todo Verify/fix.  
   
 Currently, there are multiple ZFS projects and codebases:  
   
   - ZFS as released under the CDDL (common ancestor)  
   - [OpenZFS](http://www.open-zfs.org/wiki/Main_Page) [github wiki](https://github.com/openzfs/zfs/wiki)  
   - [zfsonlinux](https://zfsonlinux.org/)  
   - [OpenZFS on OS X ](https://openzfsonosx.org/) [repo](https://github.com/openzfsonosx)  
   - proprietary ZFS in Solaris (not relevant in open source)  
   
 OpenZFS is a coordinating project to align open ZFS codebases.  There  
 is a notion of a shared core codebase and OS-specific adaptation code.  
 As of early 2020, it appears that there are two co-root repositories:  
 illumos and zfsonlinux, with a notion that fixes and improvements  
 should be cross-shared.  This is different from the situation through  
 late 2019 where sharing was done via a designated sharing repository,  
 and appears to be a new, more efficient, procedure among cooperating  
 people, rather than any kind of fork.  
   
   - [deprecation of OpenZFS repo](https://github.com/openzfs/openzfs/)  
   - [zfsonlinux relationship to OpenZFS](https://github.com/openzfs/zfs/wiki/OpenZFS-Patches)  
   
 \todo Explain how FreeBSD code relates to zfsonlinux (imported/merged and fixes pushed upstream?).  
   
 \todo Explain how the NetBSD code relates (imported from FreeBSD? intent to continue to track?)  
   
 \todo Explain if NetBSD has a plan to join zfsonlinux as a first-class  NetBSD 8 has an old version of ZFS, and it is not recommended for use
 member, vs tracking via FreeBSD.  at all.  There is no evidence that anyone is interested in helping
   with ZFS on 8.  Those wishing to use ZFS on NetBSD 8 should therefore
 \todo Explain how OpenZFS on OS X relates (tracks zfsonlinux?).  update to NetBSD 9.
   
 See [FreeBSD's history](https://wiki.freebsd.org/ZFSTuningGuide).  
   
 ## NetBSD code history  
   
 \todo This section really needs help.  
   
 Before NetBSD 8, NetBSD imported ZFS code from ?, which was version ?  
   
 Before NetBSD 9, NetBSD imported updated ZFS code from FreeBSD.  That  
 FreeBSD code came from ?, which was version ?  
   
 ## NetBSD 8 and earlier  
   
 While there is some ZFS code, it is old, and seems to have significant  
 problems.  If one wants to use ZFS, first upgrade to NetBSD 9.  It is  
 unlikely that anyone is interested in helping, other than telling you  
 to upgrade to 9.  
   
 (Reports of how well NetBSD 8 works are welcome on netbsd-users, if it  
 can actually be recommended for use.)  
   
 ## NetBSD 9  ## NetBSD 9
   
 There have been fixes since 9.0 RELEASE.  It is best to upgrade along  NetBSD-9 has ZFS that is considered to work well.  There have been
 the netbsd-9 branch, but the release should be ok.  Most aspects work solidly.  fixes since 9.0_RELEASE.  As always, people running NetBSD 9 are
   likely best served by the most recent version of the netbsd-9 stable
   branch.  As of 2021-02, ZFS in the NetBSD 9.1 release is very close to
   netbsd-9.
   
 \todo Explain this in terms of versions of FreeBSD OpenZFS and/or  ## NetBSD-current
 zfsonlinux.  
   
 \todo This supports pool version 28/5000 (really true?).  Of the  NetBSD-current (as of 2021-02) has similar ZFS code to 9.
 feature flags found in modern OpenZFS, \todo are supported.  
   
 Generally, fixes to ZFS in current will be pulled up to 9, but new  
 features typically will not be.  
   
 ## NetBSD current  
   
 The ZFS code in current is very similar to that in 9.  
   
 There is initial support for [[ZFS root|wiki/RootOnZFS]], via booting from  There is initial support for [[ZFS root|wiki/RootOnZFS]], via booting from
 ffs and pivoting.  ffs and pivoting.
   
 One can make a ccd using a zvol as a component.  See the zvol section below.  ## NetBSD/xen special issues
   
 ## Things that aren't supported yet  In NetBSD-9, MAXPHYS is 64KB in most places, but because of xbd(4) it
   is set to 32KB for XEN kernels.  Thus the standard zfs kernel modules
   do not work under xen.  In NetBSD-current, xbd(4) supports 64 KB
   MAXPHYS and this is no longer an issue.
   
 \todo hotswap (maybe - not clear exactly what this means)  Xen and zfs on current are reported to work well together, as of 2021-02.
   
 \todo direct boot into zfs root (via boot blocks reading zfs)  
   
 ## Architectures  ## Architectures
   
Line 115  More or less, zfs can be enabled on an a Line 63  More or less, zfs can be enabled on an a
 to build and run reliably.  (Of course, users are welcome to build it  to build and run reliably.  (Of course, users are welcome to build it
 and report.)  and report.)
   
   # Quick Start
   
   See the [FreeBSD Quickstart
   Guide](https://www.freebsd.org/doc/handbook/zfs-quickstart.html); only
   the first item is NetBSD specific.
   
     - Put zfs=YES in rc.conf.
   
     - Create a pool as "zpool create pool1 /dev/dk0".
   
     - df and see /pool1
   
     - Create a filesystem mounted on /n0 as "zfs create -o
       mountpoint=/n0 pool1/n0".
   
     - Go back and read the documentation and start over.
   
 # NetBSD-specific information  # NetBSD-specific information
   
 ## rc.conf  ## rc.conf
Line 127  scripts bring up ZFS and mount ZFS file  Line 92  scripts bring up ZFS and mount ZFS file 
 One can add disks or parts of disks into pools.  Methods of specifying  One can add disks or parts of disks into pools.  Methods of specifying
 areas to be included include:  areas to be included include:
   
   - entire disks (e.g., /dev/rwd0d on amd64)    - entire disks (e.g., /dev/wd0d on amd64)
   - disklabel partitions (e.g., /dev/sd0e)    - disklabel partitions (e.g., /dev/sd0e)
   - wedges (e.g., /dev/dk0)    - wedges (e.g., /dev/dk0)
   
 ## legacy vs ? mount points  
   
 \todo Explain, if this is NetBSD specific.  Explain consequences, as  
 this seems to have something to do with mount ordering.  
   
 ## mount order  ## mount order
   
 NetBSD 9 mounts other file systems and then ZFS file systems.  This can  NetBSD 9 mounts other file systems and then ZFS file systems.  This can
Line 143  be a problem if /usr/pkgsrc is on ZFS an Line 103  be a problem if /usr/pkgsrc is on ZFS an
 NFS.  A workaround is to use noauto and do the mounts in  NFS.  A workaround is to use noauto and do the mounts in
 /etc/rc.local.  /etc/rc.local.
   
 NetBSD current after 20200301 mounts ZFS first. \todo Explain  NetBSD current after 20200301 mounts ZFS first.  The same issues and
 consequences.  workarounds apply in different circumstances.
   
 ## NFS  ## NFS
   
 \todo Verify if this is accurate.  zfs filesystems are reported to be exportable over NFS.
   
   The "zfs share" command adds a line to /etc/zfs/exports, and "zfs
   unshare" removes it.
   
 zfs filesystems can be exported over NFS.  While there are zfs  \todo Explain how /etc/zfs/exports is used.
 commands that appear to be about controlling exports, they simply  
 print information that can be added to exports(5).  
   
 This is reported to work on 9.0 STABLE, but to cause a panic on  This is reported to work on 9.0 STABLE, but to cause a panic on
 current (20200302).  See [misc/55042](http://gnats.netbsd.org/55042).  current (20200302).  See [misc/55042](http://gnats.netbsd.org/55042).
Line 176  from a zvol.  This allows reading a GPT  Line 137  from a zvol.  This allows reading a GPT 
 useful in case the zvol had been exported via iscsi and some other  useful in case the zvol had been exported via iscsi and some other
 system created a label.  system created a label.
   
 ## TRIM  
   
 There is some notion of TRIM and zfs using it.  
   
 \todo Explain how this relates to NetBSD.  
   
 # Memory usage  # Memory usage
   
 Basically, ZFS uses lots of memory and most people run it on systems  Basically, ZFS uses lots of memory and most people run it on systems
 with large amounts of memory.  NetBSD works well on systems with  with large amounts of memory.  NetBSD works well on systems with
 comparatively small amounts of memory.  So a natural question is how  comparatively small amounts of memory.  So a natural question is how
 well ZFS works on one's VAX with 2M of RAM :-)  well ZFS works on one's VAX with 2M of RAM :-) More seriously, one
   might ask if it is reasonable to run ZFS on a RPI3 with 1G of RAM, or
 More seriously, one might ask if it is reasonable to run ZFS on a RPI3  if it is reasonable on a system with 4G.
 with 1G of RAM, or even if it is reasonable on a system with 4G.  
   The prevailing wisdom is more or less that ZFS consumes 1G plus 1G per
 \todo Give ballpark level for minimum sane RAM, and the amount which  1T of disk.  32-bit architectures are viewed as too small to run ZFS.
 is cleanly enough.  
   Besides RAM, zfs requires that architecture kernel stack size is at
 For now, a good guess is that a 4G system with only 1T of disk is  least 12KB or more -- some operations cause stack overflow with 8KB
 probably ok, and that 1G is very likely not ok.  kernel stack. On NetBSD, the architectures with 16KB kernel stack are
   amd64, sparc64, powerpc, and experimental ia64, hppa. mac68k and sh3
 Besides RAM, zfs requires that architecture kernel stack size is at least 12KB or more - some  have 12KB kernel stack. All others use only 8KB stack, which is not
 operations cause stack overflow with 8KB kernel stack. On NetBSD, the architectures  enough to run zfs.
 with 16KB kernel stack are amd64, sparc64, powerpc, and experimental ia64, hppa. mac68k and sh3 have 12KB kernel  
 stack. All others use only 8KB stack, which is not enough to run zfs.  NetBSD has many statistics provided via sysctl; see "sysctl
   kstat.zfs".
 FreeBSD has some documentation about memory use.  There is a notion of  
 a minimum of 1G (used for ZFS), and using 1G for 1T of storage, and  FreeBSD has tunables that NetBSD does not seem to have, described in
 more if deduplication is enabled.  FreeBSD considers all i386 systems  [FreeBSD Handbook ZFS Advanced
 to be low memory; this appears to be a clue.  section](https://docs.freebsd.org/en/books/handbook/zfs/#zfs-advanced).
   
 \todo Explain if the FreeBSD sysctl list applies, or if not what we  
 should do instead.  
   
   - [FreeBSD low memory documentation](https://www.freebsd.org/doc/handbook/zfs-advanced.html)  
   
 # Interoperability with other systems  # Interoperability with other systems
   
 \todo Explain pool version and feature flags relationship to FreeBSD,  Modern ZFS uses pool version 5000 and feature flags.
 Linux, OpenIndiana/Illumos/?, and ?  
   
 \todo Explain how to configure a pool in terms of version/features for  It is in general possible to export a pool and them import the pool on
 use with particula other systems.  some other system, as long as the other system supports all the used
   features.
   
 # Quick Start  \todo Explain how to do this and what is known to work.
   
 See the [FreeBSD Quickstart  \todo Explain feature flags relationship to FreeBSD, Linux, iIllumos,
 Guide](https://www.freebsd.org/doc/handbook/zfs-quickstart.html); only  macOS.
 the first item is NetBSD specific.  
   
   - Put zfs=YES in rc.conf.  # Sources of ZFS code
   
   - Create a pool as "zpool create pool1 /dev/dk0".  Currently, there are multiple ZFS projects and codebases:
   
   - df and see /pool1    - [OpenZFS](http://www.open-zfs.org/wiki/Main_Page)
     - [openzfs repository](https://github.com/openzfs/zfs}
     - [zfsonlinux](https://zfsonlinux.org/)
     - [OpenZFS on OS X ](https://openzfsonosx.org/) [repo](https://github.com/openzfsonosx)
     - proprietary ZFS in Solaris (not relevant in open source)
     - ZFS as released under the CDDL (common ancestor, now of historical interest)
   
   - Really, read the FreeBSD docs and the other linked documentation above.  OpenZFS is a coordinating project to align open ZFS codebases.  There
   is a notion of a shared core codebase and OS-specific adaptation code.
   
     - [zfsonlinux relationship to OpenZFS](https://github.com/openzfs/zfs/wiki/OpenZFS-Patches)
     - FreeBSD more or less imports code from openzfs and pushes back fixes. \verify
     - NetBSD has imported code from FreeBSD
     - The status of ZFS on macOS is unclear (2021-02)

Removed from v.1.26  
changed lines
  Added in v.1.27


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb