forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake-all-records-streams.sh
More file actions
executable file
·45 lines (37 loc) · 1.45 KB
/
Copy pathmake-all-records-streams.sh
File metadata and controls
executable file
·45 lines (37 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh
if [ $# -ne 1 ]; then
echo "Usage: $0 <device>" >&2
exit 1
fi
DEVICE="$1"
SCRIPTDIR="$(cd "$(dirname "$0")" && pwd)"
zpool create -o ashift=12 test "$DEVICE"
zfs set compression=on xattr=sa test
zfs create test/source
"$SCRIPTDIR/gen-lorem-files.py" -r -d /test/source --min-size 2048 \
--max-size 32000 3
"$SCRIPTDIR/add-xattrs.py" /test/source/*
echo "very small" > /test/source/small
echo "password" > /test/source/to-be-redacted
chmod 400 /test/source/to-be-redacted
zfs snapshot -r test/source@baseline
zfs clone test/source@baseline test/redacted
rm /test/redacted/to-be-redacted
"$SCRIPTDIR/gen-lorem-files.py" -r -d /test/redacted --min-size 4096 \
--max-size 32000 3
"$SCRIPTDIR/add-xattrs.py" /test/redacted/*
cd /test/redacted
tar cf /tmp/dups.tar .
mkdir copies
cd copies
tar xvf /tmp/dups.tar
echo "password" > /test/redacted/new-key
zfs create -o encryption=on -o keylocation=file:///test/redacted/new-key \
-o keyformat=passphrase test/redacted/encrypted
"$SCRIPTDIR/gen-lorem-files.py" -r -d /test/redacted/encrypted 3
echo "very small" > /test/redacted/encrypted/small-encrypted
# "$SCRIPTDIR/add-xattrs.py" /test/redacted/encrypted/*
zfs snapshot -r test/redacted@clean
zfs redact test/source@baseline redaction-bookmark test/redacted@clean
zfs send -ce --redact redaction-bookmark test/source@baseline > /tmp/all-record-types-base.zsend
zfs send -Rcew -i test/source@baseline test/redacted@clean > /tmp/all-record-types-incr.zsend