Go to main content

Oracle SuperCluster Configuration Backup Utility - Recovery Guide

Exit Print View

Updated: June 2020
 
 

Restore the Zonepath

If the data located in the zonepath or in the zone's rpool has been damaged or lost, this procedure provides instructions on how to restore this data.

If the zonepath is healthy, ignore this procedure.


Caution

Caution  -  When following the process to restore the zonepath, do not try to install the zone, and do not run the zoneadm -z myzone install command. Doing so can corrupt the zonepath that is being restored.


Backing up a zone generates a ZFS stream out of the zonepath. The restore procedure consists of receiving this stream back.

  1. Obtain the zonepath.
    # zonepath=`zonecfg -z myzone info zonepath | awk '{print $2}'`
    
  2. Check if the zonepath's dataset is still available.
    # zfs list -H -o name -t filesystem $zonepath
    
  3. Restore a zonepath that is damaged or not available.
    1. Check if the zpool hosting the zonepath is available. Obtain the zpool from the .info file in osc-config-backup/domains/mydomain/SolarisZones/myzone.
      # pool=`grep zonepath /sharedPath/myzone.data.info | grep pool | awk '{print $3}'`
      
    2. Check if the zpool is online.
      # zpool list $pool
      
    3. If the pool is not online, obtain the raw device used by the pool, then recreate it.
      # device=`grep zonepath /sharedPath/myzone.data.info | grep 'raw device' | awk '{print $4}'`
      # zpool create $pool $device
      
    4. Once the pool is online, obtain the dataset, then obtain its mount point, then recreate the dataset associated with the zonepath.
      # dataset=`grep zonepath /sharedPath/myzone.data.info | grep dataset | awk '{print $3}'`    
      # mountpoint=`grep zonepath /sharedPath/myzone.data.info | grep mountpoint | awk '{print $3}'`
      # zfs create $dataset
      
  4. Receive the zonepath stream and set its mount point.

    Locate the .zfs file in osc-config-backup/domains/mydomain/SolarisZones/myzone and receive it.

    root# su - oscbackR
    oscbackR$ cd osc-config-backup/domains/mydomain/SolarisZones/myzone
    oscbackR$ cp rpool.backup.data.zfs /sharedPath
    oscbackR$ exit
    root# cat /sharedPath/rpool.backup.data.zfs | zfs receive -vF $dataset
    root# zfs set mountpoint=$mountpoint $dataset
    
  5. Destroy the remaining snapshot.
    # zfs destroy -r $dataset@osc-config-backup
    
  6. Ensure that the zonepath dataset is mounted.
    # zonepath=`zonecfg -z myzone info zonepath | awk '{print $2}'`
    # dataset=`zfs list -Ho name -t  filesystem $zonepath`
    # zfs mount $dataset