Solved

Remote mount a tape-drive

Posted on 2003-11-04
23
988 Views
Last Modified: 2010-05-18
Dearr all,

I have to extract huge sets of 8mm tapes recorded earlier to do some calculation.
and I only have 2 Sun Machines (very old version, Ulta5 and SPARCStation 20) and 2 tapes drive in my company.

The ultra 5 is connecting to a tape drive but it doesn't have c compiler and the tape driver is not allowed to move. So that I cannot write c program to extract data from tape drive,

What I think is using the SPARCStation 20 to mount the tape driver on ultra5 and read the tapes, meanwhile I am extracting data on the local driver on the SPARCStation 20.

If the tape drive is connected locally and I can read the content of the tape with c program,
e.g. fd=open("/dev/rst0",O_RDONLY)
      itemp=read(fd,bf,2048);

But how to do the for remote case?

Having reference to the following but it didn't stat the anwer clear
www.experts-exchange.com/Operating_Systems/ Unix/Q_11629218.html

Waiting for your suggestion!
Hugo
0
Comment
Question by:hauto
23 Comments
 
LVL 38

Expert Comment

by:yuzh
ID: 9677055
you don't need to mount the tape driver, in Solaris you can use
ufsdump/ufsrestor to access to the remote tape drive
or

tar + rsh

to do the job. that's the short answer for 20 points. do a man to learn more.
0
 

Author Comment

by:hauto
ID: 9679766
yuzh

Thanks for the advice.
I have searched link about ufsdump before posting my question in EE
but still I don't have any idea.

My question again, I want to know how to use the apporaches you suggested to meet my goal? Can you explain more detail.

I mean, can I use ufsdump/ufsrestor to do tasks that I used to do with my C program, e.g.
1. system("mt -f /dev/rst0 rewind")
2. fd=open("/dev/rst0",O_RDONLY)
3. itemp=read(fd,bf,2048);
4. Do some calculation based on the data read out

For the 2nd method
Actually the tape data is not archived using tar and I wonder if I cna use tar+rsh to read the content out
0
 
LVL 38

Expert Comment

by:yuzh
ID: 9683869
Here's a longer answer.

I'll tell you how to do it in a shell command, you can use it in a script, or in your C code use
system("/path-to/yourscript")
Let say you has boxA and boxB, boxB has a tape drive, and you alread setup boxA and boxB
knows each other. (define in /etc/hosts, or NIS/NIS+... etc)

1. use ufsdump/ufsrestore to access a remote tape:
     Edit /root/.rhost in both Client and Server
     at boxA, type in:
     rsh boxB  echo test
     if "test" echoed back to your screen, you permission is OK, otherwise
     check your setup again.

2.  Example for using ufsdump and ufsrestore:
     (IF you boot up boxA from cdrom or boot server, use boxB-IP instead of
      the machine name)
      rsh boxB mt -f /dev/rmt/0 rewind
       /usr/sbin/ufsdump 0cf boxB:/dev/rmt/0n filesystem-name
       (filesystem-name = / , /usr , /dev/dsk/c0t0d0s0, etc)
       
       cd /restore_dir
        ufsrestore rf boxB:/dev/rmt/0n

3. usr tar:
        To copy files to the remote tape driver: (eg, tar )
        $ tar cf - file-list | rsh boxB dd of=/dev/rmt/0n
        To extract files from a Remote Tape drive
        cd /restore_dir
        $ rsh boxB dd if=/dev/rmt/0n | tar xvfp -

        Verify what's on the tape:
        $ rsh boxB mt -f /dev/rmt/0n rewind
        $ rsh boxB tar tvf /dev/rmt/0n
        $ rsh boxB mt -f /dev/rmt/0n rewind

        use can also use cpio to do the job, man cpio to learn more.

The more secure way to do it,  is use ssh + tar, ssh + cpio to do the job.
you can download openssh (+ a lot of free tools, eg GNU gcc etc) from:
         http://sunfreeware.com/

 Have a look at the following page to learn how to use ssh + tar:
         
         http://oldlook.experts-exchange.com/Operating_Systems/Linux/Q_20755213.html
         http://oldlook.experts-exchange.com/Networking/Unix_Networking/Q_20173314.html

        Cheers!
   
0
 

Author Comment

by:hauto
ID: 9684590
thanks for the reply,

I have spent some time to the documentation on sun's web site about nfsrestore.
I wonder if your suggestions fit my case.

For my case, since the 8mm Mammoth tapes are recorded from data stream
and they have are not stored as individual file on tape.

Can I still use nfsrestore to read the content? Also, I have no space to store the content of a tape,
what I am doing on the SPARCStation 20 is read and calculate the result with the use of data structure in C,
then save the result as text file.(which is much smaller in size)
0
 
LVL 38

Expert Comment

by:yuzh
ID: 9684651
ufsdump, or tar should should work for you.

"I have no space to store the content of a tape,
what I am doing on the SPARCStation 20 is read and calculate the result with the use of data structure in C"

Which version of Solaris are you running in the ultra5? the IDE HD is very cheap now?
if the Ultra 5 is running Solaris 7, you can add another 20GB IDE HD to the box, if it is
Solaris 8, add a 60 GB HD.

In SPARCStation 20, you can import soem HD sapce from the Ultra 5 (use NFS mount, setup
as read and write).
0
 

Author Comment

