Sei sulla pagina 1di 16

Backup & Restore

Backing Up and Restoring File Systems


• Backing up file systems means copying file
systems to removable media (such as tape) to
safeguard against loss, damage, or corruption.
• Restoring file systems means copying reasonably
current backup files from removable media to a
working directory.
Reason for Backing Up File Systems
• Backing up files is one of the most crucial system
administration functions. You should perform
regularly scheduled backups to prevent loss of
data due to:
• System crashes
• Accidental deletion of files
• Hardware failures
• Natural disasters (for example, fire, earthquakes)
• Problems when reinstalling or upgrading a
system
Solaris Backup and Restoration Utilities

tar Archives data to another directory, system,


or medium

ufsdump Backs up all files in a file system

ufsrestore Restores some or all of files archived with


the ufsdump command
tar utility
• The primary use of the tar (tape archiver) is to copy file
systems or individual files from a hard disk to tape or
from tape to a hard disk.
• You can also use it to create a tar archive on hard disk or
floppy and to extract files from a tar archive on hard disk
or floppy.
• It is limited to a single tape.
• Backing data requires more than one tape than, use the
cpio, pax, or ufsdump.
tar
tar <options> <tar filename> <file list>
c Creates a tar file
t Lists the names of the specified files each
time they occur in the tat filename.
x Extracts or restores files from a tar filename.
v Verbose mode
f tar file (/dev/rmt/0l)

To Create a tape archive


tar cvf /dev/rmt/0 /directory
To list files in the archive
tar tvf /dev/rmt/0

To Restore files from archive


tar xvf /dev/rmt/0 /directory

Use tar to create an archive file on disk instead of tape.


tar cvf files.tar /directory

To Extract files from archive file stored on disk


tar xvf files.tar
ufsdump utility
•Ufsdump is designed specifically for backups and is the
recommended method for backing up your Solaris file
systems.
•The ufsdump command copies files, directories, or entire
file systems from a hard disk to a tape.
•The only drawback of using ufsdump is that the file
systems must be inactive before you can conduct a full
backup.
•If the file systems is still active, anything in the memory
buffers is not copied to tape.
•The ufsdump command can be used to back up individual
file systems to local or remote tape devices or disk drives.
• Ufsdump has built-in options to create incremental
backups that will back up only those files that were
changed since a previous backup, saving tape space and
time.
• Backing up a file systems with ufsdump is referred to as
“dumping” a file system.
• When a file system is dumped, a level between 0 and 9 is
specified.
• A level 0 dump is a full backup and contains everything
on the file systems.
• Level 1 through 9 dumps are incremental backups and
contain only files that have changed since previous dump
at a lower level.
/usr/sbin/ufsdump <options> <arguments> <files>
Options for ufsdump command
0 to 9 Backup level. Specify level 0 for full
backup of the whole file system. Levels 1
through 9 are for incremental backups of files
that have changed since the last lower-level
backup.
a <archive- Instructs ufsdump to create an archive file.
file>
b <factor> Blocking factor.
c Instructs ufsdump to back up to cartridge tape.
f <file> device file
u Updates the dump record (/etc/dumpdates)
v Verify

ufsdump 0uf /dev/rmt/0 files-to-back-up

ufsdump 9uf /dev/rmt/0 files-to-back-up


ufsrestore
•The ufsrestore command copies files from backups created
using the ufsdump command
ufsrestore <options> <arguments> <filename>
Command options for ufsrestore
i Interactive
r Recursive
x <filename> Extract
t <filename> Table of contents
b <factor> Blocking factor
v Verbose
ufsretore tvf /dev/rmt/0l /etc/passwd
Managing Tape Drives
•Basic Device Names for Backup Devices
Device Type Name
Tape /dev/rmt/n
Diskette /vol/dev/rdiskette0/unlabeled
Specifying the Default Density for a Tape Drive

To Specify The ... Use ...


First drive, rewinding /dev/rmt/0
First drive, nonrewinding /dev/rmt/0n
Second drive, rewinding /dev/rmt/1
Second drive, nonrewinding /dev/rmt/1n
Specifying Different Densities for a Tape Drive
To Specify The ... Use ...
First drive, low density, rewinding /dev/rmt/0l
First drive, low density, nonrewinding /dev/rmt/0ln
Second drive, medium density, rewinding /dev/rmt/1m
Second drive, nonrewinding, medium density /dev/rmt/1mn
• How to Display Tape Drive Status
1. # mt -f /dev/rmt/n status

• How to Retension a Magnetic Tape Cartridge


$ mt -f /dev/rmt/n retension

• How to Rewind a Magnetic Tape Cartridge


$ mt -f /dev/rmt/n rewind

Potrebbero piacerti anche