LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-01-2007, 09:10 PM   #1
neocontrol
Member
 
Registered: Jul 2005
Posts: 273

Rep: Reputation: 31
How to write to usb tape drive?


I just ordered a HP Dat 40 tape drive. I found that it is located here - /dev/sg0 from the utilities that i downloaded from HP.

How am I supposed to save data do this thing?
How am I supposed to retreive data from it?

The little bit of searching I have seen things to do such as using the tar commands. Not sure on that one yet, still looking into it.

My other options I have seen is using an array of "sg" commands. Like sg_mnt and more. But I do not have any of those apps / programs / scripts on my machine.

THis is a 64 bit machine with centOS 5.

Can someone point me to some place that has info about this? BTW, i have no manual or anything or I'd have my nose in that already.

Many thanks for any possible help.
 
Old 11-02-2007, 09:58 AM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Does the device file for the tape drive, /dev/sg0, exist? If it exists, then you should be able to access the device with the mt(magnetic tape) command which is used to run some common tasks. mt has several different options but is usually used with the -f option:

# mt -f <device file> <command>

For example:

# mt -f /dev/sg0 retension
# mt -f /dev/sg0 rewind

Also, tape device files usually come in pairs, so you should have a /dev/sg0 and a /dev/nsg0. If you use the sg0 device file, the tape drive will automaitcally rewind after it completes the requested operation. If you use /dev/nsg0, it won't rewind, i.e. the 'n' stands for "nonrewinding". You can access the device through either device file depending on what you want to do.

If you don't have a /dev/sg0 device file for the drive, try manually inserting the necessary scsi modules for the device with modprobe:

# modprobe scsi_mod
# modprobe sg

And then try running some commands with mt to see if you can communicate with the drive.

Once you get communication established with the device through the mt command, you can back up to the tape using the tar command. If you wanted to back your /home directory, you would run:

# tar -cvf /dev/sg0 /home

You can also use the cpio command and there are various other more sophisticate applications like AMANDA that can back up to tape.

That pretty much exhausts what little I remember of tape drives in linux. Good luck.
 
Old 11-02-2007, 10:12 AM   #3
neocontrol
Member
 
Registered: Jul 2005
Posts: 273

Original Poster
Rep: Reputation: 31
Thanks for the reply.

I thought I'd need the mt commands. My system doesn't respond to any mt commands at this moment.

I'll start looking for the tools and respond back here.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using a DDS5 tape drive to restore from a DDS3 backup tape. AndrewCAtWayofthebit Linux - Hardware 1 05-14-2006 09:15 AM
how do i mount a USB tape drive from an old AIX sytem? therapist Debian 7 04-19-2006 12:11 AM
Write privilage with USB drive grenier Mandriva 8 03-12-2005 07:43 AM
USB Flash drive will not let me write. sniperhf Linux - Hardware 1 12-05-2003 02:39 AM
Help with mounting a SONY AIT USB tape drive? Falafel Linux - Hardware 1 11-29-2003 12:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration