Tuesday, January 12, 2010

Use a tape in Solaris

Generally you don't need to mount a tape. You access it as a device.

tar tvf /dev/rmt/0

will show you the contents of a tarfile on the tape in the first tape drive. If the tape was written in a different format, you will need a different command to read and retrieve the data. It might also be ufsrestore / ufsdump and possibly a compressed tar archive.

1) Rewinding a tape
# mt –f /dev/rmt/0 rewind

2) Display the status of a tape drive
# mt –f /dev/rmt/0 status
It displays information as tape is loaded, offline, total files, blocks etc.

3) Retensioning a tape
# mt –f /dev/rmt/0 retension


Before backing up data on a device, you must understand the tape device-naming schema:

First tape device name: /dev/rmt/0
Second tape device name: /dev/rmt/1

rmt = raw magnetic tape device

You can also add special character letter to specify density using following format /dev/rmt/ZX

Where

    * Z is tape drive number such as 0,1..n
    * X can be any one of following (as supported by your device, read the manual of your tape device & controller to see if all of them supported or not):
    * l - Low density
    * m - Medium density
    * h - High density
    * u - Ultra density
    * c - Compressed density
    * n - No rewinding

For example to specify the first, drive with high-density with no rewinding use device /dev/rmt/0hn.

Архивация в Solaris

-->; backup one liner
tar cvf - /home/ebs | gzip - >; ebs.tar.gz



root@N2000Primary # tar cvf - /root/vlad/vmware | gzip - > keygen-vmware.tar.gz
a /root/vlad/vmware/ 0K
a /root/vlad/vmware/keygen.exe 2K
a /root/vlad/vmware/keygen-vmware.tar.gz 0K
root@N2000Primary #