You are on page 1of 3

UFSDUMP/ UFSRESTORE - Tape commands

TAPE COMMANDS ============== Command: mt - magnetic tape Purpose: To know the status of a tape and to perform rewind, erase, and so on Path: /usr/bin/mt Syntax: mt [ -f tape device name ] command [count] where tape device name is usually /dev/rmt/0 The most common commands are: status -Displays status information about the tape drive. rewind -Rewinds the tape. retension -Smooths out tape tension. erase -Erases the entire tape. fsf -Forward skips count tape files. bsf -Backward skips count tape files. eom -Skips to the end of the recorded media. Count refers to the number of times that the requested operation is to be performed. By default, mt performs a command once; multiple operations of a command may be performed by specifying count. Examples: mt -f /dev/rmt/0 status ---> This command displays the status of the tape. mt -f /dev/rmt/0 rewind ---> This command rewinds the tape. mt -f /dev/rmt/0n fsf 2 ---> This command forwards the first two files. mt -f /dev/rmt/0n bsf 2 ---> This command goes backward two files.

Command: tar - tape archive Purpose: To create or restore tape archives. This command is used to back up single or multiple files in a directory hierarchy. Path: /usr/bin/tar Syntax: tar options device-name file-name

The most common options are: c Creates the tar file from the beginning. E The E flag is required whenever larger files and/or files with longer names, or whose UID/GID exceed 2097151, are to be archived, or if time granularity of microseconds is desired. (Solaris 8/9/10 Operating System only). r Replaces the existing one. t Displays the table of contents of the tape archive. u Update. The named files are written at the end of the tarfile if they are not already in the tarfile, or if they have been modified since last written to that tarfile. An update can be rather slow. A tarfile created on a 5.x system cannot be updated on a 4.x system.

Extract or restore. The named files are extracted from the tarfile and written to the directory specified in the tarfile, relative to the current directory. Uses the relative path names of files and directories to be extracted. Verbose. Outputs the name of each file preceded by the function letter.

Where device name is typically /dev/rmt/0. It may also be a file name. Where file name is the name of the file to be archived. Examples: tar cvf /dev/rmt/0 /export/home/user1 --> Creates the tape archive of /export/home/user1 on the tape /dev/rmt/0 tar tvf /dev/rmt/0 ---> Displays the table of contents of /dev/rmt/0 tar xvf /dev/rmt/0 ---> Restores the data from /dev/rmt/0 Note: In the above commands, /dev/rmt/0n can be used in place of /dev/rmt/0. /dev/rmt/0n will not rewind the tape after the backup. Command: ufsdump Purpose: To back up a file system, files, or directories. It may be a full backup or incremental backup. Path: /usr/sbin/ufsdump Syntax: ufsdump options device-name files-to-dump

The most common options are: 0 to 9 Specifies the dump level option. Level 0 is the lowest level, which is used for full backup. Levels 1 to 9 are used for incremental backups. u Updates the dump record /etc/dumpdates with the date and dump level of this backup. f Specifies the device to which the files are written. It requires the device name. v Verifies the data on the tape against data on the file system. Where device-name is /dev/rmt/0 Where files-to-dump means raw file system /dev/rdsk/c0t2d0s0 or block file system /dev/dsk/c0t2d0s0. Also, it may be the name of the file system /export/home or a file or directory name /export/home/user1. Examples: ufsdump 0uf /dev/rmt/0 /export/home ---> Dumps /export/home file system to /dev/rmt/0, which is a full backup. ufsdump 1uf /dev/rmt/0 /dev/dsk/c0t2d0s4 --> Dumps /dev/dsk/c0t2d0s4 file system to /dev/rmt/0. However, this is 1st level incremental backup. ufsdump 4uf dbserver:/dev/rmt/0 /export/home/user1 --> Dumps the 4th increment level backup of /export/home/user1 to dev/rmt/0 tape device, which is mounted on the remote box dbserver. Note that the tape device is not on the local machine. It is on the remote machine dbserver.

Command: ufsrestore Purpose: To restore/extract the files from a backup which is created by ufsdump Path: /usr/sbin/ufsrestore Syntax: ufsrestore options device-name file-to-restore

The most common options are: i Restores the files interactively. r Restores the entire backup. t Lists the table of contents of the backup. x Restores the files named on the command line. f Specifies the device name /dev/rmt/0. v Displays the path names as they are being restored (verbose mode). Note: This is different from the v(verify) option used with ufsdump command. Examples: ufsrestore xvf /dev/rmt/0 ./etc/hosts ---> Restores ./etc/hosts file to the current directory. ufsrestore ivf /dev/rmt/0 ---> Prompts to select the files which are to be restored. ufsrestore rvf /dev/rmt/0 ./opt ---> Restores /opt file system to the current directory. ufsrestore tvf /dev/rmt/0 ---> Displays the table of contents on /dev/rmt/0.

Command: tcopy Purpose: To copy a magnetic tape Path: /usr/bin/tcopy Syntax: tcopy source destination Can be used to duplicate a tape - or to figure out the blocksize of a tape: Examples: tcopy /dev/rmt/1b /dev/rmt/2b in drive 1b. tcopy /dev/rmt/1b % tcopy /dev/rmt/0

---> Creates a clone of the tape ---> Feturns the blocksize of a used tape.

^C ( interruptable with ^C ) file 1: records 1 to 31384: size 32768 <<-- Blocksize is 32768 Bytes. interrupted at file 1: record 31384 total length: 1028390912 bytes

You might also like