Operating System - HP-UX
1747993 Members
4993 Online
108756 Solutions
New Discussion юеВ

Data Wipe on tapes using dd

 
John Talaga
Advisor

Data Wipe on tapes using dd

Hello all,

I am attempting to wipe all data on some AIT5 tapes before we send them back to the manufacturer. To do this, I have been using a combination of:

dd if=/dev/zero of=/dev/rmt/cXtXdXBEST bs=1024k
dd if=/dev/random of=/dev/rmt/cXtXdXBEST bs=1024k

There have been a few issues with running it this way up to this point.

Initially, I had these commands in a single script in which I rewind the tape, run one pass with dev/zero, rewind the tape, run a second pass with dev/zero, rewind the tape, run a third pass with dev/random and offline the tape.

Here is some log output from the above script.

Beginning script at: 13:13:57
Rewind Tape

Running first pass of dd with dev-zero at 13:14:20
5245292+0 records in
5245291+1 records out
I/O error
Rewinding Tape

Running second pass of dd with dev-zero at 13:38:36
26394+0 records in
26393+1 records out
I/O error
Rewinding Tape
/dev/rmt/c23t0d0BEST: No such device or address

Running third pass of dd with dev-random at 13:39:04
/dev/rmt/c23t0d0BEST: No such device or address
dd: cannot create /dev/rmt/c23t0d0BEST
/dev/rmt/c23t0d0BEST: No such device or address

Script Completed at: 13:39:08

*This log output was before I had begun specifying block size as 1024k*

As you can see, for some reason the tape drive is unresponsive after the second run of dd. After a small amount of time, I can again access the tape.

After struggling with this for a bit, I decided to run each dd separate on the command line, which has been (seemingly) working. However, each time I run dd with dev-zero, even for the same tape and block size set at 1024k, it reports drastically different 'records in' and 'records out' when it is finished.

My questions are these:

Is there a reason why dd would not work in succession in a script?

Why would dd report different records in and out when running it multiple times from the command line?


Thank you so much for your help.
8 REPLIES 8
Steven E. Protter
Exalted Contributor

Re: Data Wipe on tapes using dd

Shalom,

I use a high powered magnet. That does the job. At my last employer, disks and tapes, which were considered as disks were physically destroyed, lest they have recoverable data.

Is there a reason why dd would not work in succession in a script?

The media has some variance on it, or was not completely rewound.

Why would dd report different records in and out when running it multiple times from the command line?

Perhaps the media has been used too many times and is wearing out. Tape is a sequential media and how the erase goes depends on what was on the tape in the first place. The second erase on the same type might get different results because the first erase changed the end of data point on the tape.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
OldSchool
Honored Contributor

Re: Data Wipe on tapes using dd

I'm assuming you've got a problem w/ media and are preparing to send them back (for a refund or whatever)?

if that's the case, consider that a) you already have a problem w/ the media, and b) your attempting to write on the said problematic media so no one else can read it. If that's the actual case, I'd expect to have problems as well.

As SEP noted, consider a strong magnet. We actually have a degauser made for this application (forget where we got it).

or consider physical destruction of the media (strip out the tape a shred it)....although I doubt you'd be able to return it to the manufacturer in that case

Dennis Handly
Acclaimed Contributor

Re: Data Wipe on tapes using dd

>it reports drastically different 'records in' and 'records out' when it is finished. cXtXdXBEST

Does your tape have hardware compression? That would give different number of records, in addition to stopping early on I/O errors.
Sameer Kelkar
Advisor

Re: Data Wipe on tapes using dd

John Talaga
Advisor

Re: Data Wipe on tapes using dd

Hi all,

Thanks for the thoughts everyone. To further clarify, these tapes were recalled because they have an expected failure in 2 to 3 years. I am not sure if the tape itself is faulty at this point. The tapes themselves are fairly new and have not been used but for 6 months or less, being written to once or twice a month.

Physically destroying the tape is not an option (although I wish that was an option!). Degaussing the tapes is an interesting suggestion, but one that I don't really have the time or resources to pursue.

Hardware compression is enabled on the tape, but would the records in/out be different every time the command is run?

Sameer -- I will attempt your command and reply with the results.

Really my lengthy first post boils down to this: Because of the vastly different records in and out reported by dd, I am worried that not all data is being overwritten on the tape.
Dennis Handly
Acclaimed Contributor

Re: Data Wipe on tapes using dd

>I am not sure if the tape itself is faulty at this point.

You may want to remove compression from the equation.

>Hardware compression is enabled on the tape, but would the records in/out be different every time the command is run?

It will be different for the zero vs random.

>Because of the vastly different records in and out reported by dd, I am worried that not all data is being overwritten on the tape.

You may want to try reading it, that should be the same.
John Talaga
Advisor

Re: Data Wipe on tapes using dd

Everyone,

Thank you much for your assistance. After much analysis, it appears that the tape drive itself is at fault here. When I get a new drive to replace this one, I will again test multiple dd commands in succession, and I suspect there will be no problem.

Thank you again.
Bill Hassell
Honored Contributor

Re: Data Wipe on tapes using dd

The tape driver may not be able to handle a pending I/O for the length of time it takes to rewind. I am fairly certain that the automatic rewind returns immediately which means the next dd will try to start an I/O on the busy drive. I would follow each dd with a pause+mt command looking for BOT status:

dd if=/dev/zero of=/dev/rmt/cXtXdXBEST bs=1024k
STATUS=""
while [ "$STATUS" = "" ]
do
sleep 1
STATUS=$(mt -f /dev/rmt/cXtXdXBEST status | grep -i BOT)
done
# next dd command...


Bill Hassell, sysadmin