0% found this document useful (0 votes)
137 views6 pages

Make Sys Image

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 6

make_sys_image(1M)

make_sys_image(1M)

NAME
make_sys_image - create compressed le archive of a running system
SYNOPSIS

/opt/ignite/data/scripts/make_sys_image -s IP | hostname | local


[ -d directory | device ] [ -f le ] [ -l 1 | 2 ] [ -n lename ] [ -r remsh_user ] [ -m c | t | p] [ -c
z | g | n ] [ -a archive_size ] [ -R ] [ -g le_list ] [ -t y|n|o|p] [ -p ] [ -u ] [ -v ] [ -w
log_le ] [ -x ] [ -L ] [ -? ]
DESCRIPTION

make_sys_image is used to create a system archive of a running single-user or multi-user system.


This archive may be in cpio, pax, or tar format, and may be compressed with either compress or
gzip. make_sys_image may be called as a post_config_script by Ignite-UX as part of the
installation process, or invoked at the command line on a running system. The archive may be written to
a le, a tape, or a raw disk device on a remote or the local system. If the archive destination is a remote
system, that system must have a .rhosts entry for the local system, or an NFS mount available. The
options for this command may be a combination of command line arguments and environment variables
passed in with the Ignite-UX conguration le via the env_vars keyword.
The archives created by make_sys_image are designed for use with Ignite-UX as part of an archivebased ignition process. Before the archive is used for installing systems, the le system impacts of the
archive must be obtained. See archive_impact (1M). make_sys_image does not capture le system or
disk layout information. Use save_config to capture this information. For details on integrating the
script into the GUI, see manage_index (1M) for /var/opt/ignite/data/INDEX. For details on
using the script non-interactively, see instl_adm (4) for information on the post_config_script and
env_vars keywords.
Options
The make_sys_image command recognizes the following options:

-s

IP|hostname|local
IP address or resolvable hostname of the server to send the archive to or local if the
destination is a local le system, NFS mount, disk or tape. If the destination is not
local, permission to remotely access the server is required. If a hostname is used in
this case, it must be resolvable through whatever means the name service switch is
set to use (see switch (4) for more information).

-d directory |device
Destination directory (for example, /var/tmp/foo) or device le name (for example,
/dev/rmt/0m). The default is /var/tmp/.
Note: Archives written to tape or raw disk cannot be used directly; they must rst
be extracted using dd onto a le system where they may be accessed by an IgniteUX server. To use a directory that is an NFS mount point on the local system, use
-s local to specify the server destination.

-f file

File contains a user-dened list of les to be reset to the newconfig state or


ignored altogether. This list may be in addition to the default level 2 behaviors, or
it may replace the default level 2 reset and/or ignore behaviors.
The le may have one or two sections headed by the keywords RESET or
NO_ARCHIVE. Following each keyword are the paths of les or directories (one per
line), or regular expressions that describe the les or directories. Each keyword
may be combined with the ONLY keyword. If the ONLY keyword is used, the les
in that section replace the default level 2 behavior. The keyword lines must begin
with a +, and each keyword (except ONLY) must occur only once in the le. The
keywords are case sensitive and must be in all uppercase letters. This option overrides the -l option and sets the level to 2.

-l 1 | 2

Level of system identity clean-up:

1 None (overridden to 2 if the -f option is used).


2 Reset network and login information. Exclude device les, log les, and contents
of /stand except /stand/system and /stand/kernrel. Remove
hardware specic drivers from the /stand/system that gets archived. Files
reset to newconfig state:
HP-UX 11i Version 3: March 2012

Hewlett-Packard Company

make_sys_image(1M)

make_sys_image(1M)

/.profile
/etc/rc.config.d/hpetherconf
/etc/rc.config.d/hpfcgsc_lanconf
/etc/rc.config.d/hpfcmsconf
/etc/rc.config.d/netconf
/etc/rc.config.d/netdaemons
/etc/rc.config.d/namesvrs
/etc/rc.config.d/mailservs
/etc/rc.config.d/xfs
/etc/hosts
/etc/mail/sendmail.cw
/etc/ntp.conf
/etc/vue/config
/var/adm/sw/security
The default level is 2. If any of the above is a directory, then all les below that
directory will be reset. However permissions will be preserved as to what the original le had in those cases where the original le permissions differ from the
newcong version.

