How to Remove a dataset Resource From a Running Zone

Perform this procedure to remove ZFS datasets from a running zone.

Before you can remove the dataset dataset, you must first use the zpool export command to export the virtual zpool while in the non-global zone.

  1. On the global zone, become an administrator.
  2. View the dataset information of the live zone configuration.
    zonename$ pfbash zonecfg -z zonename -r info dataset
    …
    dataset:
            name: rpool/export/dataset1
            alias: dataset1
    dataset:
            name: rpool/export/dataset2
            alias: dataset2
  3. Remove the dataset from the running zone, verify the change, and commit the change to the live zone configuration.
    zonename$ zonecfg -z zonename -r
    zonecfg:zonename> remove dataset name=rpool/export/dataset1
    zonecfg:zonename> info dataset
    dataset 0:
            name: rpool/export/dataset2
            alias: dataset2
    …
    zonecfg:zonename> commit
    zone 'zonename': Checking: Removing dataset name=rpool/export/dataset1
    zone 'zonename': Applying the changes
    zonecfg:zonename> exit
  4. Display the dataset information of the live zone configuration.

    Verify that the dataset is removed from the live zone configuration.

    zonename$ zonecfg -z zonename -r info dataset
    dataset:
            name: rpool/export/dataset2
            alias: dataset2
  5. (Optional) Change the persistent zone configuration to match the live zone configuration.
    zonename$ zoneadm -z zonename apply