Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dd command

Status
Not open for further replies.

kHz

MIS
Dec 6, 2004
1,359
US
What would be the syntax using dd to read a file from a tape that has multiple files on the tape.

For example, if a tape has 100 files on it in a directory listing like:
/home/user/aa.dbf
/home/user/ab.dbf
/home/user/ac.dbf
/home/user/ad.dbf
/home/user/ae.dbf

What would be the dd command to read only ac.dbf and save it to disk?

example:
dd if=/dev/rmt0 of=/tmp/ac.dbf (or what?)
 
correct command is not "dd", but normally cpio or tar. (eventually with a pipe from "dd")

How were the files placed on the tape on the first place?

Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
IBM Sysback was used to backup the data. However, the person trying to do a restore of a needed file is running into a problem that is asking him to insert the second tape even though it only backed up files to one tape.

So I was hoping to use dd to at least see if the file exists on the tape. If so, I was *hoping* to send it to a file and then use Sysback to restore the data using the file name that dd was dumped to.

Not sure if that is at all possible but wanted to try it since there is only one tape and it keeps asking for the second volume. In theory my solution should work. But, I don't have enough disk space to run a dd on the entire tape so I wanted to select individual files, if possible for the tape.

Thanks!
 
I think the right command to read a SysBack volume is sbread

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
It is sbread. I am thinking of using seek and count with dd. sbread does work, but the problem is that the file IS on the tape, but when a restore is attempted it is asking for tape 2. There isn't a tape 2 and have no idea why it is asking for that.

My theory is to run dd and send it to a file. The dd from the file and send it to a new tape and restore from the new tape with only the files needed to restore.

I did a test by backing up /tmp with SysBack and then viewed the files with SysBack, followed by a dd to a file, then a dd from file to a different tape. Then SysBack was able to read the tape and display the files. Hopefully this works with database files. It should though. In theory!

Thanks for the replies.
 
dd if=/dev/rmt0 of=/tmp/ac.dbf (or what?)

dd if=/dev/rmt0 of=/tmp/tapeimage

Yes this will work, then you execute sbread with the /tmp file.
 
So I can dd to a file and then use sbread from the file without having to do a dd back to tape? That is one less step. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top