[Bug 204705] zfs receive mounts received dataset even if -u is given

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Nov 20 21:54:14 UTC 2015


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204705

            Bug ID: 204705
           Summary: zfs receive mounts received dataset even if -u is
                    given
           Product: Base System
           Version: 10.2-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: vlad-fbsd at acheronmedia.com

It appears that `zfs send -R <root-dataset-snapshot> | zfs receive -Fdu
<external-media-dataset>`   will mount the received dataset despite the -u
flag. I discovered this sending the root partition having mountpoint=/ which
broke devfs. Below is a session done in a clean new (KVM) VM install with two
disks to replicate the issue:


root at freebsd:~ # zpool status

  pool: zroot
 state: ONLINE
  scan: none requested
config:

    NAME        STATE     READ WRITE CKSUM
    zroot       ONLINE       0     0     0
      vtbd0p2   ONLINE       0     0     0

errors: No known data errors


root at freebsd:~ # zpool list

NAME    SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
zroot  3.97G   830M  3.16G         -    13%    20%  1.00x  ONLINE  -


root at freebsd:~ # zfs list

NAME    USED  AVAIL  REFER  MOUNTPOINT
zroot   830M  3.03G   829M  /


root at freebsd:~ # zpool list -t snapshot

NAME                  USED  AVAIL  REFER  MOUNTPOINT
zroot at test-snapshot   496K      -   829M  -


root at freebsd:~ # zpool create zbackup vtbd1


root at freebsd:~ # zfs create zbackup/backup


root at freebsd:~ # zfs list

NAME             USED  AVAIL  REFER  MOUNTPOINT
zbackup          250K  3.84G    19K  /zbackup
zbackup/backup    19K  3.84G    19K  /zbackup/backup
zroot            830M  3.03G   829M  /


root at freebsd:~ # zfs send -R zroot at test-snapshot | zfs receive -Fdu
zbackup/backup

root at freebsd:~ # zfs list

internal error: failed to initialize ZFS library


root at freebsd:~ # mount

zroot on / (zfs, local, nfsv4acls)
devfs on /dev (devfs, local, multilabel)
zbackup on /zbackup (zfs, local, nfsv4acls)
zbackup/backup on / (zfs, local, nfsv4acls)


root at freebsd:~ # mount -t devfs devfs /dev


root at freebsd:~ # zfs list

NAME             USED  AVAIL  REFER  MOUNTPOINT
zbackup          829M  3.03G    19K  /zbackup
zbackup/backup   829M  3.03G   829M  /
zroot            830M  3.03G   829M  /


root at freebsd:~ # zfs mount

zroot                           /
zbackup                         /zbackup
zbackup/backup                  /


root at freebsd:~ # zpool export zbackup

cannot unmount '/': Device busy

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list