Previous Table of Contents Next


Backing Up and Restoring File Systems

Backing up files means making copies of them, usually on removable media, as a safeguard in case the originals get lost or damaged. Backup tapes are convenient for restoring accidentally deleted files, but they are essential in case of serious hardware failures or other disasters.

Backing up files is one of the most crucial system administration functions. You must plan and carry out a procedure for regularly scheduled backups of your file systems for three major reasons:

  To ensure file system integrity against a possible system crash
  To protect user files against accidental deletion
  To act as an important safeguard before reinstalling or upgrading a system

When you back up file systems as scheduled, you have the assurance that you can restore anyone's files to a reasonably recent state. In addition, you may want to back up file systems to transport them from one system to another or to archive them — saving files on a transportable media — so that you can remove or alter the files that remain on the system.

When you plan a backup schedule, you need to consider:

  Which command to use to back up the file systems
  What media to use
  What backup schedule to use
  Which file systems to back up
  Which files are critical to users on this system
  Where the files are located — are they in a single file system?
  How often these files change
  How quickly you would need to restore these files in the event of damage or loss
  How often the relevant file systems can be unmounted so that they are available for backup

Outlining possible backup strategies is beyond the scope of this book. See the ufsdump(1M) manual page for a suggested dump schedule. The discussions that follow describe how to use the ufsdump command to make backups and how to retrieve files using the ufsrestore command.

Table 4-7 lists the commands that you can use to back up and restore individual files and file systems.

Table 4-7 Commands for Backing Up and Restoring Files and File Systems

Task Command
Back up and restore complete or individual file systems to a local or remote tape device ufsdump and ufsrestore.
Back up complete file systems for all systems on a network from a server Solstice Backup software. Refer to the Solstice Backup 4.2 User Guide.
Back up and restore an NIS+ master server nisbackup and nisrestore. Refer to the nisbackup and nisrestore manual pages.

Specifying Tape Characteristics

The ufsdump command uses a set of defaults when you do not specify any tape characteristics. You can specify tape cartridge (-c), density (-d), size (-s), and number of tracks (-t). Note that you can specify the options in any order as long as the arguments that follow match the order of the options. See Tape Capacity Arguments to the ufsdump Command provides some arguments to the ufsdump command that work well for different types of tape cartridges.

Table 4-8 Tape Capacity Arguments to the ufsdump Command

Medium Arguments
Diskette ufsdump Ds 1422
60-Mbyte cartridge ufsdump cdst 1000 425 9
150-Mbyte cartridge ufsdump cdst 1000 700 18
1/2-inch tape ufsdump dsb 1600 2300 126
2.3-Gbyte 8-mm tape ufsdump dsb 54000 13000 126
5.0-Gbyte 8-mm tape ufsdump dsb 54000 13000 126
5.0-Gbyte 4-mm tape ufsdump b 96

Backing Up a File System Using QIC-150 Cartridge Tapes (ufsdump)

To do a full backup on a file system, all users must be logged out and you must bring the system to single-user mode. (See "Tape Device Naming Conventions" in Chapter 3 if you need information about tape device names.)

You can dump or restore files from a remote drive by adding remote-host: to the front of the tape device name. Here is the syntax:

remote-host:/dev/rmt/unit

For example, the device name for a remote tape drive /dev/rmt/0, on the system oak, would be oak: /dev/rmt/0.

Follow these steps to do a level 0 (full) backup of a file system:

1.  Type init s and press Return. The system is brought to single-user mode, which ensures that no users can change the file system you are backing up.
2.  Insert a tape cartridge in the QIC-150 tape drive.
3.  Type ufsdump 0cuf /dev/rmt / unit c n t n d n s n and press Return. The 0 option specifies a level 0 (complete) dump. The c option specifies cartridge tape. The u option updates the dump record. The f option followed by the device name specifies the device file. Type the raw disk slice for the file system you want to back up, for example, c0t0d0s7 for /files1.
The following example does a level 0 dump of the c0todos7 slice:
oak% su
Password:
# init s
# ufsdump Øcuf /dev/rmt/Ø cØtØdØs7
  DUMP: Date of this level Ø dump: Wed Mar 11 1Ø:16:53 1992
  DUMP: Date of last level Ø dump: the epoch
  DUMP: Dumping /dev/rdsk/cØt3dØs7 (/export/home) to /dev/rmt/Ø
  DUMP: mapping (Pass I) [regular files]
  DUMP: mapping (Pass II) [directories]
  DUMP: estimated 956 blocks (478KB)
  DUMP: Writing 63 Kilobyte records
  DUMP: dumping (Pass III) [directories]
  DUMP: dumping (Pass IV) [regular files]
  DUMP: level Ø dump on Wed Mar 11 1Ø:16:53 1992
  DUMP: 956 blocks (478KB) on 1 volume
  DUMP: DUMP IS DONE
#
4.  If the dump requires more than one tape, the ufsdump command tells you when to change to a new tape.
5.  Label the tape with the command, file system, and date so that you can easily find the backup tape if you need to restore files.


Previous Table of Contents Next