APLawrence - Information and Resources for Unix and Linux Systems, Bloggers and the self-employed
RSS Feeds Get APLawrence.com by RSS











(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Home > News Posts > dd to and from tape; using diff to compare
Printer Friendly Version




News Group Posts

dd to and from tape; using diff to compare


See dd also.

From: Tony Lawrence <tony@pcunix.com>
Subject: Re: Edge backup with Seagate Travan tape.
Date: Tue, 19 Nov 2002 12:08:20 -0500

Ulven wrote:
> ahh...
> 
> Here's the correct version:
> 
> # dd if=/etc/termcap of=/dev/rStp0
> 288+1 records in
> 288+1 records out
> # dd if=/dev/rStp+ of=/termcapcopy
> dd: cannot open /dev/rStp+: No such file or directory (error 2)
> # dd if=/dev/rStp0 of=termcapcopy
> 289+0 records in
> 289+0 records out
> # diff /etc/termcap termcapcopy
> Warning: missing newline at end of file termcapcopy
> 3477a3478
> 
> something wrong here... does this tells you anything?
> 




It tells me you don't understand dd :-)

If you want to test something like that, do it like this:

cp /etc/termcap /tmp/this
tar cvf /dev/rStp0 /tmp/this
rm /tmp/this
tar xvf /dev/rStp0
diff /tmp/this /etc/termcap

The problem with using dd for this is the differing blocks- notice you 
get 288 full blocks plus a PARTIAL block going out to the tape, but the 
tape can only give you full blocks back. - therefore there is null data 
in the read, and that naturally won't pass diff.


> 
> 
> 
> "Bill Vermillion" <bv@wjv.comREMOVE> wrote in message
> news:H5t2B3.1I62@wjv.com...
> 
>>In article <arbp8v$2720$1@news.dataguard.no>,
>>Ulven <freddy@REMOVESPAMulven.com> wrote:
>>
>>>Hi Bill.
>>>Here's the resault:
>>
>>># dd if=/var/log/backup.txt of=/dev/rStp0
>>>1+0 records in
>>>1+0 records out
>>>#_
>>
>>Who knows how bitg backup.txt is.  I just suggested /etc/termcap
>>as it is decent size.
>>
>>The concept is to use dd to put a file to tape. 'if' is the name of
>>the input file and in this case  'of' is the name of the tape.
>>
>>The we reverse this and use 'if' for the tape devcie and 'of' for
>>the name of the file we will create as data is taken from the tape.
>>
>>Then we compare, using diff, to see if the contents of the file
>>we put on tape match what we just took off the tape.
>>
>>
>>>Then:
>>># dd if=/dev/rStp0 of=/var/log/temp
>>># pwd
>>>/var/log
>>># ls
>>>backup.txt
>>># _
>>># diff /etc/termcap termcapcopy
>>>diff: cannot stat termcapcopy: No such file or directory (error 2)
>>
>>You have to diff the files you put to tape and take from tape.
>>
>>I said  eg  dd if=/etc/termcap   eg meaning 'for example.  It's a
>>standard reference but perhaps I should have said   e.g. - but
>>everyone seem to skip that now.
>>
>>--
>>Bill Vermillion - bv @ wjv . com
> 
> 
> 














-- 


Tony Lawrence
Unix/Linux Support Tips, How-To's, Tests and more: http://aplawrence.com
Free Unix/Linux Consultants list: http://aplawrence.com/consultants.html


If this page was useful to you, please click to help others find it:  

Your +1's can help friends, contacts, and others on the web find the best stuff when they search.

Comments?




More Articles by



Click here to add your comments



Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments


If you want a picture to show with your comment, go get a Gravatar



Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

Jump to Comments



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.

Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.

We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.

pavatar.jpg

This post tagged:

       - Backup
       - Shell
       - Tape Drives
       - Troubleshooting




Unix/Linux Consultants

Skills Tests

Guest Post Here