by:hauto
ID: 9685178
I can't change the HD size as it's company's policy, too bad

Let me summary my knowlege to your suggestion and my difficultivity
1. setting .rhosts to let BoxA(SPARCStation 20,) and BoxB(Ultra5) trust each other

2. on BoxA, use ufsrestore to extract one set of data from tape
(I don't know what the output file is since the tape was recorded by writting binary data stream to the tape directory, not file by file)
(BoxA doesn't have ufdump/ufsrestore, it's sun4m )

3. then we get one file on BoxA's directory which is the content of tape on BoxB

4. Use c program to open the file and do calculation
(the c program I've been working calculates the result while the data extraction in progress, but your suggest is to make a output first, then read the output file)
0
 

Author Comment

by:hauto
ID: 9685221
Let me clarify what I am going to do more.

My scenario is to do the calculation while the data is reading out from tape,
but not a post-processing job, which mean extract the whole set of data and then do the calculation.
0
 
LVL 38

Expert Comment

by:yuzh
ID: 9685255
"I can't change the HD size as it's company's policy, too bad"

I mean you add an extra HD in the Ultra 5 and then use NFS mount to mout the HD on the Sparc 20 !!!

HD will run a lot faster than tape !!! (you cann't compare the speed)

IF you are only handle the data file, "tar" is the tool to use. ufsdump/ufsrestore is good
for system level backup, it can handle specify (eg device files), the native Solaris tar can't.

"4. Use c program to open the file and do calculation
(the c program I've been working calculates the result while the data extraction in progress, but your suggest is to make a output first, then read the output file) "

I don't thing you can process the data, while you are extraing it from the tape. the tape is very
slow, you should extra the data to the HD, and then process the data in the HD.

Tape is a sequential access storage device. HD is a random access storage device!
0
 

Author Comment

by:hauto
ID: 9691262
There's no NFS installed on both server
and I don't allow to install anything to these machines

From your explanation, I get a idea about how ufsrestore do.
Without a HD space and I only do the calculation while the tape is being extract.

To sum up, that mean ufsrestore cannot fit my case??

Is there another solution?
How about compiling the c program on a Linux machine having a compiler built to output binary file for solaris?
And put the compiled file to work on solaris??

I will grant you point if you can answer my question

Thanks.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 38

Expert Comment

by:yuzh
ID: 9691472
"There's no NFS installed on both server "

NFS should be there, all you need is to set it up, by edit soem configuration files,
it is very easy to setup, should take < 5 min to do it:

Have a look at :
http://www.ebsinc.com/solaris/network/nfs.html
http://www.sunhelp.org/faq/nfs.html

"How about compiling the c program on a Linux machine having a compiler built to output binary file for solaris?"

the binary compiled in Linux WILL NOT run under Solaris.

With NFS, you can mount the C compiler from the SPARC 20 on the Ultra 5 !!!

IF you boss doesn't allow you to use NFS mount, download the GUN gcc compiler from:
(Free) (download complier + libs)
http://sunfreeware.com/

It should work for you.

Cheers!
0
 

Author Comment

by:hauto
ID: 9701550
I know that originally binary compiled from Linux cannot run on solaris
even solaris 1's binary (a.out format) cannot run on solaris 2 or above(elf format)

However, I find a term calling cross compiler from gnu.org, seems it can do the following
configure and built the gcc in Linux and the binary can be run on solaris(but not on Linux anymore)
0
 
LVL 38

Expert Comment

by:yuzh
ID: 11652652
I can see  any valid reason to refund point for this question, I gave possible solutions for the
question.

at least PAQ with no refund.
0
 
LVL 38

Expert Comment

by:yuzh
ID: 11652929
Add/import extra HD space can be a solution, but the asker said "I can't change the HD size as it's
company's policy, too bad"

I don't know how the company run their bussiness, a IDE HD is very cheap, setup NFS only take
< 5 mintues!
0
 

Author Comment

by:hauto
ID: 11653647
yuzh,

I see your motivation but the real case is my company really not allow me in changing the system config. It's a crucial production radar system used by government
Can you think of another solution?

jmcg,

The data I am working on is radar data, can you tell me more on rmtd?
0
 
LVL 38

Expert Comment

by:yuzh
ID: 11653817
You can try to read the remote tape to stdout in your local box, eg, if the tape is tar format,
you do:

rsh dd if=/dev/rmt/0n | tar tvf -

to see what's in the file, you can use the simliar command for usfrestore, cpio etc.

or use secure shell:

ssh user@remote  "dd if=/dev/rmt/0n "| tar tvf -

I'm work for .edu (.gov) myself, that's why I can't understand a company not allow adding a HD!
0
 
LVL 20

Expert Comment

by:jmcg
ID: 11656615
Sorry, I don't have any details about rmtd on SunOS.

If the tape record boundaries are not an issue, you should try yuzh's suggestion of running 'dd' via rsh or ssh, streaming the data back over the network to your C program. If you know the tape has fixed-length physical records, you need to supply that size as an 'ibs=' parameter to the dd comand (unless it happens to be exactly 512, which I think is still the default).
0
 
LVL 38

Expert Comment

by:yuzh
ID: 11687718
Hi modulo,

     Please keep this question open, hauto need sometime to test
it.

     Thanks
yuzh
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 11858636
PAQed, with points refunded (100)

modulo
Community Support Moderator
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now