Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am using suse10 and facing problem to perform incremental backup in my tape drive, I have tried to take incremental backup using "tar" command but after performing first backup again it go the beginning of the tape and starts writing from there, even I tried using the command:-
$tar -czvf /dev/nst0 /home/(dir name)
but even i am unable to get back my backed up files which I took first.
Have you looked at Amanda or Bacula for the purpose? These are packages made for backups.
Tar would not obviously append to the original tar unless you tell it to. -a option is I guess to append files to the tar archive.
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197
Rep:
You will need to give more detail to get help on that. What did you try? What happened? Was there an error message?
nst0 will be the non-rewinding tape drive. You should use the mt command to get the status and to rewind the tape. Then tar should be able to extract from the tape.
Of course, you could also adopt some actual backup software, but you should understand the tools you are using first (sort of like understanding and being comfortable with hand tools before jumping into power tools). Then maybe try http://wiki.zmanda.com/index.php/Quick_start (after reading a bit more from the rest of the wiki to understand what it is and how it works).
-c will ALWAYS create a new tarball, you need to use the -u (update) flag instead. The -u flag will create a new tarball anyway, if it doesn't exist, but it will concatenate update/new data for existing tarballs.
I first performed my quick erase operation, after that i took backup using command "tar -czvf /dev/st0 /home/bin" after that I gave the command to go to the end of the data i.e., "mt -f /dev/nst0 eod" after that i performed my backup of /etc directory with the command "tar -f -czvf /dev/st0 /home/etc" but after that command when I gave the command to see the list of files on the tape "tar -xzvf /dev/st0" then it was showing only the /etc directory which I took at the second time, So I could not get my /bin dir. which I took at the first set of backup.
So can you guys help me out with this.
The command that moved operations to the end of the previous backup session, should also be able to move you back to the start position. Other than that I would have made the backup like "tar -czvf /dev/st0 /home/bin /home/etc" - it's still easier to extract only certain directories from a tarball, then to mangle with many subsequent tarballs on a tape.
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197
Rep:
Couple of problems. You're mixing the use of st0 and nst0. The first rewinds after use, the second does not. To understand what you are doing, I would do a `mt -f /dev/nst0 status` either before or after every command to see what you are dealing with.
If you stick with the nst0, then you can use mt with fsf and rewind to get where you want, if it isn't already there.
If you want separate tar files for each of those, then just issue the tar commands one after the other using the nst0 device. They will be separate files on the tape. You can see the file position with the mt status command, and use rewind and fsf to position it. Or use soleilarw's suggestion and put them all in one tar (one file).
I'm not sure about the eod. I use eom on solaris. eom positions after the last file mark at the end of the written portion of the tape. So, if you've written one file, it will position at the beginning of what will be the second file. I don't know if eod does the same thing, or if it goes to the end of the written data before the file mark. The result would be quite different. mt status ought to let you know where it is.
Thanks to all of you group member for your support.
I am able to create the another tar ball with the help of nst0, but now here i am getting another problem, after creating first file when i am creating second file and when i am going to see what are the files are there in the media then i am able to see only the files which has been in the first set of tar ball but the second session of tar ball is not visible in the list.
So please can you tell me the solution for seeing the second set of tar ball and also how I can restore the second set of tar ball.
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197
Rep:
It would be helpful if you would tell what command you used and what the output was. When you try to describe it in general terms, what you describe could be interpreted to mean a number of different things, each of which would have a different set of possible answers.
For example, if you did
$ mt -f /dev/nst0 rewind
$ tar -czvf /dev/nst0 /home/dir1
$ tar -czvf /dev/nst0 /home/dir2
$ mt -f /dev/nst0 rewind
$ tar -tvf /dev/nst0
then, of course, the table of contents generated by the last command will only show what is in the first tar file on the tape. However, if you then do
$ mt -f /dev/nst0 status
and find that you are on file position 2 of the tape, then you can do
$ tar -tvf /dev/nst0
again, and you will get the table of contents of the second tar file on the tape.
However, without explicit commands and output from you, it's difficult to tell what you did or what happened.
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197
Rep:
Your use of /dev/st0 versus /dev/nst0 makes no sense. The only place you are using /dev/nst0 (the no automatic rewind version of the tape device) is when you are issuing the rewind command. And what's with the 2000?
Take a look at this thread http://www.linuxquestions.org/questi...nd-file-33514/. It's a bit old, but it covers exactly what you are trying to do. You might also want to read over the `man mt` and `info tar` and see if that helps.
thanks for your help,,,,,,,,,
and that 2000 I have given because the tape drive to perform quick erase and for that I have the no. of bites to be written in the file mark area.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.