Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


useing a dat on solaris 8

Posted on 2003-02-25
Medium Priority
Last Modified: 2013-12-27
How do I access my dat tape drive
on my UNIX box?

I need to know the way to write files to it
and how to recover them. I am running Solaris 8.

Should I just use tar and write to the device?
how do I determine the device name. What is the
best way.

How do I control the tape rewind and forward

Question by:thedogeater
LVL 18

Accepted Solution

liddler earned 200 total points
ID: 8015524
assuming you've done a boot -r to build the device tree, the default device is /dev/rmt/0.  tar should work fine, as it uses this devices as default.
mt fsf (magnetic tape fast forward)
mt rew (magnetic tape rewind)
mt offline (magnetic tape eject)
mt fsf 2 (fast forward two volumes, if you've used ufsdump to write / , /usr, /var, /opt to a dat this would move you the begining of the /var volume on the tape.


Assisted Solution

Otetelisanu earned 200 total points
ID: 8015618
1. tape drive connect and on
2. drvconfig (start as root)
3. mt -f /dev/rmt/0n status
4. if OK then start tar or other command(ufsrestore)
5. mt -f /dev/rmt/1n status


Expert Comment

ID: 8022265
I assume that you can see the tape drive. (Another user stated to use <drvconfig> that use forgot to also issue <devlinks> and then <tapes>.  This method is depricated.)

For Solaris 8 and newer, use one step <devfsadm>.

Once you can see the tape ( mt -f /dev/rmt/0n status ) with a tape in the drive.

Now to answer your question as to the method used for copiying data to and fro your tape.

I would suggest ufsdump to backup your system.

I would suggest ufsrestore to resotre your system(read the man page especially concerning the -i option for interactrive restore)
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

LVL 38

Assisted Solution

yuzh earned 200 total points
ID: 8023768
Here's what you can do to use your tape drive:

   Assume you want to use the non-rewind tape device /dev/rmt/0n
   Information about tape device can be found:

   You can use tar, usfdump, cpio, dd to copy date to the tape.

   The base tape operation command is the "mt" command

     Tape rewind:
     # mt -f /dev/rmt/0n rewind
     Print Tape status
     # mt -f /dev/rmt/0n status  
     forword the tape over count EOF mark (x times)
     # mt -f /dev/rmt/0n fsf x

     man mt
     for more details


     use tar to backup files to the tape:
     tar -cvf /dev/rmt/0n file-names
     To verify what's on the tape (assume tar format)
     mt -f /dev/rmt/0n rewind
     tar -tvf /dev/rmt/0n
     to restore (assume the file name use related path)
     cd /myrestore-dir
     tar xvf /dev/rmt/0n
     man tar
     to learn more details.

     PS: tar is not suitable for system level backup, not for copy special files, such as device files etc. for normal file is ok.

     For system level backup and restore, use ufsdump and ufsrestore.

     eg: backup a file system to the tape:
          /usr/sbin/ufsdump 0cf /dev/rmt/0n /export
          will dump the whole /export file system to tape.

         To verify what's on the tape:
         mt -f /dev/rmt/0n rewind
         ufsrestore tvf /dev/rmt/0n
         To restore it:
         mt -f /dev/rmt/0n rewind
         cd /myrestore-dir
         /usr/sbin/ufsrestore xvf /dev/rmt/0n

         do a man ufsdump and ufsrestore to learn more.



Expert Comment

ID: 8025570
I agree with yuzh.  I just wanted to add that you may want to buy/go to a bookstore and look at O'Reilly's "Unix Backup & Recovery" book (1999, W. Curtis Peterson author) if you are going to be doing any significant work in backup and recovery.  There is a LOT of good stuff in there.  You can look at http://www.oreilly.com/unixbr/ for more info on the book.

--- M
LVL 18

Expert Comment

ID: 10425949
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Points split liddler, Otetelisanu & yuzh

Please leave any comments here within the next four days.


EE Cleanup Volunteer

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses
Course of the Month15 days, 12 hours left to enroll

580 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