ZFS: pool vs FS

Shane Ambler FreeBSD at ShaneWare.Biz
Thu Jan 23 02:29:28 UTC 2014


On 23/01/2014 08:31, Chris Stankevitz wrote:
> On Wed, Jan 22, 2014 at 12:48 PM, Dan Nelson <dnelson at allantgroup.com> wrote:
>> "zpool create" does create a filesystem
> 
> Dan,
> 
> Thank you.  I suspected this was the case (the FreeBSD handbook
> certainly implies this).  Now that we have that out of the way I can
> ask my real question:
> 
> Can you identify the concept I am missing as evidenced by this failure:
> 
> ===
> 
> # truncate -s 100m disk1
> # truncate -s 100m disk2
> # zpool create pool1 /root/disk1
> # zpool create pool2 /root/disk2
> 
> So far so good... however, the next lines concern me.  Some people
> seem to say "Wait, /pool1 is not a good filesystem to start using you
> need to uze 'zfs create' first".  However your comment leads me to
> believe that /pool1 is okay to start using right away.
> 
> # echo asdf > /pool1/file.txt
> # zfs snapshot pool1 at 123
> 
> Let's try to replicate:
> 
> # zfs send pool1 at 123 | zfs recv pool2
> cannot receive new filesystem stream: destination 'pool2' exists
> must specify -F to overwrite it
> 
> Okay we have a problem.  This is the heart of my misunderstanding.
> But I'll try to power through:
> 
> # zfs send pool1 at 123 | zfs recv -F pool2
> # zfs list -t snapshot
> NAME        USED  AVAIL  REFER  MOUNTPOINT
> pool1 at 123  18.5K      -  31.5K  -
> pool1 at 124      0      -  31.5K  -
> pool2 at 123      0      -  31.5K  -
> 
> So far so good.  And let's try another replication:
> 
> # echo qwer > /pool1/file.txt
> # zfs snapshot pool1 at 124
> # zfs send pool1 at 124 | zfs recv pool2
> cannot receive new filesystem stream: destination 'pool2' exists
> must specify -F to overwrite it
> # zfs send pool1 at 124 | zfs recv -F pool2
> cannot receive new filesystem stream: destination has snapshots (eg. pool2 at 123)
> must destroy them to overwrite it

The filesystem specified as the destination for recv must not exist
therefore the need to -F the destination. The next snapshots should
then be incremental or sent to a different filesystem.

So we end up with the following steps -

# zfs snapshot pool1 at 123
# zfs send pool1 at 123 | zfs recv pool2/pool1snaps

# zfs snapshot pool1 at 124
# zfs send -i 123 pool1 at 124 | zfs recv pool2/pool1snaps

this sends snapshot 124 as an incremental change from 123

# zfs snapshot pool1 at 125
# zfs send -i 124 pool1 at 125 | zfs recv pool2/pool1snaps

this sends snapshot 125 as an incremental change from 124




More information about the freebsd-questions mailing list