Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie mtio.h question

Status
Not open for further replies.

stoolpigeon

Programmer
Aug 1, 2001
309
US
I have a brand new RH 7.3, Dell Poweredge server- and lots of questions.

I appreciate patience and all help- I am ingesting docs as fast as possible- but a little help along the way is very much appreciated.

I want to be able to us mt w/out having to specify /dev/st0 every time. The man page for mt says that if the TAPE variable is not set then it defaults to whatever is in /usr/include/sys/mtio.h

I need practice w/vi anyways so I dug up mtio.h and changed its default to /dev/st0 instead of /dev/tape (which does not exist on my system)

What do I need to do to get that change to go into effect? Do I need to recompile mt? And- If I do where should I look to find out how to do so?

And is this even the best way or should I set TAPE to the value that I want somewhere?

Thank you in advance,
Ron
 
LOL ;)
Try recompiling the utility after you do that.
From man mt():

This manual page documents the GNU version of mt. mt per­
forms the given operation, which must be one of the tape
operations listed below, on a tape drive.

The default tape device to operate on is taken from the
file /usr/include/sys/mtio.h when mt is compiled. It can
be overridden by giving a device file name in the environ­
ment variable TAPE or by a command line option (see
below), which also overrides the environment variable.

There are easier ways friend. But by all means experiment
that's the beauty of *nix..you CAN.
 
Why not just export the TAPE variable and let the system use the variable instead of recompiling? Recompiling will do the job but you are still hard coded and any change means a new recompile.
 
timsr- where would I do that?

if I use export from the prompt will that be permanent or do I need to add the command to a file that will be run on boot up? If so which file?

I spent most of friday looking for the actual source file to recompile mt and lo and behold it is not on the server. The header file and a read me file are there but mt.c is not.

thanks,
Ron
 
I never suggested that he recompile as a favored solution.
I said there were easier ways to do it and gave him the pertinent section of manpage.

stoolpigeon.
from my earlier post:
"... It can
be overridden by giving a device file name in the environ­
ment variable TAPE or by a command line option (see
below), which also overrides the environment variable.
."
So just setting TAPE=/dev/??? in a startupscript or manually will accomplish what you want. You can also do this ny passing an arg to the mt program.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top