-n filename

The lename of the archive le other than the default host name. If the -d option
is a device le, the -n option is ignored.

Note: When the -n option is used, a .Z or .gz is not automatically appended to


the le name; it must be added manually.
-r remsh_user remsh user name. This is the user name used for remsh commands. If this option
is omitted, the current user name is used.

-m c | t | p
-c z | g | n

Archive method: c for cpio, p for pax, and t for tar.


Compression method:
gzip is the default.

tar is the default.

z for compress, g for gzip, or n for no compression.

-a archive_size
The calculated size required for the archive may be passed to this command. The
archive size must be a decimal number. The archive size is usually created by running the /opt/ignite/lbin/list_expander -s command. This will save
one call to list_expander during make_sys_images execution.

-R

Run make_sys_image in recovery mode. This will set the level of clean up to 1, overriding the -l option value. This option is required if using the -g option.

-g file_list

The indicated le contains a list of les to be archived. This list should be generated by a call to the list_expander command. The le may either contain
the name of the le or directory only, or it may contain an entire line of information
in the form of: [<fl_name_len>] <file_name> [<mode> <last-mod>
<bytes> <blocks> [<cksum>]]. The -R option must precede the -g option.

-t y|n|o|p

Test for the existence of a needed pax patch.

y Yes, run the tests along with make_sys_image (this is the default).
n No, do not run the tests. This may be used on clients that the user knows contain the patch.

o Run the tests only; that is, do not make a system image. It always exits and
returns a 4 if a patch exists that xes a pax defect; a 3 if it is an enablement
patch (for example PAX-Enh on B.11.23); a 1 if the requested format is not
allowed on this system and a 0 if there are no pax patch(es) that the system
requires or could use.

p Run the tests only; prompt for cancel if a pax patch is required or could be
applied to the system. It always exits after the prompt, and returns the same
values as the o option exception if the patch(es) listed are non-enablement
patches it will return a 3 if the user answered [yY] to cancel.

-p

Preview mode; performs all of the checks and creates the command line, but does
not modify any les other than the make_sys_image.log.

Hewlett-Packard Company

HP-UX 11i Version 3: March 2012

make_sys_image(1M)

make_sys_image(1M)

-u

Check the archive destination for sufcient storage capacity. The capacity of raw
devices is not easily checked, so this option has no effect in the case where a raw
device is the archive destination. The archive size is an approximation and is generally 5% larger than the nal archive. The default is to not check capacity.

-v

Verbose mode; writes all of the les that are being modied or removed and the
command line that will create the system archive to stdout.

-w log_file

Write to the specied log le.

-x

Print the list of les that will be set to the newconfig state and the les that will
2
to
both
be
explicitly
excluded
using
level
stdout
and
/tmp/excluded_files. This doesnt include les excluded because they are
sockets, named pipes, the local archive destination or on remote le systems. If the
-f option is used, the output will reect the effects of that le. With this option
selected, no archiving action is taken.

-L

Create a copy of any non-standard LIF les (as dened for both whole and LVM
disks) found on the boot disk. The boot disk that is used is taken from the rst
non-commented line in the /stand/bootconf le. The LIF volume for storing
these LIF les is /usr/lib/ignite_bootlif, and is created only if nonstandard LIF les are present. This option creates only the backup le. Without
this option, the backup, if needed, is created and the recovery media is created with
this information stored for later recovery. For more information on the disks, LIF
les, and LIF volume creation, see bootconf (4), lif (4), mkboot (1M), and linit (1).
The main purpose of this option is to allow LIF diagnostics and any changes to the
AUTO LIF le to be saved by the Ignite-UX recovery commands (see
make_net_recovery(1M)).

-?

Display the help screen.

NOTE: If all of the defaults are used, a gzip compressed tar archive of the system with all of the host
and network information removed will be placed on the Ignite-UX server in /var/tmp/myhost.gz.
Environment Variables
Environment variables are to be on separate lines following the env_vars+= keyword in the Ignite-UX
conguration le, *INSTALLFS.

SERVER=IP|local

Equivalent to the -s option.

DEST_DIR=directory|device

Equivalent to the -d option.

