One of the more common tasks of a system administrator is helping users recover lost or corrupted files. To perform that task effectively, you must set up procedures for backing up files at frequent and regular intervals. This chapter describes how you use resident commands and utilities to back up (archive) and restore files and directories.
You should design and implement a disaster recovery plan that describes how you intend to restore your entire operating system and user files to normal operations in the event of a catastrophic failure. This chapter does not describe the disaster recovery process, as it is often very specific to site operations and business requirements. However, backup operations are an important component of such a plan.
The following topics are included in this chapter:
Section 9.1 is an overview of the steps and options involved in creating a backup.
Section 9.2 describes the main tasks involved in creating a backup.
Section 9.3 describes how you set up a backup schedule.
Section 9.4 describes the methods of creating a backup.
Section 9.5 provides information that enables you to prepare for a backup, such as references to other documents that you may need to read, system files created, related utilities and prerequisite tasks.
Section 9.6
describes the use of the
dump
command to perform a backup.
Section 9.7
describes the use of the
restore
command to recover data from a backup.
Section 9.8 describes the use of commands that enable you to archive individual files and directories, rather than complete file systems.
Section 9.9
describes the use of
dxarchiver
, a graphical interface for archiving files and directories.
Section 9.10 describes how you create a bootable tape. This is a bootable backup of the root file system and key system files that may be useful for disaster recovery.
9.1 Understanding Backup Tasks
This chapter describes basic backup operations for a system using the UFS file system. You may also need to use other backup and restore utilities if any of the following conditions apply to your local system:
If you are using the Advanced File System (AdvFS) file system exclusively, or if you are using AdvFS domains on some of the disks attached to your system, you should refer to the AdvFS Administration guide. Using the AdvFS file system provides you with more backup features, such as the ability to clone domains. One of the disadvantages of the UFS file system is that you must prevent access to a UFS file system while it is being backed up. If a file is accessed while a backup is in process, the backup may not be able to record any changes in the file. To ensure a completely accurate back up of a UFS file system, you may need to take a disk off-line or shut the system down to single-user mode. If you are unable to schedule system shut downs, consider using the AdvFS file system.
If you are using the Logical Storage Manager (LSM) , you should refer to the Logical Storage Manager guide. Using features of LSM such as mirroring volumes, you might also be able to overcome some of the backup limitations of UFS. For example, you can take an instant, accurate snapshot of a UFS file system by mirroring the file system on a different disk. You can then break the mirror at any time to create an archive, with only a brief pause in system operations. (Note that using LSM requires spare disk capacity and may be unsuitable for small systems with few disks.)
If you want to back up and restore a root volume to a different system, consider using configuration cloning. This feature is described in the Installation Guide -- Advanced Topics. Configuration cloning enables you to recreate a customized operating system on another processor in the event of a disaster, or simply to recreate an environment on one or more systems.
This chapter describes only those backup and archiving utilities that are included in the base operating system when installed.
There are backup applications included on the Associated Products CD-ROM or supplied by third-party vendors. Refer to the Installation Guide for information on applications that might be included on the Associated Products CD-ROM. Refer to the documentation that comes with your backup application for information on using third-party products.
The main tasks comprising backup and restore operations are:
Creating your data recovery and disaster recovery plans
Backing up data
Choosing a backup schedule
Creating small archives with
pax
,
tar,
and
cpio
or the associated graphical user
interface,
dxarchiver
Performing a full UFS backup using the
dump
utility
Performing an incremental backup
Performing a remote backup
Using backup tools
Restoring data
Restoring files from small archives
Restoring a file system from a dump
Restoring a dumped file system on a new partition
Restoring files
Restoring files interactively
Performing remote restorations
Restoring standalone systems from bootable tape
9.2 Backing Up Data and System Files
For basic backup, the same type of
dump
utility
and
restore
utility operations are supported as on as most
other UNIX variants.
See the
dump
(8)
reference page for full details of
all command options that are supported.
Graphical and command-line tools for
archiving and for creating a bootable tape of the standalone system (SAS)
are also provided.
Prevention of data loss is an important part of any backup and recovery strategy. There are many tools for system monitoring that can be configured to help prevent situations that can result in data loss. For example, some systems support environmental monitoring, and there are tools to test and exercise peripherals. There are also the event and error logging systems that can be configured to monitor the system for specific high-priority events and report them to the administrator. See Chapter 13 for information on using EVM (event management) for information setting up the event-reporting strategy for your system and site. EVM can also be used to report on the success of your backups, ensuring that you do not miss a scheduled backup event.
It is important that all the files on your system, data files as well as system files, be protected from loss. Therefore, you should back up your entire system, including the system software. Most system files are static; that is, once they are installed they do not often change. Therefore, they do not need to be backed up as frequently as data files, which are dynamic, meaning they change constantly. Incremental backups are also possible, and should be considered if data changes significantly in a short period.
Each file system backup is a single process.
To ease the backup process,
organize your file systems so that dynamic files are on file systems that
are backed up regularly and static files are on file systems that are backed
up occasionally.
You may find that you have dynamic files on file systems
that are backed up occasionally.
If this happens and you need to back them
up regularly, just prior to performing a backup, copy the frequently changing
files to systems that are backed up regularly.
This allows you to back up
those files without backing up an entire file system.
You can also write
shell scripts to automate these tasks and use the
cron
utility to automate the schedule.
Refer to the
cron
(8)
reference page
for more information on scheduling tasks.
9.3 Choosing a Backup Schedule
When deciding how often to back up each file system, you should think about the balance between the potential loss of user time and data and the time it takes you to perform backups. Ask yourself the question, "How much information can I afford to lose?" The answer will help you determine your minimum backup interval. On most systems the backup interval is daily, but you can choose any other interval.
It is not necessary to back up all the files in a file system at each
backup.
Back up only those files that have changed since a previous backup;
this is called an incremental backup.
Using the
dump
and
restore
commands, you can perform up to nine levels of incremental
backups.
For example, while a level 0 dump backs up an entire file system,
a level 1 dump backs up only those files since the last level 0 dump, and
a level 7 dump backs up only those files since the last lower level dump.
To integrate incremental backups into your file backup schedule, you need to balance the time and tape space required for backup against the amount of time it could take you to restore the system in the event of a system failure. For example, you could schedule backup levels following the 10-day sequence:
[0 1 2 3 4 5 6 7 8 9
]
On the first day you save an entire file system (level 0). On the second day you save changes since the first backup and so on until the eleventh day when you restart the sequence. This makes the amount of time spent and data saved on each backup relatively small each day except the first; however, if a system failure on the tenth day requires that you restore the entire system, you must restore all ten tapes.
Most systems follow some variant of the common Tower of Hanoi backup schedule. Once a month you make a level 0 dump to tape of all the regularly backed up file systems. Then once a week, you make a level 1 dump to start a daily sequence of:
[...3 2 5 4 7 6 9 8 9 9 ...
]
If you do backups only once a day on the weekdays, you end up with a monthly backup schedule as follows:
[0 1 3 2 5 4 1 3 2 5 4 ...
]
This
schedule, although slightly complex, requires that you restore at most four
tapes at any point in the month if a system failure corrupts files.
Of course,
doing a level 0 dump daily requires that you restore at most one tape at any
point, but requires a large amount of time and tape storage for each backup.
On most days in the Tower of Hanoi schedule, very little time and tape storage
are required for a backup.
9.4 Backup Methods
Depending on your needs and your local system configuration, there are several options for backing up data, as follows:
The following command-line interfaces can be run from a terminal:
dump
,
rdump
,
restore
, and
rrestore
tar
,
pax
, and
cpio
Use these to create quick file archives or to create scripts that you
run with the
cron
scheduler.
The bootable tape utility,
bttape
, is a SysMan
Menu application that can be invoked from the command line, the SysMan
Menu, or from CDE.
Depending on how it is invoked, it will either run the
command-line interface or a graphical interface that is appropriate to the
windowing environment that you are using.
(See
Chapter 1
for more information.) The commands are
btcreate
and
btextract
.
Use the bootable tape utility to create a bootable tape for recovery and to back up critical system data and customized system files. This utility also enables you to use any terminal and a number of windowing environments and is therefore recommended for remote operations.
From the CDE folder Application Manager - System Admin,
open the Storage Management folder and click on the Bootable Tape icon.
This
action invokes the graphical interface to the
bttape
utility.
From CDE, open the Application Manager pop-up menu from the front panel and open the Desktop_Tools folder to use the following utilities:
Archive - for quick archiving of files and folders, such as when archiving projects or user accounts. The related interfaces, Archive List Contents and Archive Unpack, enable you to manage these archives. These are simple graphical interfaces with minimal options.
From the CDE Application Manager - System Admin folder, open the DailyAdmin folder to use the Archiver utility. The Archiver is a graphical interface to the command-line tools that enables you to select archive type and options such as compression. This interface allows you to drag and drop entire file systems or directories (folders) into the backup set.
Note that some tools provide you with additional options when
you run them as superuser (root).
9.5 Preparing to Perform a Backup
This section contains information that you may need to prepare for a backup. Also included is a list of utilities that can assist you in preparing for a backup, and a list of prerequisite tasks that should be performed.
Chapter 6
contains information on the UFS file
system.
Chapter 5
contains information on using disk and
tape devices and on determining which disk and tape devices you want to back
up.
Also, refer to the information about the
cron
utility
in
Chapter 3
for information on scheduling regular
backups.
The following documentation contains other information that you may
need to perform a backup:
Books
The AdvFS Administration and Logical Storage Manager guides contain information on the AdvFS file system and LSM storage management features.
The owner's manual for any peripherals used (such as tape drives) contain important information. These documents will provide you with information on storage volume, media type, compression densities, and general operating instructions for a device.
Reference pages
The
dump
(8),
rdump
(8),
vdump
(8), and the associated
restore
(8)
and
rrestore
(8)
reference
pages provide information on the basic utilities for dumping file systems
to tape and restoring them back to disk.
The
tar
(1),
pax
(1), and
cpio
(1)
reference pages provide information on basic utilities for
creating and manipulating archive files.
The
btcreate
(8),
btextract
(8), and
bttape
(8)
reference pages provide information on the bootable tape interfaces.
The
cron
(8)
and
crontab
(1)
reference pages provide information on creating
cron
entries for backup scripts that execute at specific dates and
times.
The
mcutil
(1)
reference page describes the media changer manipulation utility.
Both the Archiver and Bootable Tape graphical user interfaces provide online help that describes the different options available to the user, and defines what data can be entered into the data fields in each window.
Apart from the file system that you specify and the archive files created, the following files are used or created when you create backups:
The
dump
and
restore
commands
create or use the following files:
/etc/dumpdates
- Contains a list
of file systems that were backed up, the date that each file system was backed
up, and the backup level
/tmp/rstdir*
- Lists directories
stored on the default tape
/tmp/rstmode*
- Records the owner,
permission mode, and timestamps for stored directories
./restoresymtab
- Holds information
required during incremental restore or
rrestore
operations
The Bootable Tape utility creates or uses the following files:
/var/adm/btcreate.log
- Provides
a log of the
btcreate
process
/usr/lib/sabt/sbin/custom_install.sh
-
Specifies which files are added to the miniroot
/usr/lib/sabt/etc/addlist
- A data
file that specifies which files and directories are added to the miniroot
file system that will be created on the bootable tape
/usr/lib/sabt/etc/fslist
-- A data
file that specifies which file systems are backed up
The following utilities are useful when performing backups:
The SysMan Station provides a graphical view of the storage devices available on the system. Use this interface to help you identify disk and tape devices and find their device names.
The CDE Application Manager -- Desktop_Tools folder provides
a Disk Usage tool that runs the
du
command and returns
statistics on disk usage.
Use the Folder Size utility to check the size (in
blocks) of any directory, such as
/usr/users
.
Command-line
utilities
du
and
df
provide the same
data.
The CDE Application Manager -- DailyAdmin folder provides the System Information interfaces, a graphical view of system resources such as file space usage. You can set this monitor to flash a visual warning when your preset file space limits are exceeded. You can also use the SysMan Station to monitor file systems as described in Chapter 1.
The Event Manager (EVM) provides a way of monitoring file system limits and will alert you of problems or can automatically start backups and cleanup of file systems.
The command line interfaces
dsfmgr
and
hwmgr
enable you to query the system for information about devices,
such as device names and disk partition size.
You can also get information from the
diskconfig
tool, which has both command-line and graphical interfaces.
This tool can
be invoked from CDE Application Manager - Configuration folder, or from
the SysMan Menu.
This interface provides size information in megabytes,
bytes, and blocks.
The following prerequisite tasks apply to all the backup methods:
Be familiar with the general principles of the interfaces.
Ensure that all the required products or utilities are installed and configured (if necessary). The simplest way to do this is to refer to the reference page for information on invoking the tool, and run a test by invoking command-line interfaces with null input, or by starting up the graphical user interfaces.
Verify that the tape hardware is installed and configured.
If you are unsure, you can use the
/usr/field/tapex
tape
exerciser and refer to the hardware documentation for other test features.
See also the hardware information tools listed in
Section 9.5.2
Check the size of the directories that will be backed up. For example, you can use the following commands:
#
df /usr
Filesystem 512-blocks Used Available Capacity Mounted on /devices/disk/dsk0g 1498886 688192 660804 52% /usr
#
du -s -x /usr/users
1835 /usr/users
You can also use the graphical or command-line tools listed in Section 9.5.2.
Obtain sufficient quantities of the correct media, ensuring that there is enough storage volume for the files that you intend to back up. This also applies if archiving to disk or any other writeable media, such as WORM drives or magneto-optical floppy drives.
Identify the files or directories that you intend to work with, and choose appropriate names for the archives. You may need some temporary scratch disk space if assembling different directories into a single volume before archiving (although this can often be done direct to the archive from the command line or by adding directories to existing archives). Refer to the documentation for the backup utility that you choose to use. Some tools provide default file names and locations. For example, the bootable tape interface will prompt you for the following file names. (You can accept the default or provide another file name):
/usr/lib/sabt/etc/fslist
- A data
file that specifies which files and directories are added (appended) to the
miniroot
/usr/lib/sabt/etc/addlist
- A data
file that specifies which file systems are backed up
The Archiver requires the following files:
One or more source files or directories.
Note that in CDE,
directories are identified as folders, and you can drag and drop them into
the Archiver window from File View windows instead of typing long pathnames
such as
/usr/lib/sabt/sbin
.
A destination file, such as
/usr/backups
for a tar file on disk, or the device name for a tape device, such as
/dev/tape/tape0_d0
.
(Note that you do not need to supply an extension
or suffix for the archive file name.
The utilities listed in
Section 9.5.2
can assist you in finding the required device information, particularly if
more than one tape drive is attached to a system.)
If you are restoring (unpacking) an archive, you need to supply
the archive name, such as
/usr/archives/userfiles_990802.Z
or
/dev/tape/tape0_d0
, for a tape archive.
The device name for the device or devices that you want to access, and any associated device special file. For example, the following are valid device names and device special files
Device name | Device Special File | Description |
dsk0a |
/dev/disk/dsk0a |
Partition a of disk number 0 |
disk1b |
/dev/rdisk/dsk1b |
Partition b of raw disk 1 |
tape0c |
/dev/tape/tape0c |
Default density rewind tape (with compression) |
tape0_d0 |
/dev/ntape/tape0_d0 |
Nonrewind tape device 0. The _d0 suffix specifies the density |
Device names are located in the
/dev
directory under
/disk
,
/rdisk
,
/tape
, or
/ntape
subdirectories.
You can also use the graphical or command-line
tools listed in
Section 9.5.2
to locate devices and match
them with their device names.
Note
Tape devices often support different densities and compression options that enable you to put more information into a single archive. Refer to the
tz
(7) reference page for information on tape density options, and how you select them by specifying different device names.
Full backups may require that you shut down the system.
You
can back up the system while in either multiuser mode or single-user mode.
However, backups performed on file systems actively being modified might
corrupt the backup data.
The
dump
command operates by
checking the inodes of the files you want to back up.
The inodes contain
data such as table entries and other statistics.
When you use the
dump
command to back up files in a file system, an inode is attached
to each file.
If the system or user activity changes a file after the inode
data is recorded, but before the file is backed up, the backup may be corrupted.
To shut down the system, unmount a file system, and check the integrity of a file system:
Shut down the system using the SysMan Menu General Tasks option,
or with the
/usr/sbin/shutdown
command.
For example, to
shut down the system in 5 minutes and give users periodic warning messages,
enter:
#
/usr/sbin/shutdown +5 'System going down to perform backups'
Refer to Chapter 2 for more information on shutting down the system.
Use the
umount
command with the
-a
option to unmount the file systems that you want to back
up:
#
/sbin/umount -a
Note that the root file system remains mounted.
Use the
fsck
command to ensure the integrity
of the file system.
For example, to check a file system for an RZ57, unit 0, partition
c
, enter:
#
/sbin/fsck -o /dev/disk/dsk0c
The
dump
command copies all designated file systems
or individual files and directories changed after a specified date to a file,
pipe, magnetic tape, disk, or diskette.
Refer to
AdvFS Administration
for information
on copying AdvFS file systems.
You must have superuser privileges to use the
dump
command.
Note
To produce valid backups on a file system, you must back up a file system while it is inactive. It is recommended that you unmount the file system and check it for consistency. As an added precaution, put the system into single-user mode before starting your backup operations. This is not true for AdvFS.
9.6.1 Performing a Full Backup
You
should set up a schedule for performing a full backup of each file system
on your entire system, including all the system software.
A conservative
schedule for full system backups is to do one with each normal level 0 dump
(using Tower of Hanoi, once a month), but you can set any schedule you like
within the reliability of your storage media, which is about two years for
magnetic tapes.
To back up your file system, use the
dump
command, which has the following command syntax:
dump
options
filesystem
The
options
parameter specifies
a list of flags and their arguments and the
filesystem
parameter specifies the file system to be backed up.
You should specify the
file system with a full pathname.
The
dump
command can
back up only a single file system at a time, but there may be several
dump
processes simultaneously writing files to different tape devices.
The
dump
(8)
reference page describes the command options that you use
to specify the characteristics of the tape device, such as block size, tape
storage density, and tape length.
The following list describes the most commonly
used options to the
dump
command:
-integer
Specifies the dump level as an integer (0-9).
A dump level
of 0 causes a full dump of the specified file system.
All other dump levels
cause an incremental backup.
That is, only files that have changed since
the last dump of a lower dump level are backed up.
The
/etc/dumpdates
file contains a record of when the
dump
command
was used on each file system at each dump level.
The
-u
option to the
dump
command updates the
dumpdates
file.
-f
dump_file
Writes the dump to the device specified by
dump_file
instead of to the default device,
/dev/tape/tape0_d0
.
When
dump_file
is specified as a dash
( -
), the
dump
command
writes to the standard output.
-u
Updates the
/etc/dumpdates
file with the time of the dump and the dump level
for the file system in the backup.
You use this file during incremental dumps
(by using the dump level option) to determine which files have changed since
a particular dump level.
You can edit the
/etc/dumpdates
file to change any record or fields, if necessary.
The
dump
(8)
reference page
describes the format of this file.
To back up your entire file system to the default backup device, use
the
dump
command for each file system on your machine.
The
dump
command has the following command syntax:
dump
-0u
filesystem
The
filesystem
parameter specifies
the name of a file system on your machine.
The
-0u
option causes a level 0 dump and updates the
/etc/dumpdates
file with the time and date of the backup for each file system.
This creates
an initial point on which to base all future incremental backups until the
next full or level 0 dump.
Note that each file system must be backed up individually.
For example, if you want to perform a level 0 dump of the root,
/usr
, and
/projects
file system partitions, follow
these steps:
To back up the root file system, load a tape into your tape drive and enter:
#
dump -0u /
After completing the backup, remove the tape from your tape drive.
To back up the
/usr
file system, load a
new tape into your tape drive and enter:
#
dump -0u /usr
After completing the backup, remove the tape from your tape drive.
To back up the
/projects
file system, load
a new tape into your tape drive and enter:
#
dump -0u /projects
You can either back up each file system on an individual tape,
or you can back up multiple file systems on one tape by specifying the no-rewind
device,
/dev/ntape/tape0_d0
, as the output device.
The
following examples show the root,
/usr
, and
/projects
file systems being backed up on one tape:
#
dump -0uf /dev/ntape/tape0_d0 /
#
dump -0uf /dev/ntape/tape0_d0 /usr
#
dump -0uf /dev/ntape/tape0_d0 /projects
This example may require additional media management
to cross-reference dump files with tapes, especially when a single dump file
spans media.
Exercise care when labeling this type of backup media.
9.6.2 Performing an Incremental Backup
You should set up a routine as part of your backup schedule to make it easier to remember which backup to do each day. This routine should include a mechanism for logging your backups and their dump level and for listing the tapes on which they are made. Because of the chance of system corruption, you should not keep this information on the computer system.
Once you have established a system for making incremental backups, the
procedure is simple.
Assume you use the following backup schedule to do a
daily backup of
/usr
:
0 1 9 9 9 1 9 9 9 9 ...
On Monday, perform a level 0 dump:
#
dump -0u /usr
On Tuesday, perform a level 1 dump:
#
dump -1u /usr
The level 1 dump backs up all the files that changed since Monday. On Wednesday through Friday you perform a level 9 dump (which always backs up all the files that have changed since Tuesday's level 1 dump):
#
dump -9u /usr
To perform the same level 9 dump to the
tape device named
/dev/tape/tape1_d0
instead of the default
tape device, use the
-f
option as shown in the following
example:
#
dump -9uf /dev/tape/tape1_d0 /usr
The argument to the
-f
option specifies a tape device local to the system from
which you are performing the dumps.
9.6.3 Performing a Remote Backup
Some
machines in a networked system environment might lack a local tape drive that
you can use for making backup tapes.
You can use the
rdump
command to make backups on a remotely located tape device.
The
rdump
command is identical to the
dump
command except
that it requires the
-f
option to specify the machine
name and an attached backup device.
The
rdump
command has
the following command syntax:
rdump
-f
machine:device
options
filesystem
The
machine
parameter specifies
the name of the remote machine that has the backup device and
device
specifies the name of the backup device on that remote
machine.
The colon (:
) between the
machine
and
device
parameters is necessary
just as in other network file-addressing mechanisms.
The
options
parameter refers to the same
list of flags available with the
dump
command.
The filesystem parameter refers to the local file system to be backed up.
The
rdump
command updates the
/etc/dumpdates
file on the local machine in the same way as does the
dump
command.
The
rdump
command starts a remote
server,
/usr/sbin/rmt
, on the remote machine to access
the storage medium.
This server process should be transparent.
Refer to
the
rmt
(8)
reference page for more information.
To back up the
/projects
file system from
machine1
onto a tape drive on
machine2
with the
attached backup device
/dev/rmt0h
, enter the following
command from
machine1
.
The name of
machine1
must be in the
/.rhosts
file of
machine2
to allow access from
machine1
to
machine2
.
#
rdump -0uf machine2:/dev/tape/tape0_d0 /projects
The
dump
(8)
reference page describes the options
to the
rdump
command.
9.6.4 Using Backup Scripts
You can automate the backup process by using shell scripts.
The
cron
daemon can execute these shell scripts late in the evening
when there is less chance of the
dump
commands making errors
due to a changing system.
Backup shell scripts often perform the following tasks:
Determine the dump level
Warn the system of the dump
Make a listing of tape contents
Notify the operator upon completion
Some time during the day, load a tape into the tape drive.
At the
specified time, the
cron
daemon runs the backup shell scripts.
When the shell procedures are finished, remove the backup tape and archive
it.
Note that backup shell scripts are best used when the dump is small
enough to fit on a single tape.
You will need to specify the no-rewind device
and the
-N
option to the
dump
command to inhibit the tape from automatically going off line when each dump
is completed.
When
dump
reaches the end of the tape, it
will take the tape off line and someone will need to be available to replace
the tape.
9.7 Restoring Data
Occasionally, you will have to retrieve files from your backup tapes, and you will likely need to restore entire file systems at some time. If you have set up a good backup procedure, then restoring files or full file systems should be a simple task.
If a serious problem occurs, you may have to restore your entire system. Before restoring, determine what caused the problem with the system.
After determining the cause of the problem, reinstall your system from the initial boot tapes. The installation instructions that came with your system explain this procedure.
Once your system is up and running, restore the system to the state
it was in just prior to the system crash.
If you are using AdvFS, use the
vrestore
command.
Refer to
AdvFS Administration
for information on restoring
the AdvFS file system.
If you are using UFS, use the
restore
command to restore data from tapes made with the
dump
command.
Because the
dump
command saves a single file system at
a time, you must execute the
restore
command for each file
system you want to restore.
The
restore
command has the
following command syntax:
restore
options
The
options
parameter indicates the
flags and arguments that you use to specify the characteristics of the tape
device and special restore options.
Refer to the
restore
(8)
reference page
for more information about these options.
The following list describes the
most commonly used options to the
restore
command:
-i
The
i
(interactive) flag starts interactive restoration of files from the tape.
After reading directory information from the tape, this option provides a
shell-like interface that allows you to select the files you want to restore.
The commands available in interactive mode are described in
Section 9.7.3.
-r
The
r
(restore) flag restores the entire contents of the file system on the backup
tape into the current working directory.
You should not do this except to
restore an entire file system into an empty directory or to restore file system
incremental dumps.
-s
The
s
(skip) flag identifies which dump file on the media the
restore
command will use.
This is useful when the dump media contains more than one
dump image and not all of them will be restored.
To effectively use this
option, you must be consistent in the order in which you dump images to the
tape.
For example, if you dump multiple file systems to a single backup tape
nightly, dump the file systems in the same order each night.
This will assist
you in locating a particular file or file system at restore time.
-t
names
The
t
(table of contents) flag creates
a list of files and directories on the tape that matches the
names
argument.
If you specify
names,
the
restore
command returns a list of the files and directories
that are on the tape that matches the specified names.
The
names
argument should be specified as
./filename
.
For example, if the
.rhosts
file and the
staff
directory exist on the tape, the
restore -t ./.rhosts ./staff
command will list the file and the
directory.
If you do not specify
names, the
restore
command returns a complete listing of the backed up files
on the tape.
-x
names
The
x
(extract) flag restores from the
tape the files and directories specified by the
names
argument.
The
names
argument contains a list of
files and directories to be restored from the tape.
Specify
names
as
./filename
.
For
example, the
restore -x ./.rhosts ./staff
command will
restore the
.rhosts
file and the
./staff
directory.
If
names
specifies a directory name,
then all the files in the directory are recursively restored.
-f
dump_file
The
f
flag used with the
dump_file
argument restores the dump from the device specified
by the
dump_file
argument instead of the default
device,
/dev/rmt0h
.
-F
command_file
The
F
flag used with the
command_file
argument specifies a file from which interactive
restore commands are read.
You should use this option in conjunction with
the
-i
option.
If you are restoring a file system other than root or
/usr
, go to
Section 9.7.1.
If you are restoring
the root and
/usr
file systems, go to
Section 9.7.5.
If the
/var
directory is on a separate file system than
/usr
, go to
Section 9.7.5.
9.7.1 Restoring a File System
There may be times when you will need to restore a file system. This section describes a general procedure for restoring a file system. To restore individual files, go to Section 9.7.2.
When you restore a file system, you create a new file system and restore the files from the dump files by using the following command syntax. Refer to the AdvFS Administration guide for information on restoring an AdvFS file system.
newfs
raw_device
mount
block_device
[ filesystem
]
cd
filesystem
restore
-Yrf
dump_file
If the disk does not have a label, write the label
by using the
disklabel
command before you create the new
file system.
Use the following command syntax to determine if the disk has
a label:
disklabel
-r
disk
Writing a label with customized partition table settings may affect the entire disk. Use the following command syntax to write the default disk partition table:
disklabel
-rw
disk disk_type
The
disk
parameter specifies the disk that
includes the device mnemonic and unit number.
The
disk_type
parameter specifies the type of disk associated with the
disk
as described in the
/etc/disktab
file.
Invoke the editing option of the
disklabel
command
to use the customized partition table settings.
Refer to
Chapter 6
or to
disklabel
(8)
for more information.
You can also use the
diskconfig
Disk Configuration interface.
The raw_device parameter specifies the full raw device pathname of the disk device on your system. The block_device parameter specifies the full block device pathname of the disk device on your system. The filesystem parameter specifies the full pathname of the file system you want to make available. The dump_file parameter specifies the full pathname of the file containing the dump data.
The following example shows the commands you use to restore a file system
called
/usr/projects
on an RZ57 disk from a tape:
#
disklabel -rw dsk1 rz57
#
newfs /dev/rdisk/dsk1c
#
mount /dev/rdisk/dsk1c /usr/projects
#
cd /usr/projects
#
restore -Yrf /dev/tape/tape0_d0
When users lose files, they ask their system administrator to restore
those files.
Users may also ask you to restore an earlier version of a file.
Whatever the reason for a file restoration, determine which tape contains
the correct version of the file.
If you are restoring a file on UFS, use
the
restore
command to restore the file.
If you are restoring
a file on AdvFS, refer to the
vrestore
(8)
reference page for information.
By asking when the file was lost and when it was last modified, you
can use your backup log to determine which tape contains the most recent version
of the wanted file.
Use the
-t
option with the
restore
command to determine whether a file is on the selected tape.
Use the following syntax:
restore
-t
./filename
The
-t
option creates a list of files
and directories on the tape that matches the
./filename
argument.
For example, to list the contents of the
working
subdirectory of the
/usr
file system on a particular backup
tape, load the tape and enter:
#
restore -t ./working
To create a list of the entire contents of a backup tape, load the backup tape and enter:
#
restore -t
Make a listing of each backup tape after you create it. This verifies a successful backup and gives you a place to look up what files are on the tape.
After determining the location of the file, create a new directory for
the file.
If you restore the file into an existing directory and the file
already exists, the restored file will overwrite the existing file.
Restore
the file by using the following form of the
restore
command:
restore
-x
./filename
The file will be restored into your current working directory.
For example, to restore the
working/old.file
file
from a
/usr
file system backup tape into your current directory,
load the backup tape and enter:
#
restore -x ./working/old.file
To restore the entire contents of the working subdirectory from the same tape, enter:
#
restore -x ./working
If your dump media contains multiple dump images, you need to know the sequence of the dump images in order to restore a file from one of the images. To examine the contents of the first dump image on the media, load the tape and enter:
#
restore -ts 1
The
-s
option
followed by the number
1
specifies the first dump image.
For example, to restore the
working/old.file
file
from a
/usr
file system, which is the third dump image
on the backup tape into your current directory, load the backup tape and enter:
#
restore -xs 3 ./working/old.file
9.7.3 Restoring Files Interactively
To ease the task of restoring multiple files, use the
-i
option to the
restore
command.
This option
starts an interactive
restore
session.
The interactive
mode has commands similar to shell commands.
To begin an interactive
restore
session, enter:
#
restore -i
The system responds with the following prompt:
restore >
The following command-line options are available in the interactive restore mode:
ls
[
directory
]Lists files in the current or specified directory.
Directory
entries end with a slash (/
).
Entries that have been marked
for reading begin with an asterisk (*
).
cd
[
directory
]Changes the current directory to the directory specified by directory.
pwd
Lists the pathname of the current directory.
add
[
files
]Adds the files in the current directory or the files specified
by
files
to the list of files recovered from the
tape.
Once they are specified to be read by the
add
command,
files are marked with an asterisk (*
) when they are listed
with the
ls
command.
delete
[
files
]Deletes all the files in the current directory or the files specified by files from the list of files recovered from the tape.
extract
Restores from the tape
the files that are marked to be read into the current working directory.
The
extract
command prompts you for the logical volume that you want
to mount (usually 1), and whether the access modes of the dot (.
) current directory are affected; answer
yes
when you are restoring the entire
root
directory.
setmodes
Sets owner, access
modes, and file creation times for all directories that have been added to
the files-to-read list; no files are recovered from the tape.
Use this command
to clean up files after a
restore
command has been prematurely
aborted.
verbose
Toggles verbose mode.
In verbose mode, each file name is printed to the standard output.
By default,
verbose mode is set to off.
This is the same as the
-v
command line option to the
restore
command.
help
Lists a summary of the interactive commands.
?
Lists a summary of the interactive commands.
what
Lists the tape header information.
quit
Quits the interactive restore session.
xit
Exits from the interactive
restore session.
The
xit
command is the same as the
quit
command.
To interactively restore the
./working/file1
and
./working/file2
files from a backup tape, load the
tape and enter:
#
restore -i
Once in interactive mode, follow these steps to add the files to the list of files to be extracted:
Change to the
working
directory:
restore >
cd working
At the prompt, enter the file name as follows:
restore >
add file1
Enter the name of the second file as follows:
restore >
add file2
Extract the files as follows:
restore >
extract
You are prompted for the logical volume you want to mount;
usually you respond to this prompt with
1
as shown in the
following example:
You have not read any tapes yet. Unless you know which volume your file(s) are on you can start with the last volume and work towards the first.Specify next volume #:
1
You are then asked whether the extract affects the access modes of the dot
(.) or current directory.
For this example, reply with
n
.
set owner/mode for '.'? [yn]
n
Once the files are extracted, quit the interactive session as follows:
restore >
quit
The
file1
and
file2
files
are now in the current directory.
You can automate this procedure in a command file that is read by the
-F
option to the
restore
command.
For
example, the following command file, named
restore_file
,
performs the restore operation shown in the previous example:
cd working add file1 add file2 extract 1 n quit
To read and execute this shell script, enter the following command:
#
restore -iF restore_file
The result of the procedure
in this script is identical to that of the previous interactive restore session.
9.7.4 Restoring Files Remotely
There may be times when you need to restore files remotely.
You can
use the
rrestore
command to restore files to local directories
from a remote tape device.
The
rrestore
command requires
the
-f
option to specify the machine name and its
backup device.
The
rrestore
command has the following syntax:
rrestore
-f
machine:device
[options
]
The
machine
argument specifies the
name of the remote machine where the backup device is attached, and
device
specifies the name of the backup device on that remote
machine.
The colon ( :
) between
machine
and
device
is necessary just
as in other network file-addressing mechanisms.
The
options
for the
rrestore
command are the same as for the
restore
command.
See
Section 9.7
for a description of the options.
To restore the
./working/file1
file onto the local
directory on machine1 from a backup tape mounted on machine2 where the backup
device
/dev/rmt0h
is attached, enter the following command
from machine1.
The name machine1 must be in the
/.rhosts
file of machine2 to allow access from machine1 to machine2.
#
rrestore -xf machine2:/dev/tape/tape0_d0 ./working/file1
The
rrestore
command starts a remote
server,
/usr/sbin/rmt
, on the remote machine to access
the storage medium.
This process should be transparent.
Refer to the
rmt
(8)
reference page for more information.
See
Section 9.7
for
a description of the options to the
rrestore
command.
9.7.5 Restoring root and /usr File Systems
The root file system must be restored before
you can restore the
/usr
file system.
If the
/var
directory is on a file system other than
/usr
,
repeat the steps in this section for restoring
/var
.
The procedure in this section requires that you have access to the most
recent dump files of your root and
/usr
file systems.
You should use this procedure only when a catastrophic error occurs on the
system disk, such as a disk crash or when an inadvertent deletion of either
the root or
/usr
file systems renders the system inoperative.
The following steps show how you restore from a level 0 dump of files, using the text-based (or character cell) interface to perform the task:
Load the installation software.
For removable media such as
tape or CD-ROM, insert the media into the appropriate drive.
For RIS
installations, verify that the inoperative system has been registered on the
RIS server.
See
Sharing Software on a Local Area Network
for details.
If the dump file is located
on a remote system, include the host name of the inoperative system in the
/.rhosts
file of the remote system.
For security reasons, be sure
to delete the host name from the
/.rhosts
file after the
restore operation is complete.
Boot the operating system as described for your processor
and distribution media in the
Installation Guide.
If your system had a graphical
interface, the
Installation Setup
screen would be displayed,
rather than the following menu.
However, in both cases you would select the
UNIX Shell
option.
Select the
UNIX Shell
option at the prompt.
If necessary, create the special files for the root file system
device and dump file device.
Refer to
Chapter 5
for information
on device special files and the
dsfmgr
and
MAKEDEV
commands
After creating the system disk special file, configure the network by
configuring the network interface and creating the host name database ( /etc/hosts
).
Use the
ifconfig
command
with the following syntax to configure the network interface:
ifconfig
interface_id
local_address
mask
The
interface_id
parameter refers
to the network device mnemonic.
Refer to the
uerf
(8)
reference page
for information about obtaining an interface ID.
The
local_address
parameter specifies the Internet address for the local host.
The
netmask
mask
parameter
specifies how much of the address to reserve for subdividing networks into
subnetworks.
You can get the
netmask
value by entering
the
ifconfig
command on a system within the immediate area.
For example, to get the
netmask
value from the system
ln0
, enter:
#
ifconfig ln0
Refer to the
hosts
(4)
and
ifconfig
(8)
reference pages for more information.
Enter the following commands to configure
the network for the system
localsystem
, with an Internet
address of
120.105.5.1
, connected by an Ethernet interface
to the remote system
remotesystem
, with an Internet address
of
120.105.5.2
:
#
cd /etc
#
echo "127.0.0.1 localhost" >> hosts
#
echo "120.105.5.2 remotesystem" >> hosts
#
ifconfig ln0 120.105.5.1 netmask 0xfffffc00
Some older systems broadcast all 0s instead of all 1s.
In this situation, you must also specify the
broadcast address
.
Change to the root directory.
#
cd /
If the disk does not have a label, which could occur if the
disk was physically damaged or replaced, write the default disk partition
tables and bootstrap programs.
The disk partitions and bootstrap programs
should be operational.
To determine if the disk has a valid label, use the
disklabel
command with the following syntax:
disklabel
-r
disk
Use the
disklabel
command with the following
syntax to write the default disk partition table:
disklabel
-rw
disk
disk_type
The
disk
parameter specifies the
disk that includes the device mnemonic and unit number.
The
disk_type
parameter specifies the type of disk associated with
disk
as described in the
/etc/disktab
file.
For example, to write the default disk partition tables on an RZ57 disk, unit
0, enter the following command:
#
disklabel -rw /dev/disk/dsk0 rz57
Note
The options used with the
disklabel
command in this procedure cause the default disk partition tables to be written to the disk. Writing a label with customized partition table settings may affect the entire disk. If the disk you are restoring has customized partition table settings, invoke the editing option of thedisklabel
command. Refer to Chapter 6 or to thedisklabel
(8) reference page for more information.
Create a new root file system by using the following command syntax:
newfs
raw_device
The raw_device parameter specifies the full raw device pathname of the disk device on your system. For example, to create a new file system on an RZ57, unit 0, enter:
#
newfs /dev/rdisk/dsk0a
Mount the file system by using the following command syntax:
mount
block_device
[ /mnt
]
The block_device parameter specifies the full block device pathname of the disk device. For example, to mount the file system created in the previous step, enter:
#
mount /dev/disk/dsk0a /mnt
Restore the file system:
If you are restoring dump files from a local file system,
change to the
/mnt
directory, insert the medium containing
the dump file, and enter the
restore
command with the following
command syntax:
restore
[ -Yrf
]
[ dumpfile
]
The dumpfile parameter specifies the pathname of the file that contains the dump data. For a tape, you would enter the following commands:
#
cd /mnt
#
restore -Yrf /dev/tape/tape0_d0
If you are restoring dump files from a remote system, change
to the
/mnt
directory and use the
rsh
command with the following syntax:
rsh
[ remote_hostname
]
[ "dd if=dumpfile bs=blocksize" | restore -Yrf -
]
The remote_hostname parameter specifies the host name of the remote system that contains the dump file. The dumpfile parameter specifies the full pathname of the dump file on the remote system; and the blocksize parameter is necessary for reading from a tape.
The dump file must be read with the same block size as was used when writing to the tape. The default dump record size is 10 KB.
For example, to restore a dump file on a TLZ06 from the remote system
remotesystem
that was written using the default block size, enter:
#
cd /mnt
#
rsh remotesystem "dd if=/dev/tape/tape0_d0 bs=10k" \ | restore -Yrf -
Change to the root directory and unmount the file system.
#
cd /
#
umount /mnt
Restore the
/usr
file system.
If the
/usr
file system is on the same
device as root, the process is similar to steps 7 through 10.
To restore
the
/usr
file system on the
g
partition
of the same device as the root file system from the same tape device, enter
the following sequence of commands:
#
newfs /dev/rdisk/dsk0g
#
mount /dev/disk/dsk0g /mnt
#
cd /mnt
#
restore -Yrf /dev/tape0_d0
#
cd /
#
umount /mnt
If the
/usr
file system is on a different
device from root, the process is similar to steps 4 through 10.
Halt the system.
#
halt
Boot the system as described for your processor and distribution media in the Installation Guide.
9.8 Using the command-Line Utilities, tar, pax, and cpio
The
tar
,
pax
, and
cpio
command-line utilities provide a method of quickly creating an
archive from the command line or for writing scripts to back up files.
The
disadvantage is that you may have to type long command strings and backing
up or restoring large volumes of files and directories is not easy when using
these interfaces.
These utilities are often used to make a small archive of
files that can be distributed to other users, such as a program, its sources,
and associated documentation.
The following examples demonstrate how you can create or restore typical
archive files using the command-line utilities:
Using tar to Create an Archive
The
tar
command saves and restores multiple files
on a single device such as a disk or tape.
To create a tar archive to device
/dev/tape/tape12_d0
,
enter a command such as the following
#
tar cvfb /dev/tape12 -e ./.netscape -C /usr/glenn
The resulting archive contains all files and directories
in
/usr/glenn
except for file
./.netscape
.
See the
tar
(1)
reference page for more information.
Using pax to Create an Archive
The
pax
command extracts, writes, and lists members
of archive files.
It also copies files and directory hierarchies.
To create a
pax
archive of the current directory
to device
/dev/tape/tape0_d0
, enter:
#
pax -w -f /dev/tape0
The following command reads the archive
a.pax
,
extracting all files rooted in the directory
/usr
, relative
to the current directory:
#
pax -r -s ',^//*usr//*,,' -f a.pax
See the
pax
(1)
reference page for more information.
Using cpio to Create an Archive
The
cpio
command copies files between archive storage
and the file system.
It is used to save and restore data from traditional
format
cpio
archives.
To create a
cpio
archive to tape device
/dev/tape/tape12_d0
, enter:
#
cpio -ov < file-list -O/dev/tape12_d0
See the
cpio
(1)
reference page for more information.
9.9 Using dxarchiver
The Archiver,
dxarchiver
, is a graphical interface
for the command-line utilities described in
Section 9.8.
Use
this interface to:
Copy and store multiple files to a single, named archive file or output device such as a tape or floppy disk
Uncompress incoming archive files and compress newly created files
Retrieve stored files from an archive file or device such as a tape or floppy disk
As
dxarchiver
is a CDE application, you
can drag and drop files and directories (folders) to assemble an archive set,
without having to type long commands.
It is assumed that you gathered the information Section 9.5.3, and you have loaded or unloaded a tape or other media into the target device as described in the owner's manual. To create an archive, proceed as follows:
Invoke
/usr/bin/X11/dxarchiver
from a terminal
command line, or open the CDE Application Group: System_Admin.
Then open
System Admin Subgroup: Daily Admin and click on the Archiver icon.
Select the Archive Type:
tar
,
cpio
, or
pax
.
Refer to the reference pages for
more information, but note that not all options may be available from the
graphical interface.
Select any Archive Options.
Note that you can only append
to an existing archive, and you cannot further compress an existing archive
if it was compressed on creation.
Specify either an absolute or a relative
pathname as the method of storing the directories.
(An absolute pathname is
the full path, beginning at the root directory such as
/usr/users
.
A relative pathname begins at the current directory, for example
.
or
users/chan
.)
When you are recovering files from an archive, you will only be able to write them to a temporary location if you specified a relative path during the archiving process. Otherwise, files will be restored to their original locations. (Potentially overwriting the existing version unless you rename it.)
Specify the source, the files and directories that will be archived. You can type pathnames or you can open a File Manager view and drag files and directories (CDE folders) to the Source Container box within the Archiver window. If you type pathnames, use the OK button to add them to the container.
When all required files are specified, press Archive... and the Archiver: Archive window will be displayed.
Enter a destination path, such as:
/dev/tape/tape0_d0
for the default tape
device.
/usr/backup/myback_991803
for a disk archive.
Note that you do not need to enter a file name extension; the Archiver will
add an identifier such as
.Z
.
When you press OK, the destination is displayed under the Destination Container box.
Press Create Archive. A window titled Archiver working will be displayed, flashing a green button to indicate that the archive is being written. The files being archived are displayed in the Destination Container.
When the archive is complete, you can optionally print a copy of the files list to keep as a record with the tape.
Press Cancel to return to the Archiver main window. You can optionally enter the name of the archive file and use the Show Contents... option to verify that the archive was written correctly. The tape or archive file will be read and the contents displayed in the Show Contents Window. This step is recommended before you proceed to delete any files from the disk that was backed up.
To extract an archive, you need to specify a destination on a target device such as a disk. Note that if you are not recovering a damaged file system on a complete disk partition, you may want to consider using a temporary location rather than overwriting existing directories. You can then restore individual files and directories as needed. You can also opt to restore selected files from the archive. The process is as follows:
Invoke
/usr/bin/X11/dxarchiver
from a terminal
command line, or open the CDE Application Group: System_Admin.
Then open
System Admin Subgroup: Daily Admin and click on the Archiver icon.
To select individual files and directories, press Show Contents... and the tape or archive file will be read and the contents displayed in the Archiver Show Contents window. Select individual files or directories as follows:
In the Archiver Show Contents window, click on a file or directory to highlight it.
Move to another file or directory, hold down the Ctrl key and click to select it.
When all required files are selected, press OK in the Archiver Show Contents window. The files will be displayed in the Source Container box in the Archiver main window. You can use the Edit menu to make additional changes to selections. For example, highlight an entry in the source container and choose Edit: Clear Selected Source to delete it.
Press the Extract... button to display the Archiver Extract window.
Enter a destination directory.
This directory can be the same
as the archive, assuming that files can be overwritten.
Alternatively, give
the path to a temporary location.
Note that this must be an existing directory,
or you must open a terminal and create it with
mkdir
(or
create a folder with the New Folder option in CDE File Manager).
The destination
is displayed under the Destination Container box.
Press Extract Contents to begin the extraction. A window titled Archiver Working will be displayed, flashing a green button to indicate that the archive is being extracted. The files being recovered are displayed in the Destination Container.
When the archive is complete, you can optionally print a copy of the files list, to keep as a record.
Press cancel to return to the Archiver main window. Before exiting, you should use the File Manager or a terminal window to ensure that the files were recovered as expected and that the file contents are not corrupted. This step is strongly recommended before you proceed to remove any archives from tape or other media.
You can now remove the tape or other media as described in the
owner's manual for the device, and store the media in a safe location (or
in accordance with your site backup policy and procedures).
9.10 Creating a Standalone System Kernel on Tape
You can create a bootable standalone system (SAS) kernel on tape. The SAS kernel has a built-in memory file system (mfs), which contains the minimum commands, files, and directories needed to restore the system image. This is referred to as the miniroot file system. You can also add additional files systems to the tape for data or programs that you may need.
To create the SAS kernel, you must use the
bttape
interface or the
btcreate
command-line utility.
Once you
have created the kernel, you can restore the customized image using the
btextract
utility.
The following sections provide an overview of
the
bttape
interfaces, both for the CDE graphical interface
and the
btcreate
and
btextract
utilities.
For information on syntax and examples, see the reference page for each utility.
Note that this interface is part of the SysMan Menu and can be invoked
and used from a terminal, and various windowing environments.
9.10.1 Restrictions and Requirements
The following sections describe the restrictions and requirements for
building an SAS kernel on a system.
9.10.1.1 Tape Device Requirements
When using QIC tape drives to create bootable tapes, you must use only high-density tapes of 320 or more megabytes. The QIC-24, QIC-120, and QIC-150 format tapes of fixed-512 blocks will not work. Tapes with a variable block size, such as the QIC-320 and QIC-525, will work with bootable tape. Using an improperly configured QIC tape drive to create a bootable tape will result in an I/O error, a write error, or permission denied error. Therefore, you must take one of the following actions:
Configure the drive at installation time
Rebuild the kernel if the drive was attached to the system after the installation
A QIC tape created with the
btcreate
utility
may fail with the following error message when booted:
failed to send Read to mka... Be sure that the tape is
write protected before booting.
If you are creating a bootable tape with a file system that extends
to multiple tapes, the
/sbin/dump
command displays a message
indicating that the tape must be changed.
If the tape is not changed promptly,
warning messages repeat periodically until the tape is changed.
When you
change the tape, the warning messages stop.
The behavior of the open call to a tape device has changed. You can no longer use write mode to open a write-protected tape. An attempt to open the tape will fail, returning the following message:
EACCES (permission denied)
If an application is written so that it attempts to open the tape
device with
O_RDWR
when the intention is only to read the
tape, the open attempt will fail.
Applications should be changed to open the
device with
O_RDONLY
.
For applications that cannot be changed,
use the following command to obtain the previous behavior of the open call:
#
sysconfig -r cam_tape open_behaviour=0
9.10.1.2 Supported Software and Devices
For this release, bootable tape will not work with the LSM product. The following processor platforms are supported:
DEC 3000-500
DEC 3000-400
DEC 3000-600
DEC 3000-300
DEC 3000-300X
DEC 3000-900
DEC 2100
AlphaStation 600
AlphaStation 200
AlphaServer 1000A
AlphaServer 2100
AlphaServer 4100
For tape drives, you must ensure that the kernel was built with the tape drive connected to your system. If the drive was not connected when the kernel was built, you will see dump errors and the system will not be able to boot from the tape drive. The following tape devices are supported:
TLZ06, 4mm, 2.0GB/4.0G
TLZ07, 4mm, 4-8G
TZK10, QIC tape, 320MB-525 MB
TZK11, QIC tape, 2.0G
TZ86, 5-1/4-inch cartridge
9.10.2 Using the btcreate Utility
To build a bootable SAS kernel on UFS or AdvFS file systems only, you
must use the
btcreate
utility.
The following sections
provide an overview of the information you must have to create the SAS kernel
on tape.
The
btcreate
utility provides both a noninteractive
and interactive user interface.
Both require that you have superuser (root)
privileges.
9.10.2.1 Gathering Information
To prepare for a
btcreate
session, you must have
the following information available:
Name of the kernel configuration file in the
/usr/sys/conf
directory.
The default is the same as the system (HOST) name in
capital letters.
Name of the disk partition (for example,
dsk2e
)
where the miniroot file system is to reside.
Minimum size needed on the disk
is 30720 blocks (512 bytes per block).
This disk partition should not be
mounted when
btcreate
is executed.
Name of the tape device, for example
/dev/tape/tape0_d0
, where the SAS kernel and file systems are to reside.
Device name, mount point, and type of each file system (UFS or AdvFS) that you want to back up to the tape device. The following shows valid UFS and AdvFS entries:
UFS:
/dev/dsk1a / ufs /dev/dsk1g /usr ufs
AdvFS:
root_domain#root / advfs usr_domain#usr /usr advfs
Note
Do not select swap partitions for file system backups.
An addlist_file, which lists the files or directories you want to include on the miniroot file system.
An fslist_file, which specifies the file systems to back up.
A
/usr/lib/sabt/sbin/custom_install.sh
script, if you want to customize the restored system image.
The file must
be written in the Bourne shell language (sh1
) as it is
the only shell provided on the miniroot file system.
The
btcreate
utility copies the
custom_install.sh
file onto
tape and places it in the
sbin
directory on the miniroot
file system.
The
btextract
utility invokes the
custom_install.sh
script before exiting.
The following additional features may be useful in planning your bootable tape layout:
Use the
-d
option to specify the location
where the
btcreate
command creates its temporary files.
If you do not specify a location, 156000 blocks (512 bytes per block) of
disk space in the
/usr
file system will be required.
You can label disks using your own custom
disklabel
script.
Your customized
disklabel
script must
meet the following requirements:
It must be located in the/usr/lib/sabt/etc
directory.
It must be named
custom_disklabel_file
.
If a custom
disklabel
script is not present, the
btextract
command will label the disks in the usual manner.
Refer
to the
disklabel
(8)
reference page for more information.
9.10.2.2 Creating the SAS Kernel
To create the SAS kernel, the
btcreate
utility copies
the
/usr/sys/conf/YOUR_SYSTEM_NAME
configuration file to
/usr/sys/conf/YOUR_SYSTEM_NAME.BOOTABLE
and modifies it as follows:
config vmunix root on md pseudo-device memd 30720
These modifications indicate that a memory file system of 30720 is being configured. The memory file system and the disk partition where the miniroot file system reside are equivalent in size.
After modifying the configuration file, the
btcreate
utility executes the
doconfig
command and moves the bootable
kernel to the
/usr/sys/bin
directory.
For information on
syntax format and flags, see the
btcreate
reference page.
9.10.3 Using the btextract Utility
The
btextract
utility is a shell script that restores
file systems from tapes that contain a SAS kernel created using the
btcreate
utility.
You have the option of performing a default
restoration or an advanced restoration of the system.
Performing a default restoration, you can duplicate the customized system
on more than one machine of the same hardware platform type; however, you
cannot specify which disk partitions to use for the restore operation.
Instead,
the
btextract
utility restores file systems using the disk
partition information gathered during the
btcreate
session;
all existing information is overwritten.
Performing an advanced restoration, you can specify which disk partition to use, but the customized system can only be duplicated on a machine of the same hardware platform type.
To use the
btextract
utility, place the system in
a halt state, initialize the system, then boot from the tape as follows:
>>> init >>> show dev >>> boot -fl "nc" MKA500
In this example, the
show
dev
command provides the device name under BOOTDEV and
MKA500
is the BOOTDEV.
After the initial boot is completed, the shell invokes the
btextract
utility.
If you created a
/usr/lib/sabt/sbin/custom_install.sh
script during the
btcreate
session, the
btextract
utility invokes the
custom_install.sh
script before exiting.
See the
btcreate
reference page
for more information.
After the
btextract
utility completes its task, you
must shut down the system, then reboot the system from the restored disk as
follows:
# shutdown -h now >>> boot DKA100
In this example,
DKA100
is the BOOTDEV.
For more information and examples, see the
btextract
reference page.
9.10.4 Using bttape with the Graphical Interface
The following steps describe the basic process for creating a bootable
tape and assumes that you have already gathered the necessary device data
as described in
Section 9.10.2.1, and the tape device is ready
to save.
(See
Chapter 1
for information on the various interface
options when invoking
bttape
):
Invoke the
bttape
interface.
For example,
from the CDE Application manager, choose System_Admin, then Storage_Management
and click on the Bootable Tape icon.
A window titled Bootable Tape Creation
on <hostname>
will be displayed and you should complete the fields or select
options as follows:
In the Kernel Name field, the default kernel name for the host is displayed. This is usually the same as the local host name. However, you can enter any name for the saved kernel.
The Miniroot File System field provides the following options:
The option to create the miniroot as a Memory File System (mfs) or a Disk Partition. Click on the apropriate button for either option.
The option to specify a disk partition name such as
dsk0b
with the Specify Disk Partition/mfs...
button.
(This button
dispays a dialog box in which you enter the disk partition name.)
The Tape Device field contains the name of the default tape
device, usually
tape0_d0
.
This is the name of the device
on which the SAS kernel will be saved, but you can opt to specify any other
supported device.
The Customizing the Miniroot File System field displays the
default file location for the
addlist
file.
This is a data
file that contains a list of additional files that you want to include such
as commands or utilities.
Note that you cannot exceed 360 KB of data in the
mfs.
This list of files is stored in
/usr/lib/sabt/etc/addlist
by default but you can opt to create and specify your own location.
To create a new append file, or modify an existing append file:
Press the Create/Modify Miniroot Append File button to display the Create/Modify window.
Press Add to display the Add/Modify window.
Specify the location
of the file that you want on the local host.
For example, to add the
kill
command, enter
/sbin/kill
.
Then specify
the location on the miniroot file system where the file will be located, such
as
/sbin
.
Press OK to return to the Create/Modify window.
The files to be appended will be listed in the Contents of file: box. Press OK to return to the main window for Bootable Tape Creation.
The Selecting File Systems option enables you to back up file
systems, such as
/usr
or an AdvFS domain such as
root_domain#root
.
The list of files to be backed up is stored in
/usr/lib/sabt/etc/fslist
, but you can specify any name that you
want.
Add file systems as follows:
Press the Create/Modify File Systems Backup File... button to display the Create/Modify window.
Press Add to display the Add/Modify window.
Specify the disk
partition mounted on the local host such as
/dev/disk/dsk0g
.
Then specify the mount point, such as
/usr
.
Press OK to
return to the Create/Modify window.
The file systems to be backed up will be listed in the Contents of file: box. Press OK to return to the main window for Bootable Tape Creation.
After completing the required fields, you are ready to create the tape. Press OK to proceed. A message window is displayed to indicate that the task has started. The creation of the tape may take twenty or more minutes, depending on the speed of the devices used.
If the task cannot be completed, a further message is displayed, informing
you that the error log is located in
/var/adm/btcreate.log
.
When the tape has been successfully written, a window is displayed
that confirms the success and the location of the log file,
/var/adm/btcreate.log
.
Print the
btextract
(8)
reference page and store it with the tape for
future reference.
Use the instructions in
Section 9.10.3
and the
btextract
(8)
reference page to restore the bootable SAS kernel.