Operating System - HP-UX
1833807 Members
3875 Online
110063 Solutions
New Discussion

Copy/restore file to/from tape

 
SOLVED
Go to solution
Mauro Gatti
Valued Contributor

Copy/restore file to/from tape

I'd like to use tape drive such as disk device.
Is it possible copy and restore files to/from tape using a simple group of commands like cp, mt etc.?

Thank You
Ubi maior, minor cessat!
20 REPLIES 20
Olav Baadsvik
Esteemed Contributor

Re: Copy/restore file to/from tape


Hi,

You can not expect to use a tape drive
as disk device.
A tape drive is sequential while a disk
device is direct access.
For a tape-device you must use commands like
tar, fbackup/frecover, tcio ...

Regards
Olav
Sebastian Galeski_1
Trusted Contributor

Re: Copy/restore file to/from tape

Hi
for tape use: tar, cpio, dd
or for backup fbackup command

regards seba
Mauro Gatti
Valued Contributor

Re: Copy/restore file to/from tape

I've a lot of files (about 700-800MByte of dimension for each one) and I want to "copy" these files on a tape drive without using any backup software (like omniback).
Does anybody have an idea to do this?
I've seen tar does not
support the archival of files larger than 2GB...
Ubi maior, minor cessat!
RAC_1
Honored Contributor

Re: Copy/restore file to/from tape

fbackup supports file larger than 2GB. If your concern is files larger than 2GB you can use fbackup or GNU tar.

GNU tar supports files larger then 2GB.

Regards,
There is no substitute to HARDWORK
T G Manikandan
Honored Contributor

Re: Copy/restore file to/from tape

you can try using gnu version of tar which does not have limitation backing up files greater than 2 GB.


http://hpux.asknet.de/hppd/hpux/Gnu/tar-1.13.25/
Elif Gius
Valued Contributor

Re: Copy/restore file to/from tape

Hi,
like the others said, the best would be to use fbackup or GNUtar. Even dump is a good way to backup large files.
Bart Beeren
Advisor

Re: Copy/restore file to/from tape

Hi,

If you're files are only 700-800 MB each, you can also put them on tape one-by-one (off course automated in the script) by using "normal" tar. It's maybe easier for retrieval of the files or for getting a list of all the files on tape.

Regards, BB
Life isn´t as simple as it seems
Mauro Gatti
Valued Contributor

Re: Copy/restore file to/from tape

Using "normal" tar i tried to put my file using device file without rewind (device with "n") using a script.
Now I must find how read entire tape to get list of files...
Ubi maior, minor cessat!
steven Burgess_2
Honored Contributor

Re: Copy/restore file to/from tape

Mauro

To rewind the tape

mt -t /dev/rmt/0m rew

echo $?
0 if succesful
1 if not

To read the contents of the tape and send it to a file

tar -tvf /dev/rmt/0m > /tmp/index.out

HTH

Steve
take your time and think things through
steven Burgess_2
Honored Contributor

Re: Copy/restore file to/from tape

Hi Mauro

Is that ok for you ?

Steve
take your time and think things through
Mauro Gatti
Valued Contributor

Re: Copy/restore file to/from tape

I'trying to read tape contents...
Ubi maior, minor cessat!
Mauro Gatti
Valued Contributor

Re: Copy/restore file to/from tape

This read only one file on tape...
Could I read the tape looking for written files without know how many files there are?
Ubi maior, minor cessat!
steven Burgess_2
Honored Contributor

Re: Copy/restore file to/from tape

Hi

Can you post the output of your initial tar command

Steve
take your time and think things through
James R. Ferguson
Acclaimed Contributor

Re: Copy/restore file to/from tape

Hi Mauro:

A free utility is 'fbackup'. 'fbackup' supports files larger than 2GB, and writes an index on the tape which can be read by 'frecover' to rapidly create a tape directory listing. While you cannot append to a tape, you can easily select files for copying to tape using "graphs". Directories and/or files can be included and excluded for copies. Have a look at the man pages for 'fbackup' and 'frecover' for more information.

Regards!

...JRF...

Fred Martin_1
Valued Contributor
Solution

Re: Copy/restore file to/from tape

I use cpio for all of our file backups.

To backup:

# cat filelist | cpio -ocuvB > /dev/tapedevice

To restore:

# cpio -iBdcvm "filename(s)" < /dev/tapedevice

To list whats on tape:

# cpio -ictBv < /dev/tapedevice

A 'man' on cpio explains all the details on switches. 'tapedevice' would be your tape drive, whatever that is.

Fred
fmartin@applicatorssales.com
Raynald Boucher
Super Advisor

Re: Copy/restore file to/from tape

Funny thing...
I just learned about "ftio" yesterday: It is developed specifically for copying files to and from tapes.

Test at our shop have revealed major performance gains over tar, fbackup and cpio.

man ftio

Take care.
R.Mielen
Advisor

Re: Copy/restore file to/from tape

Ok lets try this

WHen writing to tape did you append the files
when copying them one by one or did you override the file after you wrote the first file to tape.

if tape = /dev/rmt/0m
then u can use simple commands like

mt rew = rewind tape
mt eof = clean tape
mt offl = spit out tape from device

copying more files at once:
tar -cvf /dev/rmt/0m file1 file2 file3

Reading from tape:

tar -tv (when tape is /dev/rmt/0m )
I haven't failed, I only found 10,000 way's that won't work
Mauro Gatti
Valued Contributor

Re: Copy/restore file to/from tape

Hi Steve, this is the tar output:

virgo# tar -tvf /dev/rmt/0m > /tmp/index.out
Tar: blocksize = 1

Ubi maior, minor cessat!
Mauro Gatti
Valued Contributor

Re: Copy/restore file to/from tape

Do You know if esists ftio for Linux?

Ubi maior, minor cessat!
A. Clay Stephenson
Acclaimed Contributor

Re: Copy/restore file to/from tape

The fundamental answer to your question is no, at least in HP-UX. If you do an ls -l /dev/rmt you will notice that all the device nodes are character devices and that there are no block devices. A few flavors of UNIX did support block devices and had tape based filesystems. You had to format the entire tape and then do a makefs on it. You could then treat it just as you would any other filesystem. You cp, rm, mv, ls, mkdir ... commands worked just as you expect but they were, of course, slow as molasses.
If it ain't broke, I can fix that.