Extract data from a NetBackup tape without using NetBackup
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Extract data from a NetBackup tape without using NetBackup
Our tape drive is on a windows server unfortunetly. I have little information about what's on the tape other than I know it was created with Veritas NetBackup. We do not have NetBackup. Is there any way to get the data off the tape without it?
I don't know how the responsibility for this fell on me, but if I don't figure it out I am dead meat
NetBackup uses a modified version of GNU Tar to do backups. So long as what you have was single stream you should be able to pull off the data with the tar you get in Linux because it is also GNU tar.
Of course the above assumes you have a tape drive you can read the data in from.
To see contents you could do something like:
tar tvf /dev/nst0
To extract contents you could do something like:
tar xvf /dev/nst0 (do the tvf above first just so you'll know what you're going to get).
Also NetBackup puts multiple images on tapes. You have to use the mt commands to fsf to next backup image.
nst0 would be your first tape drive's no rewind device. st0 would be the rewind device.
Type the following for more details:
man tar
man mt
Failing all that there are companies like Pivar that will convert data from one medium to another for a fee.
P.S. The reason it fell to you is because everyone knows UNIX/Linux admins are smarter than "certified" M$ admins.
I got side tracked with somone elses problem they had me on. After having a look at those notes it looks kind of ugly. The fact that I have zero experience with tape drives and the fact that they aren't mountable and easy to deal with isn't helping my confidence in porking around on a live system with who even knows how sensitive data. To be honest I might cop out and find an "unofficial" version of netbackup to do this little one time transaction.
Installing NetBackup itself is fairly complex so you will likely end up with issues just getting things going. Add to that the fact that after you installed it you would have to tell NetBackup to scan the tape (a very long process) before it can use it with NetBackup. It hardly seems worth the effort for one tape even for an experienced NBU admin. Also do you even know what version of NBU it was written in?
The commands tar and mt that I listed are native Linux/UNIX commands so you can use them without having NetBackup installed. So long as you use "tar t..." you can't do any damage - it only LISTS the files. It is "tar x..." that actually extracts them.
Every attempt to get at the data on the tape points to it not even being a tar archive. The output was somewhere along the lines of: This is not a tar archive, exiting.
NetBackup is a nightmare in an of itself. The program seems to wnat to do everything BUT simply dump the contents of a tape to a directory.
At this point they've dumped the project onto someone else, but I still would have liked to been able to accomplish SOMETHING from all this.
In the event that the files are not tar files, how do I tell what they are? Is there any way to just look at the files on the tape?
I find it hard to believe that there isn't a way to just dump whatever is on the tape AS IS onto a hard drive.
Try the examples here using dd cmd: http://en.wikipedia.org/wiki/Dd_(Unix).
Also note that they might have gzipped the files during tape write, in which case you need tar tz ... where 'z' means (un)gzip in this instance.
If it was a Unix style backup, you may even have to consider cpio http://en.wikipedia.org/wiki/Cpio, although I believe it's rare to use that these days.
You could even try the file cmd I guess, which is pretty good at guessing what you are dealing with here.
If it was NetBackup it was definitely "tar". How sure are you that it was NetBackup though?
Did you try rewinding the tape with mt command? Running commands with mt to step ahead to next tape mark and trying the tar again?
You could always try "file /dev/<drive>" after rewinding the tape and see if it tells you what kind of header it was.
Also as pointed out by someone else you can try doing a dd off the tape to the hard drive then doing "file" command on the result to see what it thinks it is.
I did point out that trying to get NetBackup installed was going to be more trouble than it was worth.
I did point out that trying to get NetBackup installed was going to be more trouble than it was worth.
Indeed, but my boss insisted.
Unfortunetly they scsi card and tape drive had to be moved to one of the production servers (running windows). They gave me another scsi card so I could connect to the tape drive, but there doesn't seem to be a driver for it anywhere. Ever heard of a magma pci scsi card??
So this whole thing is on hold until I get my hands on another scsi card or convince them to put cygwin on the windows server. What a pain.
I'm not entirely sure the tape was writen with netbackup, it's just what I was told. But one reason it was saying that the file was not a tar archive was that it wasn't rewound. What I would like to do now is just dd it to a hard drive then run file on it. Here's to hoping they have a 200gig hard drive lieing around.
It appears to be an old compatibility matrix that includes RH 9 (Linux Kernel 2.4). If you're using a Linux kernel 2.4x and it is one of the models that says "driver not required" it may be included in your kernel. If it is one of the other models you need to go to the first link and find the driver. If it you're using a 2.6 kernel it may not be there any longer (some things that worked in 2.4 were dropped in 2.6). You'd have to see if Magma could help you out.
We got a new scsi card and I finally had a chance to try something.
I ran this 3 times:
dd bs=65536 if=/dev/nts0 of=/media/sda2/raw_tape_dump/data#
the first two times gave me 1k files that looked like header files. The third was 44G. When I try the file command on it it just says 'data' and tar does not recognise it as a tar file.
So am I screwed?
(edit: actually the first 2 had to be run at bs=1024)
If you run "strings" against the "data" file does it show you anything meaningful?
By the way - in a separate thread someone asked about restoring Windows backups made with NetBackup using GNU tar. On checking with the NetBackup admins list, Curtis Preston, who has written books on the subject, as well as someone else said they've never found a way to read Windows backups of that type on Linux/UNIX.
I used them years ago to extract data from an old Xenix drive. Not sure if they have a way to determine what is on the tape and extract it in a meaningful way but they might.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.