ARCHIVE_NAME=archive_filename
Equivalent to the -n option.

METHOD=c|t

Equivalent to the -m option.

COMPRESS=z|g

Equivalent to the -c option.

CLEAN_LEVEL=1|2

Equivalent to the -l option.

International Code Set Support


Ignite-UX uses a variety of system commands to accomplish its functionality. Because the output of many
of these commands is parsed, Ignite-UX ensures that the POSIX locale is normally used by modifying
environment variables. Help text and some command output not parsed by Ignite-UX will be left in the
users specied locale.
EXAMPLES
Use all of the built-in defaults, and create a gzip compressed tar archive named hostname.gz on the
Ignite-UX server in directory /var/tmp with all identity information removed. This assumes the server
has a .rhosts entry for the local system:

post_config_script+="make_sys_image"
Create a gzip compressed tar archive with all of the identity information intact and dd to local tape:

post_config_script+="make_sys_image -s local -l 1 -d /dev/rmt/0m"


Extract into /var/tmp a gzipd tar archive from tape:

HP-UX 11i Version 3: March 2012

Hewlett-Packard Company

make_sys_image(1M)

make_sys_image(1M)

cd /var/tmp
dd ibs=10k if=/dev/rmt/0m of=archive.gz
Note: Replace 10k with 5k for cpio archives. Replace .gz with .Z for compressd archives.
Create a local archive resetting /etc/motd and /etc/issue to newconfig state along with the
level 2 default resets and ignore only the directory /data_area and les or directories beginning with "n"
or "a" in /opt/apps.
Copy /opt/ignite/data/scripts/make_sys_image from an Ignite-UX server to /tmp on the
archive system:

/tmp/make_sys_image -s local -d /var/tmp -f /tmp/specic_les


Contents of /tmp/specic_les :
# Files to be reset to newconfig state
# in addition to the defaults. Note use of upper case.
+ RESET
/etc/motd
/etc/issue
# Files to be excluded from the archive,
# override the defaults. Note use of upper case.
+ ONLY NO_ARCHIVE
/data_area
/opt/apps/[na]*
Generate a list of les that will be reset or ignored including those specied in /tmp/specic_les :

/tmp/make_sys_image -s local -x -f /tmp/specic_les

Create a compress compressed cpio archive to a remote system other than the Ignite-UX server, and
remove the host identity and general network information:

post_config_script+="make_sys_image -s 15.15.15.99 -l 2 -c z -m c"


Create an Ignite-UX conguration le that species a cpio archive and compress it to the Ignite-UX
server, default destination directory, and default le name:
# instl_adm defaults:
server="15.1.50.74"
netmask[]="0xfffff800"
route_gateway[0]="15.1.48.1"
route_destination[0]="default"
# end instl_adm defaults.
env_vars+="INST_ALLOW_WARNINGS=1
METHOD=c
COMPRESS=z"
kbdlang="PS2_DIN_US_English"
WARNINGS
Because of the impact make_sys_image can have on a system when running at level 2, it is recommended that no applications be running and no normal users be logged onto the system while it is being
archived. If you do not stop all applications while make_sys_image is running at level 2, the system
may experience application outages because of the conguration changes made temporarily to the system.
You should consider rebooting the system after running make_sys_image at level 2 in case the
conguration changes have impacted any software you did not halt during the archival process.
If /etc/hosts is being used for hostname resolution, then the -s argument cannot be a hostname. It
must be an IP address in this case.
On B.11.31, make_sys_image will not proceed with the archive creation if the legacy device support
has been disabled on the system. To create the archive, enable the legacy device support using the command insf -L.

Hewlett-Packard Company

HP-UX 11i Version 3: March 2012

make_sys_image(1M)

make_sys_image(1M)

SEE ALSO
compress(1), cpio(1), dd(1), gzip(1), pax(1), rcp(1), tar(1), archive_impact(1M), instl_adm(1M),
make_cong(1M), make_medialif(1M), manage_index(1M), save_cong(1M), instl_adm(4), .rhosts(4),
ignite(5), nfs(7).

HP-UX 11i Version 3: March 2012

Hewlett-Packard Company

(Notes)

(Notes)

Hewlett-Packard Company

HP-UX 11i Version 3: March 2012

You might also like