Saturday 24 June 2017

Sun Solaris zonecfg commands with an example

"zonecfg" command is very useful command which is mostly used during configuration of new zone or installed zone as well as for removal of any zone configuration files.

This command are valid for Sun Solaris 10.x,11.x,12.x version.

➤ Command for creating a Solaris zone:

Please find the below commands to creating a zone on Sun Solaris server. The command must be run on Global zone with root user.

!-[solaris]# zonecfg -z <zone>

Example: !-[solaris]# zonecfg -z sunz01

Once you run the above command, you can enter in the configuration file, where you can add or edit the configuration for the zone.

Command for deleting a Solaris zone:

Please find the below command to deleting a Solaris zone from Global zone.

!-[solaris]# zonecfg -z <zone> delete -F

Example: !-[solaris]# zonecfg -z sunz01 delete -F

using above command you can delete or remove the configuration file of solaris local zone.

Note: You need to shutdown and uninstall the local zone before deleting the configuration files of Sun Solaris local zone.

Command for display zone current configuration:

Please find the below command to display the current configuration of local Solaris zones.

!-[solaris]# zonecfg -z <zone> info

Example: !-[solaris]#zonecfg -z sunz01 info

This command output show you the zonename, zonepath, autoboot etc attributes information of the solaris zone.

Command for zone creation file:

Please find the below command to create a solaris zone creation file.

!-[solaris]#zonecfg -z <zone> export

Example: !-[solaris]#zonecfg -z sun01 export

Once the creation file has been export you can use this file to another zone creation as well as for restoration of this local zone if any problem occur on this zone.

No comments:

Post a Comment