Managing ZFS File Systems in Oracle® Solaris 11.2

Exit Print View

Updated: December 2014
 
 

How to Migrate a File System to a ZFS File System

  1. If you are migrating data from a remote NFS server, confirm that the name service information is accessible on both systems.

    For a large migration using NFS, you might consider doing a test migration of a subset of the data to ensure that the UID, GUID, and ACL information migrates correctly.

  2. Install the shadow-migration package on the system where the data is to be migrated, if necessary, and enable the shadowd service to assist with the migration process.
    # pkg install shadow-migration
    # svcadm enable shadowd

    If you do not enable the shadowd process, you will have to reset the shadow property to none when the migration process is complete.

  3. Set the local or remote file system to be migrated to read-only.

    If you are migrating a local ZFS file system, set it to read-only. For example:

    # zfs set readonly=on tank/home/data

    If you are migrating a remote file system, share it read-only. For example:

    # share -F nfs -o ro /export/home/ufsdata
    # share
    -               /export/home/ufsdata   ro   ""  
  4. Create a new ZFS file system with the shadow property set to the file system to be migrated.

    For example, if you are migrating a local ZFS file system, rpool/old, to a new ZFS file system, users/home/shadow, set the shadow property to rpool/old when the users/home/shadow file system is created.

    # zfs create -o shadow=file:///rpool/old users/home/shadow

    For example, to migrate /export/home/ufsdata from a remote server, set the shadow property when the ZFS file system is created.

    # zfs create -o shadow=nfs://neo/export/home/ufsdata users/home/shadow2
  5. Check the progress of the migration.

    For example:

    # shadowstat
    EST
    BYTES   BYTES           ELAPSED
    DATASET                         XFRD    LEFT    ERRORS  TIME
    users/home/shadow               45.5M   2.75M   -       00:02:31
    users/home/shadow               55.8M   -       -       00:02:41
    users/home/shadow               69.7M   -       -       00:02:51
    No migrations in progress

    When the migration is complete, the shadow property is set to none.

    #zfs get -r shadow users/home/shadow*
    NAME                PROPERTY  VALUE   SOURCE
    users/home/shadow   shadow    none    -
    users/home/shadow2  shadow    none    -