TAPE drive

I have used ioscan -fnC tape and the system identified the tape drive. what is the command to show a listing of what is on the tape? I have used ls /dev/rmt/rmt0 to no avail. can anyone help?

Thanks in advance

Welcome Randydog,

What are you expecting to be on the tape? It rather depends what it was written with.

You could try some of the following:-

tar -tvf tape_addr
dd if=tape_addr of=/large_filesystem/filename
restore -ivf tape_addr
cpio (not sure on the options)

I would have expected the first tape drive on your server to be at address /dev/rmt/0m or similar. Does that match what you have?

Regards,
Robin

thanks for the quick responce. yes /dev/rmt/0m is the first in the directory. I am trying to install software from the tape drive. I first want to see what is on the tape to verify it has on it what I need. I was on wondering if it could be as easy as ls /cdrom. I have to mount and umount the cdrom and I don't know if I have to do something similar for the tape drive with is external.

You can consider a tape as a single giant file of fixed size and unknown type, which can only be read beginning-to-end. You can't mount it, and how to use its contents depends on what it actually holds.

"tar" is a good guess -- that's short for "tape archive", a standard UNIX utility which gets used for a lot more than tapes but is still relevant here. If the tape holds a tar, then rbatte1's first instruction should help you, as "tar -tvf /path/to/device" is about as close as you can get to "ls" for a tarball.

It will have to read the entire tape to list all the contents, though! tar is not a filesystem, and a tape drive can't seek in the middle.

I'll give that a try, thanks!

---------- Post updated at 04:54 PM ---------- Previous update was at 03:23 PM ----------

So, I did the tar -tvf /dev/rmt/0m and I received a tape drive error. Any suggestions to correct the error. I know the drive exists because when I ioscan tape it shows up.

Received what tape drive error? Be specific. Please show us exactly what you did and exactly what happened.

I entered: tar -tvm /dev/rmt/0m the system returned: Tar: tape read error

Thanks in advance for you help

I've added ICODE tags to your text to make the command and output clearer like this:-

Do you actually mean the command: tar -tvf /dev/rmt/0m instead? I would think that the m flag would error anyway. This would suggest that it is not a tar format tape. What install instructions do you have? There is probably a clue in there. Maybe it's just extracting an installer script that we can then examine. What do you have from the supplier?

Robin

I actually did use tar -tvf /dev/rmt/0m

sorry for the FAT finger

The m option is probally a type or?
I would do following, en look what can read the tape:

mt -f /dev/rmt/0m rewind && echo ok
mt -f /dev/rmt0m status && echo okidoki
tar -tvf /dev/rmt/0m 
cpio -itv /dev/0m

dd if=/dev/rmt/0m of=/tmp/0m.dd #should always work to read the tape
                             of=/dev/null #just test reading

#If you have hp-ux software on tape, you can use swinstall directly or use swcopy
#to check have it on disk as well. 
swcopy -s /dev/rmt/0m \* @ /full_path_to/depot
swinstall -s /full_path_to/depot -x patch_match_target=true SOFTWARENAME
1 Like

turns out it was a bad tape drive