Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Apr 2013 17:54:38 -0700
From:      Jeremy Chadwick <jdc@koitsu.org>
To:        lev@FreeBSD.org
Cc:        freebsd-fs@freebsd.org
Subject:   Re: ZFS snapshots and daily security checks
Message-ID:  <20130408005438.GA66727@icarus.home.lan>

next in thread | raw e-mail | index | archive | help
>   Here is strange difference between `mount' and `mount -p' output:
> `mount' doesn't show mounted ZFS snapshots, but `mount -p' does.
>
>   Is it possible to exclude these snapshots from `mount -p' output or
> don't mount them to hierarchy by default?

Taken from my stable/9 r249160 system:

root@icarus:~ # df -k
Filesystem   1024-blocks      Used      Avail Capacity  Mounted on
/dev/ada0p2      2063900    664952    1233836    35%    /
devfs                  1         1          0   100%    /dev
/dev/ada0p4     16503324    147416   15035644     1%    /var
/dev/ada0p5     16503324        44   15183016     0%    /tmp
/dev/ada0p6     25316000   6612788   16677932    28%    /usr
backups       1915745760 469845400 1445900360    25%    /backups
data/home     1462173974  16568039 1445605935     1%    /home
data/storage  1897306539 451700604 1445605935    24%    /storage
devfs                  1         1          0   100%    /var/named/dev
root@icarus:~ # zfs snapshot -r data/home@now
root@icarus:~ # touch /home/ilikedata
root@icarus:~ # zfs list -t snapshot
NAME            USED  AVAIL  REFER  MOUNTPOINT
data/home@now   160K      -  15.8G  -
root@icarus:~ # /sbin/mount -p
/dev/ada0p2             /                       ufs     rw              1 1
devfs                   /dev                    devfs   rw,multilabel   0 0
/dev/ada0p4             /var                    ufs     rw              2 2
/dev/ada0p5             /tmp                    ufs     rw              2 2
/dev/ada0p6             /usr                    ufs     rw              2 2
backups                 /backups                zfs     rw,nfsv4acls    0 0
data/home               /home                   zfs     rw,nfsv4acls    0 0
data/storage            /storage                zfs     rw,nfsv4acls    0 0
devfs                   /var/named/dev          devfs   rw,multilabel   0 0
root@icarus:~ # /sbin/mount
/dev/ada0p2 on / (ufs, local)
devfs on /dev (devfs, local, multilabel)
/dev/ada0p4 on /var (ufs, local, soft-updates)
/dev/ada0p5 on /tmp (ufs, local, soft-updates)
/dev/ada0p6 on /usr (ufs, local, soft-updates)
backups on /backups (zfs, local, nfsv4acls)
data/home on /home (zfs, local, nfsv4acls)
data/storage on /storage (zfs, local, nfsv4acls)
devfs on /var/named/dev (devfs, local, multilabel)

And now after mounting the snapshot:

root@icarus:~ # /sbin/mount -t zfs data/home@now /mnt
root@icarus:~ # df -k
Filesystem    1024-blocks      Used      Avail Capacity  Mounted on
/dev/ada0p2       2063900    664952    1233836    35%    /
devfs                   1         1          0   100%    /dev
/dev/ada0p4      16503324    147416   15035644     1%    /var
/dev/ada0p5      16503324        44   15183016     0%    /tmp
/dev/ada0p6      25316000   6612788   16677932    28%    /usr
backups        1915745760 469845400 1445900360    25%    /backups
data/home      1462173553  16568044 1445605509     1%    /home
data/storage   1897306113 451700604 1445605509    24%    /storage
devfs                   1         1          0   100%    /var/named/dev
data/home@now  1462173553  16568044 1445605509     1%    /mnt
root@icarus:~ # /sbin/mount -p
/dev/ada0p2             /                       ufs     rw              1 1
devfs                   /dev                    devfs   rw,multilabel   0 0
/dev/ada0p4             /var                    ufs     rw              2 2
/dev/ada0p5             /tmp                    ufs     rw              2 2
/dev/ada0p6             /usr                    ufs     rw              2 2
backups                 /backups                zfs     rw,nfsv4acls    0 0
data/home               /home                   zfs     rw,nfsv4acls    0 0
data/storage            /storage                zfs     rw,nfsv4acls    0 0
devfs                   /var/named/dev          devfs   rw,multilabel   0 0
data/home@now           /mnt                    zfs     ro,noatime,nfsv4acls    0 0
root@icarus:~ # /sbin/mount
/dev/ada0p2 on / (ufs, local)
devfs on /dev (devfs, local, multilabel)
/dev/ada0p4 on /var (ufs, local, soft-updates)
/dev/ada0p5 on /tmp (ufs, local, soft-updates)
/dev/ada0p6 on /usr (ufs, local, soft-updates)
backups on /backups (zfs, local, nfsv4acls)
data/home on /home (zfs, local, nfsv4acls)
data/storage on /storage (zfs, local, nfsv4acls)
devfs on /var/named/dev (devfs, local, multilabel)
data/home@now on /mnt (zfs, local, noatime, read-only, nfsv4acls)

It seems to me mount and mount -p show the mounted snapshot.

-- 
| Jeremy Chadwick                                   jdc@koitsu.org |
| UNIX Systems Administrator                http://jdc.koitsu.org/ |
| Mountain View, CA, US                                            |
| Making life hard for others since 1977.             PGP 4BD6C0CB |




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130408005438.GA66727>