Data Tape Backup

Hi guys !!!

I’m using openSuse Linux 10.3.

I’m trying to backup my data with a PowerVault 110T Ultrium LTO3, see what is happening:

This is my backup script:

tar -cpv -T /root/files1 -f /dev/st0 >> /var/log/backup/backup-$TODAY.log
tar -cpv -T /root/files2 -f /dev/st0 >> /var/log/backup/backup-$TODAY.log

As /root/files1 and /root/files2 are files containing the directory addresses that I want to backup, beautiful.

If I type a command to list my files in the tape or try to restore my data it shows me just the /root/files2 directories, it seemed that the /root/files1 is not in the tape or maybe it was replaced for the second line directories.

Well, if I run just the first line of my script and type a command to show me the files it shows me all the /root/files1 directories and files … :slight_smile:

Im trying to do this because before I was doing my backup puting all of my directories in just one file and them running the script with just one line.
It seemed to be working properly but it wasnt, I tried to restore my data but it was not working.

I have about 250gb to backup and I think the tape couldnt restore because my backup tree is too big … I talked with my friends and day told me that …

Anybody can help me ???

Thanks a lot !!!

Bob

Not many people have tape drives these days. But when the device file you use (/dev/st0) is a rewinding device, it is clear that a new command will write again from the beginning. You should check if you have more device files pointing to the same drive, but having other properties in the minor number. And then find some docs about what is the rewind and what the non-rewind file.

Or put rewind and unload commands between the two tar commands, to change tape.

in both cases you are setting the location to /var/log/backup/$Today.log
thusly the second line overwrites the first try changing the script second line to read …/backup/back-up-$Today.log2 this should solve the problem.

No, he’s appending to the log, see the >>?

OP, your problem is that you are using the rewinding tape device /dev/st0. This repositions the tape to the beginning when the device is closed so the second tar command overwrote the first record on the tape. If you really want to write two archives on the tape, you have to use /dev/nst0 for the first tar command. (And in general, all but the last tape writing command.) Then the tape will stay in position for the second tar command.

When extracting, you will have to know which “record” on the tape you want and to skip to just before it using the mt command, which has commands like fsf.

If you really wanted all backups to be in one tape record, you will have to do it with a single tar command. There is a -C (change directory) option in tar to help you with this.

Ah tape, now that brings back memories…

I didn’t know the name for the non-rewinding device. So it is /dev/nst0. I know about HP-UX, but there they were in a separate subdirectory /dev/rmt/* and had names like /dev/rmt/0mnb (the same n for no-rewind, and the b for Berkeley behaviour).

Yes, those were the times …