sysmgr — tool for Kernun installation, upgrade, backup, and restore
sysmgr
[-b
] applycfg
partition
sysmgr
[-b
] backup
[partition
]
sysmgr
[-b
] backups
sysmgr
[-b
] checkcfg
sysmgr
[-b
] delimg
buildnum
sysmgr
[-b
] images
sysmgr
[-b
] install
[-n
] partition
buildnum
sysmgr
[-b
] resolve
sysmgr
[-b
] restore
partition
backup
sysmgr
[-b
] upgrade
partition
backup
sysmgr
[-b
] upgradecfg
[partition
]
Program sysmgr is a command line tool for
installing, upgrading, backing up, and restoring Kernun. It must be run
from a running Kernun with standard disk partitioning (one disk containing
three system partitions and a data partition on the same or another
disk). Operation of the program is controlled by a command specified as
the first argument after the optional -b
.
applycfg
)Generates and applies the configuration in a selected partition. Detects the system section used in the currently running system in order to select the system to apply in the target partition. This command is usually used during Kernun upgrade process.
backup
)Creates a backup of a selected partition and stores it
in /data/backup
. The backup file name
contains the build number of the backed up installation, the
system partition number, and the date and time of backup
creation. The backup file contains all modifications (file
creations, deletions, and changes) since Kernun was last
installed on the selected partition. If a partition is not
specified, the partition containing the currently running
system is backed up.
A backup contains only selected files from a single
system partition. The list of files to back up is in file
/etc/kernun-fsdb-include
. Other
partitions, especially /data
, should be
backed up separately according to the local policy, for
example, a daily backup of logs executed by
cron.
checkcfg
)Checks that the configuration is valid. If the configuration is successfully loaded, it will be saved. Loading and saving normalizes the configuration, that is, it fixes parts of configuration that, although syntactically correct, could confuse the configuration upgrade process during a system upgrade.
delimg
)Deletes all installation images in
/data/dist
that have older build
numbers than the build number specified by parameter
buildnum
.
images
)Lists all installation images in
/data/dist
. Images that can be installed
are marked by '*
'.
install
)Installs Kernun. Parameters are number of a target system
partition and build number of the image to install. The image
must exist in /data/dist
and must be
installable (marked by '*
' in the output
of command images
). An installable image is
either a full image, or a patch image with an installable base
image.
The target partition must be different from the
partition that contains the currently running system. Booting
from the target partition is enabled. The partition is made
the default choice in the boot manager unless option
-n
is set. Label of the partition
is changed to a standard label containing Kernun version, date
and time of installation, and the build number.
resolve
)Resolves restore conflicts according to file
/data/restore/resolve
. When restoring
a backup on a Kernun build different from the one used for
creating the backup, conflicts may occur. A conflict is a file
that was changed in two ways: first between the builds used for
creating and restoring the backup, and second after
installation and before creating the backup. Conflicting files
from the backups are not restored to the main file system, but
are stored in respective places in the directory tree rooted
at /data/restore/conflicts
. List of
conflicts is saved in
/data/restore/resolve
.
Before running sysmgr resolve
,
the list of conflicts should be edited. The first character on
each line defines what to do with the file named on that line.
Possibilities are:
'+
' — uses the file
from the backup
'-
' — deletes the
file
'.
' — keeps the
existing file
'!
' — retains the
conflict and postpones it to the next iteration of conflict
resolution
restore
)Restores data from a backup. Each backup should be restored to a newly installed Kernun with the same build number as was used for creating the backup. This build number is a part of the backup file name. Trying to unpack a backup on a different build fails in batch mode and asks for confirmation in interactive mode.
upgrade
)This is similar to restore
, but but
build number identity is not checked. Command
upgrade
is usually used during upgrading to
a new version of Kernun. The standard upgrade procedure is
backing up the current installation (backup
),
installing the new version to a free partition
(install
), restoring the backup to the new
installation (upgrade
), resolving eventual
conflicts (resolve
), converting configuration
for the new version (upgradecfg
), applying
the converted configuration (applycfg
), and
reboot
to the new installation.
upgradecfg
)This command is usually invoked after upgrading to a new version of Kernun. It tries to convert an old Kernun configuration file to a valid configuration of the currently installed version. After conversion, the administrator should review the modified configuration file and then apply the configuration. If a partition is not specified, the configuration file in the partition containing the currently running system is upgraded.
cancel
)Cancels any previous install
command. That
is, a new system image will not be installed after reboot to the
service system.
commitcfg
)Reconfiguring a Kernun Branch Access stores configuration changes only to ramdisk. In order to retain the changes after reboot, they must be stored into persistent storage. It is done by this command.
install
)After the next reboot to the service system, the main system will be reinstalled. There is a factory-preloaded installation image for this purpose. It can be replaced (for system upgrade) by command sysmgr saveimg.
loadcfg
)Outputs the configuration archive from persistent storage to
the standard output. The archive file is in the
tbz
format. Output of this command can be
stored as the backup of the complete system configuration.
There are two copies of configuration. They should be always identical. For the rare cases when they are different (after a system failure during committing the configuration), it is possible to select which copy to use (default is 1).
-b
If set, the command runs in the batch mode. No user interaction is done. If the command would asked the user for confirmation in the interactive mode, it terminates instead in the batch mode. This option is intended primarily for calling sysmgr from other programs (GUI) that handle user interaction themselves.
partition
Number of a system partition, must be 1, 2, or 3.
buildnum
A Kernun build number.
backup
A name of a backup file. If a name without path is
specified, the file is searched in directory
/data/backup
.
/1 /2 /3
Directories used to mount system partitions other than the partition containing the currently running system.
/data
Mount point for the data partition
/data/backup
Directory for storing backups.
/data/dist
Directory for storing installation images
/data/log
Directory for storing log files
/data/restore
Directory for restoring data from backups and solving conflicts
/data/restore/conflicts
Directory containing onflicting files unpacked from a backup
/data/restore/resolve
List of conflicts and instructions how to resolve them
/etc/kernun-fsdb-include
List of files contained in backups