1829594 Members
2075 Online
109992 Solutions
New Discussion

Tar a folder to tape

 
SOLVED
Go to solution

Tar a folder to tape

I need to get a folder from my server tar to a tape, how can I do this. what is the currect command. Other than the norman back up I naver tar any thing directoly to a tape. When I do a " ioscan -funC disk" I dont see any thig regarding the tape there. so I dot no how to mount the tape.
no personal quote
8 REPLIES 8
Ken Hubnik_2
Honored Contributor

Re: Tar a folder to tape

tar cvf /dev/rmt/0m pathname
Larry Reinhart
Advisor
Solution

Re: Tar a folder to tape

Good morning,

Normally you do not have to mount the tape drive. Do an ioscan -fnC tape to find out the tape device (usually /dev/rmt/0m)
You can then use the following tar command to
tar the folder to tape.
tar -cvf /dev/rmt/0m foldername
the -c option says to create the tar file
the -v says to be verbose
the -f /dev/rmt/0m says where to create it, here it is to tape.

Hope this helps.
Have a GREAT HP day!
Larry :-)
Jeff Schussele
Honored Contributor

Re: Tar a folder to tape

Hi,

To determine tape device, do the following:

ioscan -fnC tape

Then do the command as above...although the default output for the tar command IS the tape drive - so you could just do

tar cvf /path/to/dir

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Sean OB_1
Honored Contributor

Re: Tar a folder to tape

You don't see your tape in the ioscan because you are asking to show disks only.

Try: "ioscan -fnC tape"


In any case you'll most likely need to run the following command.

tar -cvf /dev/rmt/0m /folder/to/tar

0m is the tape device file that you use to write to the tape.

the "cvf" options state create a new tar, show verbose output, and send the data to the file I'm listing next. In this case the file is "/dev/rmt/0m". The you put the directory, or folder, you want to tar.

HTH,

Sean

Re: Tar a folder to tape

Thanks for the help. One moer question do I need to rewind the tape or something before I run the tar command. If os whatis that going to be.

Thanks
no personal quote
Darrell Allen
Honored Contributor

Re: Tar a folder to tape

Yes, you should rewind the tape:

mt -t /dev/rmt/0m rewind

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Mihails Nikitins
Super Advisor

Re: Tar a folder to tape

Please note that rewind issue depends on what device file you use (rewind or no-rewind).

In HP-UX, if device name does not contain 'n'(such as /dev/rmt/0m), tape rewinds after each command working with the device file. If device device contains 'n' (like /dev/rmt/0mn), the tape does not rewind and remains on the position writing has been finished. No-rewind device is a good option if you want to add files with more commands.

If you insert the tape in your drive, it positions on the beginning and no rewind is needed. I rewind the tape if I'm unsure about the previoius operations with the tape and want overwrite everything.

BR,
Mihails

KISS - Keep It Simple Stupid
Elif Gius
Valued Contributor

Re: Tar a folder to tape

Hi

You can even tar a folder to a "tar depot" on your filesystem.
++++++++++++++++
tar -cvf tar_depot dir_to_save

tar -cvf /dev/rmt/0m file1 file2 file3 -> to save different files


tar -cv -C /etc -C /var/adm ->this will archive files from /etc and /var/adm to tape
++++++++++++++++