How to Export a Dataset From a solaris Zone

This procedure exports a dataset for migration or move. If the dataset is in use, the export might not succeed. For more information, see Exporting a ZFS Storage Pool in Managing ZFS File Systems in Oracle Solaris 11.4.

  1. On the global zone, become an administrator.
  2. (Optional) Display the zone datasets that could be exported.
    • Display the zone datasets from the non-global zone.

      zonename$ pfbash zonecfg -z zonename info dataset
      dataset:
              name: rpool/export/dataset1
              alias: dataset1
      dataset:
              name: rpool/export/dataset2
              alias: dataset2
    • Log in to the zone, then display dataset information.

      $ zlogin zonename
      zonename$ zpool list
      NAME        SIZE  ALLOC   FREE   CAP  DEDUP  HEALTH  ALTROOT
      dataset1     68G   21.5G   46.5G  31%  1.00x  ONLINE  -
      dataset2     68G   21.5G   46.5G  31%  1.00x  ONLINE  -
      rpool       68G   21.5G   46.5G  31%  1.00x  ONLINE  -
      
      zonename
      zfs list -t all|grep ds
      dataset1                                31K  45.4G    31K  /dataset1
      dataset2                                31K  45.4G    31K  /dataset2
      zonename
      mount -v|grep ds
      dataset1 on /dataset1 type zfs read/write/setuid/nodevices/rstchown/nonbmand/exec/xattr/atime/
      zone=zonename/sharezone=1/dev=3350020 on Thu Jun 11 08:40:30 2015
      dataset2 on /dataset2 type zfs read/write/setuid/nodevices/rstchown/nonbmand/exec/xattr/atime/
      zone=zonename/sharezone=1/dev=3350021 on Thu Jun 11 08:40:30 2015
  3. From the non-global zone, export the dataset.
    zonename$ zpool export dataset1
  4. List the running zpools.

    The exported dataset should not be listed.

    zonename$ zpool list
    NAME     SIZE  ALLOC   FREE   CAP  DEDUP  HEALTH  ALTROOT
    dataset2  68G   21.5G   46.5G  31%  1.00x  ONLINE  -
    rpool    68G   21.5G   46.5G  31%  1.00x  ONLINE  -