Operating System - HP-UX
1830571 Members
3151 Online
110015 Solutions
New Discussion

Re: How do I check the a DLT-tape´s contents?

 
ekke2
Occasional Advisor

How do I check the a DLT-tape´s contents?

When I use the following command
cat /dev/rmt/0m, I get this message
ANSII standard label not yet implemented.
What does it means?


I have also made a backup to a DLT-tape with fbackup. How can I check the DLT-tape´s contents?
4 REPLIES 4
Cem Tugrul
Esteemed Contributor

Re: How do I check the a DLT-tape´s contents?

KBRC00000197 [This document may be viewed by customers]
[This document has been certified]
Example backup/recover commands for fbackup, cpio, tar
Document Information Table
Example backup/recover commands for fbackup, cpio, tar
DocId: KBRC00000197 Updated: 1/3/00 8:52:22 AM

PROBLEM

The most frequently used commands for fbackup, cpio, tar.

RESOLUTION

(This document assumes the user's device file is /dev/rmt/0m.)

FBACKUP/FRECOVER

Things to remember about fbackup:

* fbackup MUST rewind the tape before beginning the backup and after
completing.
* a tape created with fbackup is only recoverable with frecover.
* a file listed in the index file (from option -rvNf) is not guaranteed
to be on the tape; this simply means that fbackup intended to back the
file up when it began the backup session.

Command Description

fbackup -vf /dev/rmt/0m -i / full system backup

fbackup -vf /dev/rmt/0m -i specifically include file/directory
/etc/hosts preceded by -i

fbackup -vf /dev/rmt/0m -i specifically include multiple
/etc/hosts -i /usr files/directories preceded by -i

fbackup -vf /dev/rmt/0m -e specifically exclude file/directory
/etc/hosts preceded by -e

fbackup -vf /dev/rmt/0m -g
graph_file_name backup from a graph file

frecover -xvf /dev/rmt/0m restore entire tape to originating
directory structure

restore entire tape to originating
frecover -xovf /dev/rmt/0m directory structure and overwrite any
existing files

cd /tmp restore entire tape to /tmp
frecover -xXvf /dev/rmt/0m (originating directory structure will
not be overwritten)

frecover -vf /dev/rmt/0m -I verify backup and read the index file
/tmp/index from the tape into a file called
/tmp/index

fbackup -vf /dev/rmt/0m 2>&1 log what is backed up, along with any
|tee /tmp/backup.log errors that occur

frecover -rNv -f /dev/rmt/0m 2>
/tmp/listing list of what is really on the tape

frecover -V /tmp/volume_headers
-f /dev/rmt/0m show volume headers on the tape

CPIO

Things to remember about cpio:

* cpio is very particular about its options. If the options used to
restore aren't compatible with the options used to backup, it will
complain. Fortunately, the complaints are fairly self-explanatory.

Command Description

find /etc/hosts -print | cpio -ocx >
/dev/rmt/0m backup one file

cat /etc/hosts | cpio -ocx >
/dev/rmt/0m another way to backup one file

find . -print | cpio -ocx > backup all files in current
/dev/rmt/0m directory

cpio -ictv < /dev/rmt/0m verify what is on the tape

cpio -iudmcx < /dev/rmt/0m restore all files on tape

cpio -icvdxumB < /dev/rmt/0m
'file_name' restore one file

TAR

Things to remember about tar:

* tar is, for the most part, platform generic (ie: a tar tape created on
a SUN machine can usually be read by an HPUX machine). However, if the
platforms are far removed from each other (ie: SunOS 4.x and HPUX
11.0), then reading the tape may be impossible.

Command Description

tar cvf /dev/rmt/0m /etc/hosts backup one file

tar cvf /dev/rmt/0m (file1) (file2) backup file1 and file2

tar tvf /dev/rmt/0m verify contents of tape

tar xvf /dev/rmt/0m restore entire tape

tar xvf /dev/rmt/0m (file) restore one file

tar tf /dev/rmt/0m | grep swp | xargs restore all files that contain
tar xvf /dev/rmt/0m the string swp

ALT KEYWORDS

fbackup, cpio, tar, backup, restore, example, command, index

[Image]


Creating an Archive to a Remote Device

Contents
About this document
Tape blocksize
Setting up the .rhosts file
On the target machine
On the source machine
Archive commands
Backup by name
Backup by inode
cpio
tar
rdump
Moving a file system remotely

About this document
Some UNIX systems have the capability of referencing a remote tape device
as if it were local to the source system. Running AIX Systems cannot
"mount" a remote tape device locally; however, data can be sent to a
remote machine tape device using rsh.
This document describes how to archive files to a remote tape device.
Information in this document is valid for AIX Versions 3.2.5 through 4.x.
IMPORTANT NOTE: The dd command will not span tapes. Multiple tape archives
are not available via this procedure.

Tape blocksize
1. Decide on the appropriate tape device blocksize (bs). Recommended
values are as follows:
9trk or 1/4in = 512
8mm or 4mm = 1024

2. To check the current blocksize of the tape device, enter:
tctl -f /dev/rmt0 status

3. To change the tape device blocksize, enter:
chdev -l rmt0 -a block_size=

Replace with the value that you want to assign.

Setting up the .rhosts file
In order to create a remote archive, the system being archived (the source
machine) must have access to the system with the tape drive (the target
machine). The target system can be accessed using any of the defined users
on that system, but the following examples assume that both the local and
remote user is root. For further information on rsh and user
authentication, please see the rsh man page or InfoExplorer.
On the target machine
1. As root, using a favorite editor, create a file in the / (root)
directory called .rhosts that allows the source system access to the
target system.
2. To determine the name of the source machine to be added to the
file, run the following command:
host

is the IP address of the source system.
3. Add the following line to the file:
root

is the system name determined in step 2.
4. Save the file.
5. Change the permissions on the .rhosts file by entering:
chmod 600 .rhosts

On the source machine
1. Once the .rhosts file is set up on the target system, test to be
sure the source system has access. On the source system, as root, enter:
rsh

is the name of the target host. Shell access should be
granted; no login prompt asking for a username should appear.
2. Type exit to log out.

Archive commands
The following are examples of how to use AIX archive commands to a remote
tape drive. In these examples, represents the target tape device
blocksize, is the name of the target system, and /dev/rmt0 is
used as an example of the remote tape device. The parameter is used
where a directory or file name is needed. For more information, please see
each archive command's man page or InfoExplorer.
Backup by name
1. To remotely create a backup archive by name, enter:
find -print | backup -ivqf- | rsh \
"dd of=/dev/rmt0 bs= conv=sync"

2. To restore a backup archive by name created as in the preceding
example, enter:
rsh "dd if=/dev/rmt0 bs=" | restore \
-xvqdf-

Backup by inode
WARNING: The backup by inode documentation states that the source file
system must be unmounted before archiving. Even though it might sometimes
work without unmounting, such usage is not supported.
1. To remotely create a backup archive by inode, enter:
umount
backup -0 -uf- | rsh \
"dd of=/dev/rmt0 bs= conv=sync"

2. To restore a backup archive by inode created as in the preceding
example, enter:
rsh "dd if=/dev/rmt0 bs=" | restore \
-xvqf-

cpio
1. To remotely create an archive using cpio, enter:
find -print | cpio -ovcB | rsh \
"dd ibs=5120 obs= of=/dev/rmt0"

2. To restore a cpio archive created as in the preceding example,
enter:
rsh "dd if=/dev/rmt0 ibs= obs=5120" | \
cpio -icvdumB

tar
1. To remotely create an archive using tar, enter:
tar -cvdf- | rsh "dd of=/dev/rmt0
bs= conv=sync"

2. To restore a tar archive created as in the preceding example,
enter:
rsh "dd if=/dev/rmt0 bs=" | tar -xvpf-


rdump
At AIX Version 4.2 and subsequent versions, rdump includes the -L flag.
This flag specifies the length of the tape in bytes. For example, for a
2GB tape, use -L 2g.
At versions prior to AIX 4.2, rdump requires the use of the -s (tape
length) and -d (density) flags for devices other than 9-track tape.
Suggested values are:
Size/Type | Size used | -c option | -d flag | -s flag
------------- ----------- ----------- --------- ----------
1/4" tape
----------------------------------------------------------
QIC-120 | 120 mb | yes | 1250 | 8800
QIC-150 | 150 mb | yes | 1250 | 10600
QIC-525 | 525 mb | yes | 2000 | 22000
QIC-1000 | 1.2 gb |
----------------------------------------------------------
8mm tape
----------------------------------------------------------
2.3gb | 2.2 gb | no | 1280 | 158596
5.0gb | 4.9 gb | no | 1280 | 353240
7.0gb | 6.9 gb | no | 1280 | 497420
----------------------------------------------------------
4mm tape
----------------------------------------------------------
2.0gb | 1.9 gb | no | 1280 | 136972
4.0gb | 3.9 gb | no | 1280 | 281152

1. To remotely create an rdump tape, enter:
rdump -0 -u -s -d -f <> \


2. To restore an rdump tape created as above, enter:
cd /
rrestore -rqvf :/dev/rmt0


Moving a file system remotely
One of the easiest methods of moving an entire file system across a
network while preserving permissions, UIDs, and GIDs is to use the tar and
rsh commands. By invoking a tar command on the local system that writes
the created archive to STDOUT, and redirecting that archive output to
STDIN of an extracting tar command running on the remote system, no
temporary file is created.
From the source system, enter:
tar -cvf- | rsh "cd \
tar -xvf-"


Good Luck,
Our greatest duty in this life is to help others. And please, if you can't
V. Nyga
Honored Contributor

Re: How do I check the a DLT-tape´s contents?

Hi,

I never heard about 'cat' a tape.
You have to use the command of the writing process.
As Cem said, there are 3 commands from hp-ux.
But this tape also could be written by another command (from legato or others).
For the fbackup tape you can use the listed options.

See also 'man fbackup'.

HTH
Volkmar
*You really should work at your points assignment: 0 assigned points to 31 responses
is very poor*
*** Say 'Thanks' with Kudos ***
twang
Honored Contributor

Re: How do I check the a DLT-tape´s contents?

To retrieve tape tape from backup using fbackup, you can simply run the following command to verify that the files were copied:

# /usr/sbin/frecover -rNv -f /dev/rmt/0m | more

twang
Honored Contributor

Re: How do I check the a DLT-tape´s contents?

To retrieve tape content from backup using fbackup, you can simply run the following command to verify that the files were copied:

# /usr/sbin/frecover -rNv -f /dev/rmt/0m | more