1837655 Members
2921 Online
110117 Solutions
New Discussion

Re: read a tape

 
kacou
Regular Advisor

read a tape

I want to check if a tape contains data. A simple reading. Which command can I execute?

This command can be simply for you but idon't want delete a data on my tape.
hp-ux
(# uname -r
B.11.23
# model
9000/800/rp3440)
9 REPLIES 9
Torsten.
Acclaimed Contributor

Re: read a tape

It's not that easy to get *useful* data from the tape unless you know the stored format.

There are so many (including backup solutions), but all are different.

Of course you may try to start with tar, if you can get some information ...

Reading should not change the information on tape at all.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Jeeshan
Honored Contributor

Re: read a tape

definitly depends upon your backup method or utility used for backup
a warrior never quits
kacou
Regular Advisor

Re: read a tape

someone known the command regarding "make_tape_recovery"?
what is the different whith fbackup
Torsten.
Acclaimed Contributor

Re: read a tape

ignite is using (basically) tar/pax and add a boot header at the beginning of the tape.

fbackup is using it's own format.

As said before, you can try some tools of your choice if they can read it.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Sagar Sirdesai
Trusted Contributor

Re: read a tape

Hi
Use tar command

tar -tvf

Sagar
Dennis Handly
Acclaimed Contributor

Re: read a tape

Here is a link about how to space over the boot header:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1245495
Torsten.
Acclaimed Contributor

Re: read a tape

How to check if this is an ignite tape?

How to read the LIF (boot header)?

See

http://forums12.itrc.hp.com/service/forums/questionanswer.do?threadId=179313

(first post)

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Sharma Sanjeev
Respected Contributor

Re: read a tape

Hi

It Depends how you took backup but mostly you can use tar.

Regards
Sanjeev
Everything is Possible as " IMPOSSIBLE" word itself says I M POSSIBLE
Grayh
Trusted Contributor

Re: read a tape

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,