LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 07-27-2006, 12:13 AM   #1
angelfire
LQ Newbie
 
Registered: Jul 2006
Posts: 13

Rep: Reputation: 0
How to remove some files from tape


I just try to erase the tape but it take along time so i want to remove only some files in there for more space.
Can I do that and how ?

Thanks...
 
Old 07-27-2006, 12:44 AM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Presumably by scrolling (rewinding/fast-forwarding) the tape into the correct position after which deleting (writing null?) over the wanted data..

Actually my only contact with tape drives has been when I created a small backup-scriptlet-system for a small server, so it doesn't help much but the above is what I could think of..
 
Old 07-27-2006, 12:45 AM   #3
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
A tape drive is not a random-access media. As I understand it, your data must be continuous. (I may be wrong, but a quick google makes me believe this)
 
Old 07-27-2006, 04:27 AM   #4
angelfire
LQ Newbie
 
Registered: Jul 2006
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks i just testing and now i understand. so I want to ask
if I starting with tar command for backup a file and next day i want to backup another file at that time I must use
mt with fsfm Forward space count files The tape is positioned on the last block of the previous file.
for a next file right?
 
Old 07-27-2006, 04:51 AM   #5
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
perhaps each write makes an eof marker. then when a new data is to be written, the tape searches for the last eof mark then writes data after it. that's just an idea.
 
Old 07-27-2006, 05:03 AM   #6
angelfire
LQ Newbie
 
Registered: Jul 2006
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks very much now i'm trying
 
Old 07-27-2006, 05:14 AM   #7
angelfire
LQ Newbie
 
Registered: Jul 2006
Posts: 13

Original Poster
Rep: Reputation: 0
Konsolebox!
First I use tar cvf /dev/st0 test
then I use mt -f /dev/st0 eof
or mt -f /dev/st0 weof
or mt -f /dev/st0 wset

and then i use tar tvf /dev/st0 to view the content of tape, I see nothing

so how do i can set eof for this file and make a backup for next file

Last edited by angelfire; 07-27-2006 at 05:15 AM.
 
Old 07-27-2006, 05:20 AM   #8
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
ouch! hey i told you that it was just an idea . try to find some manuals with google. do search 'linux tape' and sometimes also add the word 'howto'. that might help you.

i don't have and i haven't seen yet a tape btw.
 
Old 07-27-2006, 05:30 AM   #9
angelfire
LQ Newbie
 
Registered: Jul 2006
Posts: 13

Original Poster
Rep: Reputation: 0
yes i just testing now
 
Old 07-27-2006, 05:47 AM   #10
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
I considered this tape thing again, reading Matir's post. Then I recalled this Windows software Veritas Backup Exec for Windows, which allows you to restore only certain files from the tape. Ok. That's where I think the illusion came; but if we think about how a tape works (like a sound tape, it's basically the same thing):

to put something on it (record), you have to rewind it so there's tape left first. Then recording is started - the tape is scrolling while the data (like sound) is recorded. Once the tape is at the end or somebody stops recording, tape stops. Then I can rewind again, press play and listen to the stuff that was recorded on it; I can even stop in the middle of the recording, press recording on and start adding new content, but if it isn't exactly the length of the old data, it either overwrites something I didn't want it to, or stops too early leaving some old data after it.

The data indeed has to be continuous, if the data tapes are like any tape is (and I think this is the case, like Matir noticed). It means the data can be read from anywhere inside the stream (and if there are EOFs or some other marks, a computer program would know when to stop reading, thus making it possible to copy certain files off the tape), and even recorded, but the new recorded data may not be the same size as the "original" one, so it leads to corrupted data streams (either data streams, or "files", without a start or without a proper end or EOF) unless the newly written data is exactly of the same length than the original one.

A simple example: let aaabbbccc be the contents of a tape, with three files, aaa,bbb and ccc. For simplicity, let's not think about EOFs or other stuff alike, let's just imagine your pc knows where the files end and where they begin.

Now if you wanted to replace the file bbb with a newer file ddd, and they were exactly of the same size, you'd get aaadddccc which includes three perfect files. Yes, trick done.

If you instead wanted to replace the file bbb with a smaller file ee, the result was aaaeebccc where there would be a broken piece of file, b. No good.

If you instead wanted to replace the file bbb with a larger file ffff, the result was aaaffffcc, and again you would have a broken piece of file, cc this time. No good again.

Conclusion: from a data tape, single files can be read out but not written in, unless you have a tool that can move all the rest of the data forward on the tape, and that means actually re-recording the tape all over from the point where the added new file ends. I'm not aware if such a software exists, and even if it does, it'd sound easier for me to just write at the end of the existing data and once the tape is full, start from the beginning (or buy a new one; the tapes are cheaper than the valuable information on them, and if they're not -- you think the tapes are too expensive -- you really don't need a backup system really)

EDIT: A backup is usually a backup of some certain moment of time. Thus updating only some files on the backup sounds odd, since the other content is not of the same age, so actually it's not a backup, but a copy storage.

Last edited by b0uncer; 07-27-2006 at 05:51 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 10:15 AM
remove log files suresh77 AIX 3 05-04-2006 11:10 AM
Remove directory w/ files kfrancisco Linux - Software 13 10-02-2003 02:40 AM
Remove Files by Datestamp seanloftus Linux - General 1 07-28-2003 06:04 PM
I use taper to backup files to my tape drive, but how come i cant access it like cdro adamrau Linux - General 0 11-29-2001 09:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 04:13 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