LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-22-2009, 01:58 AM   #1
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Rep: Reputation: 37
USB TapeDrive support and tar


Hi,

don't know where to post this, in software or in hardware? Because the questions will have a little bit of both.

Ok, first, let's start with USB TapeDrives. How well are they supported in Linux? Are there any problems, like drivers etc? Or is it better to use standard "build-me-in" tapedrive?

Now onto tar. I've used tar many times...for files, but never on a tapedrive.
How to use it?
tar -x /dev/{tapedrive} files ?
How to append new stuff to the tape?
tar -Ax /dev/{tapedrive} files ?

On man page:
Quote:
-d, --diff, --compare
find differences between archive and file system
What exactly does it meen differences between archive and file system?

Again on man page:
Quote:
--delete
delete from the archive (not for use on mag tapes!)
Does this mean that you can not delete certain files from the tape archive?

Then I'd need to pull out, file by file from the tape, check it with the new version of the file(programatically) and add new differences from the newer file back to the tape archive. How to achieve this?

Regards,
Thomas
 
Old 10-22-2009, 11:36 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
You can find answers about using the tape drive here.

Google should be of help in solving the problem of how to delete files from the tape.
 
Old 10-24-2009, 03:28 PM   #3
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
The first thing to get clear on is that a tape drive is a sequential device, not a random access device like a disk drive. What that means is that you write it from beginning to end and read it from beginning to end. You can do things like fast forward and backward to file marks, and you can rewind. But, in particular, when writing to the tape, you write to the end of the data on the tape. If you write to an intermediate point on the tape, then that becomes the end. You have essentially wiped all data beyond that point. So, . . .

While tar refers to tape files and has the ability to manipulate and change those files, it cannot do those things to a file on a tape. You would have to read the file off the tape, manipulate it, and then write it back out to the tape. In so doing you would either append it to the tape or overwrite what's already on the tape. That's not typically what people use tapes for.

`man mt` would give you the sorts of operations you can do on a tape. The previous link given by bigrigdriver gives you how to put it all together. Note, however, that the device name you use for the tape drive affects how it behaves. /dev/st0 is a rewind device, which means it will rewind after each operation. If you write a file to it, and then in a separate command write another file to it, it will rewind in between and end up overwriting the file. Use /dev/nst0 to avoid that behavior. The "n" refers to the non-rewinding device. Same tape drive, just different driver behavior.
 
Old 10-25-2009, 03:40 PM   #4
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Original Poster
Rep: Reputation: 37
So if I get this right, even if I'm doing recursive backups only of changed files to a tape-drive, every way I turn it, I'll end up with 2 file versions on that tape? (except if I read all and re-write all data on that tape, which I would rather avoid)
How about data recovery then? Can I hunt it down by date-time of writing the data on the tape, or will I just have to guess, which file is newer?
 
Old 10-25-2009, 05:34 PM   #5
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
If you are doing incremental to the tape, you can assume the later file on the tape is newer. You could track what is on the tape by keeping a catalog file on disk. Gnutar will generate that for you from the tar file. This is basically what programs like Amanda do for you automatically. When you do an amrecover, for example, it is looking at the catalog files while you navigate through to what you want to recover. When you ask it to go ahead and do it, it tells you what tape to load and reads the appropriate records. Depending on what you want, Amanda may be overkill for you, but you can find out more about it here http://wiki.zmanda.com/index.php/Main_Page, if you are interested.
 
Old 10-25-2009, 05:43 PM   #6
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Original Poster
Rep: Reputation: 37
Thank you both for lots of information. I'm sure it will be useful for me.
As for Amanda...good to know that it exists, and I'm sure I'll learn much from it, but it's not an option for me at the moment.
 
Old 10-25-2009, 06:09 PM   #7
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
one thing is tape drives are VERY outdated
and have been since the mid 1990s or earlyer and external harddisks are so cheap and reliable that it would be better to just get one of those
 
Old 10-26-2009, 03:04 AM   #8
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Original Poster
Rep: Reputation: 37
Quote:
Originally Posted by smeezekitty View Post
one thing is tape drives are VERY outdated
and have been since the mid 1990s or earlyer and external harddisks are so cheap and reliable that it would be better to just get one of those
They may be outdated, but still many systems use TapeDrives. And for testing purposes, I'd scouted a USB TapeDrive. As for hard disks, they are way less reliable than magnetic tapes. An electric surge can damage the disk, while the electric surge can at worst damage the tapedrive and the current tape inserted, as for the other tapes, they stay intact, so you may loose maybe a week of backups, if you're not backing up enormous amounts of data.
No surge protecting hardware will protect you from a direct lightning strike.
 
Old 10-26-2009, 07:03 AM   #9
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
Quote:
Originally Posted by smeezekitty View Post
one thing is tape drives are VERY outdated
and have been since the mid 1990s or earlyer and external harddisks are so cheap and reliable that it would be better to just get one of those
That's a very opinionated response. A lot depends on your environment and requirements. I have several departments that have fairly new, latest technology, tape libraries. We run a 6 week cycle of nightly tapes that handle backups for substantial networks of servers. They are also used for periodic archival tapes. That is in addition to having lab computers backed up to the server's hard drives, and having ZFS running nightly snapshots for the semester on multi-terabyte raid arrays (raidz2 [which is similar to raid 6] with a hot spare) for classroom and student lab data.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
TapeDrive hb21l6 Linux - Hardware 3 07-28-2008 06:00 AM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 02:53 AM
GUI support tar.gz/tar/gz/bz2 and etc demmylls Linux - General 3 10-09-2003 07:43 PM
Tapedrive to logout crashes captgoodnight Linux - General 0 03-30-2002 10:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:48 PM.

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