Operating System - HP-UX
1833934 Members
1773 Online
110063 Solutions
New Discussion

Backing up - Segment ( More Than One Archives )

 
DK Raviraja
Occasional Advisor

Backing up - Segment ( More Than One Archives )

Hi

I would like to have more than one archive in single DAT. What is the archive syntax using TAR. Similarly how to extract the same.

Hint : mt fsf,eof ...?

DKR
Mera Bharath Mahan
5 REPLIES 5
Carlos Fernandez Riera
Honored Contributor

Re: Backing up - Segment ( More Than One Archives )


Yous must use /dev/rmt/0mn special file instead of /dev/rmt/0m.

0mn does not rewind tape , so you can do more that one backup on a sigle tape.

try:

tar cvf /dev/rmt/0mn /tmp/1
tar cvf /dev/rmt/0mn /tmp/2
tar cvf /dev/rmt/0mn /tmp/3
mt -t /dev/rmt/0m rew
tar tvf /dev/rmt/0mn
tar tvf /dev/rmt/0mn
tar tvf /dev/rmt/0mn


unsupported
Rainer_1
Honored Contributor

Re: Backing up - Segment ( More Than One Archives )

use the no rewind device for backups.

tar cvf /dev/rmt/0mn ....

this writes multiple tar backups to one tape.
After rewind (mt rew) you can go to the end of tape with

mt -t /dev/rmt/0mn eod
mt -t /dev/rmt/0mn bsf 1

to add more tar backups.

To get the first backup use

mt rew
tar xvf /dev/rmt/0mn ....

to go to the second backup use

mt rew
mt -t /dev/rmt/0mn fsf 1
tar xvf /dev/rmt/0mn ....

to go to the third backup use

mt rew
mt -t /dev/rmt/0mn fsf 2
tar xvf /dev/rmt/0mn ....

an so on.
DK Raviraja
Occasional Advisor

Re: Backing up - Segment ( More Than One Archives )

Hi guys,

Can you give me two typical examples. I tried your solutions, but it is not working. I don't know where I committ mistake.

So please give example with proper command set

Thanks
Mera Bharath Mahan
Rainer_1
Honored Contributor

Re: Backing up - Segment ( More Than One Archives )

to make it simpler you could add more archives to an existing tar archive.

Make first tar archive with (using default tape device /dev/rmt/0m)

tar cv

Then add next archives with

tar rv

What you get is a single tar archive that has all archives on it.
To restore a file do

tar xv

The disadvantage of this procedure is that tar rv ... must read all the previous data written to tape before adding new data.
Carlos Fernandez Riera
Honored Contributor

Re: Backing up - Segment ( More Than One Archives )


There is no secret. Just use no rewind device

Begin rewinding tape:

mt -t /dev/rmt/xmn rew

write some tar session to tape ( always using no rewind device)

tar cvf /dev/xmn /tmp
tar cvf /var/adm/syslog
.....


then rewind tape

mt -t /dev/rmt/xmn rew

and verify

tar tvf /dev/rmt/xmn
rwx------ .................... /tmp/....
rwx------ .................... /tmp/....
...
tar tvf /dev/rmt/xmn
rwx------ .................... /var/adm/syslog
....


Read this thread too:

http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0xb00a6d96588ad4118fef0090279cd0f9,00.html
unsupported