Skip to content

Instantly share code, notes, and snippets.

@fling-
Created March 29, 2018 05:17
Show Gist options
  • Save fling-/c66bf1e4a082b5cf9cd4d1106fe6e2bc to your computer and use it in GitHub Desktop.
Save fling-/c66bf1e4a082b5cf9cd4d1106fe6e2bc to your computer and use it in GitHub Desktop.
#!/bin/sh
set -x
issue="7365"
sdate="`date +%s`" # need a variable path/poolname component as can't reuse the same until reboot
tmpdir=/tmp/$issue
poolfile=$tmpdir/$sdate.ima
poolname=issue-$issue-$sdate
mountpoint=$tmpdir/source-$sdate
mkdir -p $tmpdir
touch $poolfile
truncate --size=1G $poolfile
echo > /sys/module/zfs/parameters/zfs_max_recordsize 16777216
zpool create -m none -d \
-o feature@large_blocks=enabled \
-O recordsize=16M $poolname $poolfile
zfs create $poolname/source -o mountpoint=$mountpoint
echo > $mountpoint/large.block # putting a byte in a file
truncate --size=16M $mountpoint/large.block # and making it 16M long
zfs snap $poolname/source@testing
zfs send -L $poolname/source@testing \
| zfs recv -v $poolname/target # hangs here in recv _after_ the 16M block received
# does not go below this line
zpool destroy $poolname
rm $poolfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment