Change Record Size?

jasonsansone

Explorer
Joined
Jul 18, 2019
Messages
79
I want to change my pool record size to 1MB. I have used zfs replication to move the data off the pool, nuked the pool, and replicated it back. The results of zdb show the record size as unchanged... it is still the default 128KB. I was under the impression that to change compression or record size you copy data off and back... but that isn't working. Can I not use zfs send recv to change record size?
 

jasonsansone

Explorer
Joined
Jul 18, 2019
Messages
79
pool record size? record size is a per-dataset property....

Sorry, you are correct. I changed root level dataset to 1MB block size. All child datasets inherit the block size. I believe I figured out that the -R flag is causing the 128 block size to persist. I am testing using -L on send and -o recordsize=1M on receive.
 

HoneyBadger

actually does care
Administrator
Moderator
iXsystems
Joined
Feb 6, 2014
Messages
5,112
The zfs send/recv commands send records, not files; ergo, the recordsize will not change.

You'll have to use something "above" the ZFS level - rsync, robocopy, Ctrl-C + Ctrl-V - in order to have the files written as new records with the new recordsize=1M.
 

jasonsansone

Explorer
Joined
Jul 18, 2019
Messages
79
The zfs send/recv commands send records, not files; ergo, the recordsize will not change.

You'll have to use something "above" the ZFS level - rsync, robocopy, Ctrl-C + Ctrl-V - in order to have the files written as new records with the new recordsize=1M.

Tested... confirmed... drat :frown:
 

jasonsansone

Explorer
Joined
Jul 18, 2019
Messages
79
For anyone that ever comes across this via search:

zfs send receive won't expand record size to fit a dataset with a larger record size, but it will shrink if you are migrating to from one dataset with a larger size to a dataset with a smaller size. Omitting the L flag from send (if using larger then 128Kb record size) or specifying "-o recordsize=" on the receiving end will force smaller records.
 

jasonsansone

Explorer
Joined
Jul 18, 2019
Messages
79
Interesting and good to know. The particular data I tested with wasn’t critical; it’s a test setup.
 
Top