aboutsummaryrefslogtreecommitdiffstats
path: root/setup/copy_to_new_pool.sh
blob: 6e2f45ac287b8a914a0b6d3161cd5dc99320a48e (plain)
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
export ROOTFS_DIR="/mnt"
export POOL1=tpool
export POOL2=tpool2
export SNAPNAME=transfer

zfs snapshot -r $POOL1@$SNAPNAME
zfs send -R $POOL1@$SNAPNAME | zfs receive -Fduv $POOL2

zfs destroy -r $POOL1@$SNAPNAME
zfs destroy -r $POOL2@$SNAPNAME

# now re-import on $ROOTFS_DIR w/ mounting
zpool export $POOL2
zpool import -R $ROOTFS_DIR $POOL

# Maintenance
echo
echo "$POOL2 mountpoints"
zfs get -r mountpoint $POOL2

echo
echo "$POOL2 compression"
zfs get -r compression $POOL2

echo
echo "$POOL2 snapshots"
zfs list -r -t snapshot $POOL2

# follow
# - ../rescue/chroot_zfs.sh to update grub on new pool