Discussion:
zfs receive options (was S11 vs illumos zfs compatiblity)
Edward Ned Harvey (opensolarisisdeadlongliveopensolaris)
2012-12-21 18:39:27 UTC
Permalink
You can, with recv, override any property in the sending stream that can
be
set from the command line (ie, a writable).
cannot receive: cannot override received version
Are you sure you can do this with other properties? It's not in the man page. I would like to set the compression & sync on the receiving end:

zfs send foo/***@42 | zfs receive -o compression=on,sync=disabled biz/baz

I have not yet tried this syntax. Because you mentioned it, I looked for it in the man page, and because it's not there, I hesitate before using it.
Edward Harvey
2012-12-21 18:41:22 UTC
Permalink
Post by Edward Ned Harvey (opensolarisisdeadlongliveopensolaris)
I have not yet tried this syntax. Because you mentioned it, I looked for it in
the man page, and because it's not there, I hesitate before using it.
Also, readonly=on
Cindy Swearingen
2012-12-21 21:24:01 UTC
Permalink
Hi Ned,

Which man page are you referring to?

I see the zfs receive -o syntax in the S11 man page.

The bottom line is that not all properties can be set on the
receiving side and the syntax is one property setting per -o
option.

See below for several examples.

Thanks,

Cindy

I don't think version is a property that can be set on the
receiving size. The version must be specified when the file
system is created:

# zfs create -o version=5 tank/joe

You can't change blocksize on the receiving side either because
it is set during the I/O path. You can use shadow migration to
migrate a file system's blocksize.

This syntax errors because the supported syntax is "-o
property" not "-o properties."

# zfs send tank/home/***@now | zfs receive -o
compression=on,sync=disabled pond/cindy.backup
cannot receive new filesystem stream: 'compression' must be one of 'on
| off | lzjb | gzip | gzip-[1-9] | zle'

Set multiple properties like this:

# zfs send tank/home/***@now | zfs receive -o compression=on -o
sync=disabled pond/cindy.backup2

Enabling compression on the receiving side works, but verifying
the compression can't be done with ls.

The data is compressed on the receiving side:

# zfs list -r pond | grep data
pond/cdata 168K 63.5G 168K /pond/cdata
pond/nocdata 289K 63.5G 289K /pond/nocdata

# zfs send -p pond/***@snap1 | zfs recv -Fo compression=on rpool/cdata

# zfs get compression pond/nocdata
NAME PROPERTY VALUE SOURCE
pond/nocdata compression off default
# zfs get compression rpool/cdata
NAME PROPERTY VALUE SOURCE
rpool/cdata compression on local

You can't see the compressed size with the ls command:

# ls -lh /pond/nocdata/file.1
-r--r--r-- 1 root root 202K Dec 21 13:52 /pond/nocdata/file.1
# ls -lh /rpool/cdata/file.1
-r--r--r-- 1 root root 202K Dec 21 13:52 /rpool/cdata/file.1

You can see the size difference with zfs list:

# zfs list -r pond rpool | grep data
pond/cdata 168K 63.5G 168K /pond/cdata
pond/nocdata 289K 63.5G 289K /pond/nocdata
rpool/cdata 168K 47.6G 168K /rpool/cdata

You can also see the size differences with du -h:

# du -h pond/nocdata/file.1
258K pond/nocdata/file.1
# du -h rpool/cdata/file.1
137K rpool/cdata/file.1
Post by Edward Harvey
Post by Edward Ned Harvey (opensolarisisdeadlongliveopensolaris)
I have not yet tried this syntax. Because you mentioned it, I looked for it in
the man page, and because it's not there, I hesitate before using it.
Also, readonly=on
_______________________________________________
zfs-discuss mailing list
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
Edward Ned Harvey (opensolarisisdeadlongliveopensolaris)
2012-12-22 20:09:45 UTC
Permalink
Post by Cindy Swearingen
Which man page are you referring to?
I see the zfs receive -o syntax in the S11 man page.
Oh ... It's the latest openindiana. So I suppose it must be a new feature post-rev-28 in the non-open branch...

But it's no big deal. I found that if I "zfs create" and then "zfs set" a few times, and then "zfs receive" I get the desired behavior.
Edward Ned Harvey (opensolarisisdeadlongliveopensolaris)
2012-12-21 19:31:52 UTC
Permalink
Post by Edward Ned Harvey (opensolarisisdeadlongliveopensolaris)
I have not yet tried this syntax. Because you mentioned it, I looked for it in
the man page, and because it's not there, I hesitate before using it.
Also, readonly=on
...
and ...
Bummer. When I try zfs receive with -o, I get the message:
invalid option 'o'
Loading...