Operating System - HP-UX
1820578 Members
2287 Online
109626 Solutions
New Discussion юеВ

Re: how to tar files in hp-ux and detar in redhat linux by tapes

 
SOLVED
Go to solution
cys691018
Advisor

how to tar files in hp-ux and detar in redhat linux by tapes

My workstation is c3600,os is hp-ux b10.20
If you know ,please tell me the detail copying files between hp-ux and redhat linux with tapes.
12 REPLIES 12
Pete Randall
Outstanding Contributor

Re: how to tar files in hp-ux and detar in redhat linux by tapes

On HP-UX:

tar -cvf /dev/rmt/?m file1 file2

On linux:

tar -xvf /dev/rmt/?m


Pete

Pete
spex
Honored Contributor

Re: how to tar files in hp-ux and detar in redhat linux by tapes

Hi,

The default achive file for tar under HP-UX is /dev/rmt/0m. This should be your tape drive. So, to write to /dev/rmt/0m under HP-UX:

# tar cvp /path/to/files

Note that '-c' compresses, '-p' preserves permissions, and '-v' turns on verbose output.

Under Linux, if the device file for your tape drive is /dev/rmt0, then:

# tar xvf /dev/rmt0
will untar files from /dev/rmt0 to the CWD (current working directory). GNU tar strips the leading slash from the file path (unless you supply '-P').

Note that tar is one of the few commands which doesn't require a '-' before its switches.

PCS

Pete Randall
Outstanding Contributor

Re: how to tar files in hp-ux and detar in redhat linux by tapes

According to my man page, the -c option "creates a new archive" - nothing about compression.


Pete

Pete
Van den Broeck Tijl
Valued Contributor

Re: how to tar files in hp-ux and detar in redhat linux by tapes

-z can be added for Gzip compression and -j voor Bzip2 compression. But you'll need the GNU tar version for HP-UX for that to work. To be safe, stick to the default options -cvf and -xvf.
Ivan Ferreira
Honored Contributor
Solution

Re: how to tar files in hp-ux and detar in redhat linux by tapes

Red Hat normally uses the /dev/st0 as the tape device, so you can use:

HP-UX

tar cvf /dev/rmt/0m /directory


Red Hat

List:

tar tvf /dev/st0

Restore:

tar xvf /dev/st0
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Adam Garsha
Valued Contributor

Re: how to tar files in hp-ux and detar in redhat linux by tapes

I used to have to do this kind of thing to move stuff between just about every flavor of UNIX. I've erased the difficulties from my memory, but I remember one pearl:

If you run into problems...

Download the source for GNU tar and gzip and build your own copy on each side. Don't overwrite the OS's versions, install in your own personal cubby. That way tar is tar and gzip is gzip... then you only have to worry about hardware compression and density, etc. (which isn't so bad with DLT stuff, but is probably bad with anything else... unless the drive manufacturer is the same on both sides or you are sneaker-netting the tape drive between boxes).
cys691018
Advisor

Re: how to tar files in hp-ux and detar in redhat linux by tapes

I used the command as follows :
in hp-ux

tar cvf /dev/rmt/3m * "OK"

in red hat linux

tar tvf /dev/st0 "OK"

but

tar xvf /dev/sto "Error"


Errors as follow:
[root@localhost tape]# tar xvf /dev/st0
060427cal.cml
tar: 060427cal.cml: Cannot change ownership to uid 918, gid 4226:
060427cal.cmx
tar: 060427cal.cmx: Cannot change ownership to uid 918, gid 4226:
24b.xtf
tar: 24b.xtf: Cannot change ownership to uid 918, gid 4226:
AutoSave.pml
tar: AutoSave.pml: Cannot change ownership to uid 918, gid 4226:
DAL-hdf
tar: DAL-hdf: Cannot change ownership to uid 918, gid 4226:
DAL-hdf-Abmof.26.3.rst
tar: DAL-hdf-Abmof.26.3.rst: Cannot change ownership to uid 918, gid 4226:
DAL-hdf-Abmof.26.3.rst.cmd
tar: DAL-hdf-Abmof.26.3.rst.cmd: Cannot change ownership to uid 918, gid 4226:

DAL-hdf-Abmof.26.6.rst
tar: DAL-hdf-Abmof.26.6.rst: Cannot change ownership to uid 918, gid 4226: DAL-hdf-Abmof.26.6.rst.cmd

Peter Godron
Honored Contributor

Re: how to tar files in hp-ux and detar in redhat linux by tapes

Hi,
seems your linux machine does not have a user with uid 918, gid 4226. So when you try to change the file ownership it can't do it.
Either create a user as on HPUX or allow the files to be owned by root.
spex
Honored Contributor

Re: how to tar files in hp-ux and detar in redhat linux by tapes

Hi,

tar is complaining because uid 918 and gid 4226 exist on your HP-UX system, but not on Linux. Nothing serious.

Depending on what you plan to use the files for, you could add the missing uid and gid to the Linux system and alias appropriately, 'chown -R user:group ...' on the files, or do nothing.

PCS
Steven E. Protter
Exalted Contributor

Re: how to tar files in hp-ux and detar in redhat linux by tapes

Shalom,

The regular commands have always worked for me on both platforms.

Note that anything done in the tar format can also be unzipped on windows by winzip.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
cys691018
Advisor

Re: how to tar files in hp-ux and detar in redhat linux by tapes

Thanks.
cys691018
Advisor

Re: how to tar files in hp-ux and detar in redhat linux by tapes

I got what I need from the answers in hp forum.