Simple tape drive questions
Hi,
I am new to using tape drives in linux, and have a couple potentially very dumb questions. I am using tar to back up various directories to tape. I understand how to do this, and how to move the tape to next file etc... My first question is how to overwrite data on the tape? I will use an example for this. I tar a 100 MB folder onto a tape (using /dev/nst0). I then tar a 50 MB folder to the same tape (using /dev/st0). Then next day/week/whenever, I want to re-backup those folders, BUT, the 100MB folder is now 60MB. Do I need to fully erase the tape before I do this? Or can I just tar the folder over the current one? If yes, how does the tape know where to fast forward to when I ask it to fast forward to the 2nd file? How does this work? Please assume that the tape is not large enough for me to simply add the directory after the first 2 tar archives. A second question, after archiving the 2nd folder (the 50MB one) using /dev/st0, does it rewind to the beginning of the tape or the beginning of that file? Before anyone tells me to use google, I would like to say that I have. I have also looked in several linux books and have not found my answers. So I also ask for any links or book recommendations that have good info/tutorials about tape drives in linux. For other people who may later view this post, here are the best resources I have found: http://nic.phys.ethz.ch/readme/80 http://baheyeldin.com/linux/using-ta...e-network.html Oreilly Essential System Administration - 3rd Edition Thanks. |
By default, tar will find the end of tape marker (EOT) before it starts writing to a tape. You need to put an EOT marker at the beginning of the tape before you can use the full capacity of it via tar. I use the mt command to do this.
Code:
mt -f /dev/st0 retension When using the auto-rewind device socket (/dev/st0) any tape operation will rewind to the physical beginning of the tape when the utility finishes. That includes the tar command or the dd command or whatever else you might use to manipulate data on the tape. Here is a site explaining the use of the mt command. http://www.computerhope.com/unix/umt.htm I found it using Google. :) I couldn't resist. To be fair I already knew that I was looking for the parameters of the mt command. Unfortunately the computer that I'm using to write this doesn't have the mt utility installed so there is no mt man page on this computer either. :( However if your system has the mt utility installed then there should also be a man page for that utility. Code:
man mt Code:
dd if=/dev/urandom of=/dev/st0 bs=10240 count=1000000000 |
Thanks for the reply. It was very helpful and answered all my questions.
|
All times are GMT -5. The time now is 11:09 AM. |