How to Migrate a File System to a ZFS File System
Example 7-11 Starting and Monitoring File System Migrations
In this example, multiple migrations are initiated. The shadowadm
command lists ongoing migrations while the shadowstat
command monitors their progress.
$ zfs create -o shadow=nfs://system2/rpool/data/jsmith/archive rpool/data/copyarchive $ shadowadm list PATH STATE /rpool/data/copyarchive ACTIVE $ zfs create -o shadow=nfs://system2/rpool/data/jsmith/datalogs rpool/data/logcopy $ shadowadm list PATH STATE /rpool/data/copyarchive ACTIVE /rpool/data/logcopy ACTIVE $ shadowstat EST BYTES BYTES ELAPSED DATASET XFRD LEFT ERRORS TIME rpool/data/copyarchive 34.4M 3.37G - 00:00:36 rpool/data/logcopy 1.12K 155K 1 (completed)Errors are detected. rpool/data/copyarchive 34.5M 3.37G - 00:00:37 rpool/data/logcopy 1.12K 155K 1 (completed) rpool/data/copyarchive 35.0M 3.37G - 00:00:38 rpool/data/logcopy 1.12K 155K 1 (completed) rpool/data/copyarchive 35.2M 3.37G - 00:00:39 rpool/data/logcopy 1.12K 155K 1 (completed) ^C
The previous shadowstat
output indicates errors in the migration to rpool/data/logcopy
.
The following output from the shadowstat -E
and shadowstate -e
commands show that migration to rpool/data/logcopy
could not be completed because socket migration is not supported. The shadowadm
command cancels the migration.
$ shadowstat -E rpool/data/copyarchive: No errors encountered. rpool/data/logcopy: PATH ERROR errdir/cups-socket Operation not supported $ shadowstat -e /rpool/data/logcopy rpool/data/logcopy: PATH ERROR errdir/cups-socket Operation not supported $ shadowadm cancel /rpool/data/logcopy
The following output shows information about the migration to rpool/data/copyarchive
, which continues toward completion.
$ shadowadm list PATH STATE /rpool/data/copyarchive ACTIVE$ shadowstat EST BYTES BYTES ELAPSED DATASET XFRD LEFT ERRORS TIME rpool/data/copyarchive 251M 3.16G - 00:01:27 rpool/data/copyarchive 251M 3.16G - 00:01:28 rpool/data/copyarchive 252M 3.16G - 00:01:29 ^C $ shadowstat No migrations in progress. $ shadowadm list $ exit