Operating System - HP-UX
1829961 Members
2019 Online
109998 Solutions
New Discussion

How can I erase the content of a DDS tape?

 
SOLVED
Go to solution
Rui Vilao
Regular Advisor

How can I erase the content of a DDS tape?

Greetings,

Simple question what is the command
I can use so I can be sure that the old content of a tape is deleted.

TIA,

Best Regards,

Rui.
"We should never stop learning"_________ rui.vilao@rocketmail.com
8 REPLIES 8
MANOJ SRIVASTAVA
Honored Contributor
Solution

Re: How can I erase the content of a DDS tape?

Hi Rui

tar cvf /dev/rmt/0 with no files defined initializez the start of the tape , but the you can always do a dd to get what is written after some skips . I can only think is the perfect way is to write some other data across the whole lenght of tape and then do the
tar cvf /dev/rmt/0 to initialize the start.

Also I dont know whether you can initialize media thorugh specific software , but some of them do format a tape.

Manoj Srivastava
Vincenzo Restuccia
Honored Contributor

Re: How can I erase the content of a DDS tape?

#mediainit /dev/rmt/0m
Joseph C. Denman
Honored Contributor

Re: How can I erase the content of a DDS tape?

Check the manual on "dd"

dd if=/dev/null of=/dev/rmt/0m
If I had only read the instructions first??
A. Clay Stephenson
Acclaimed Contributor

Re: How can I erase the content of a DDS tape?

If I wanted to be absolutely sure I would do something like this:

dd if=/dev/zero bs=8000k of=/dev/rmt/0m.

You might have to create the /dev/zero device node but unlike /dev/null, /dev/zero will provide an unlimited number of ASCII NUL characters.

Clay
If it ain't broke, I can fix that.
Carlos Fernandez Riera
Honored Contributor

Re: How can I erase the content of a DDS tape?


1- fast erase:
mt -t /dev/rmt/0mn eof # see man mt
But this only write a filemark on media ( i still dont know how to skip this end of media).

2- Hola Clay:
dd if=/dev/zero of=/dev/rmt/0mn is a great idea, but.... how may millions of Gb of zeros must be compressed? Better use a no-compression special file ( see man mksf or lssf).

3- /dev/null is a spcial file for output ( bit eater), not for input (/dev/zero). So it same to >/dev/rmt/0mn.


Regards to all

unsupported
Shannon Petry
Honored Contributor

Re: How can I erase the content of a DDS tape?

The mt command WILL NOT WRITE ANYTHING TO TAPE! Read the man pages! This command is ONLY for tape positioning! Fast erase....Phah!

If you only want to rewrite the header of a tape (this means that a crafty person with a special Tape drive could still get the data)..
Either use...
>touch /tmp/junk
>tar cvf /dev/rmt/#mn /tmp/junk
or put a file to the tape that is small and you dont care...
> tar cvf /dev/rmt/#mn /etc/hosts

If you want to blank the tape then the only real option is to either put a null file to the tape over and over until the tape is full, or put lots of good data to the tape untill it's full
I.E.
> I=2
>while [ "${I}" -ne "1" ] ; do
>dd if=/dev/null of=/dev/rmt/#mn bs=512
>done
Note, that when the end of media is reached, you will not get an error for dd, so you will have to guess and ^C from the loop.

or...
>I=2
>while [ "${I}" -ne "1" ] ; do
>tar cvf /dev/rmt/#mn /dev/null
done
tar error will come up at the end of media asking for a null then enter to quit or a new device to tar to...

Regards,
Shannon
Microsoft. When do you want a virus today?
Volker Borowski
Honored Contributor

Re: How can I erase the content of a DDS tape?

Hoops,
this has been discussed some days ago...
anyway, here is my solution again ;-)

telnet localhost chargen | dd of=/dev/rmt/0m bs=1k

Volker
Volker Borowski
Honored Contributor

Re: How can I erase the content of a DDS tape?

Hi Shannon,

sorry to say: I go with Carlos !
(from "man mt" on HP-UX 11.0):

mt accepts the following commands:
eof WRITE count EOF marks.

Be carefull, if you ever use Solaris (mt erase):
erase :
Erase the entire tape. Erasing a tape
may take a long time depending on the
device and/or tape. Refer to the device
specific manual for time details.

Volker