Operating System - HP-UX
1847248 Members
2600 Online
110263 Solutions
New Discussion

Erasing the contents of a tape

 
Marwan Shantir
Occasional Contributor

Erasing the contents of a tape

Dear All,
how can I erase the contents of a tape in order to take a new backup on this tape?
Sun Solaris, we used to write mt erase but what to write in HP-UX?
Thanks
7 REPLIES 7
Pete Randall
Outstanding Contributor

Re: Erasing the contents of a tape

There is no need to erase - the new backup will over-write the previous one.


Pete

Pete
Borislav Perkov
Respected Contributor

Re: Erasing the contents of a tape

Hi,
You can do
tar cf /dev/null
or
dd if=/dev/zero of=
that will destroy the header.

regards,
Borislav
Peter Godron
Honored Contributor

Re: Erasing the contents of a tape

Marwan,
no seperate command to erase tape.
If you really worried about security, either degauss the tape or fill the whole tape with a random character file.
A new backup onto the same tape will overwrite existing data.
Regards
Dani Seely
Valued Contributor

Re: Erasing the contents of a tape

Hey Marwan,
To destroy the TOC / tape header, do the following:

# tar cvf /dev/rmt/0

The best way is to write some other data across the whole length of the tape and then do the tar cvf /dev/rmt/0 to initialize.

Or, try this to overwrite the data:
dd if=/dev/zero bs=8000k of=/dev/rmt/0m.
Together We Stand!
Marwan Shantir
Occasional Contributor

Re: Erasing the contents of a tape

hey guys,
Thank you all for the reply.
But What I understand from the replies is that any backup is takeno on the tape would erase the previous contents on the tape?
But the question here is, if I want to add some new contents beside the existing contents how can I do it?
Thanks
Marwan
Peter Godron
Honored Contributor

Re: Erasing the contents of a tape

Marwan,
to add a backup to an existing tape you first have to get to the end of the prvious backup with the mt command and then add the new backup from there on.
man mt will give you the details.
Regards
Paul_481
Respected Contributor

Re: Erasing the contents of a tape

Hi,

Fbackup only support one archive per tape, you cannot append the backup.

If you use tar you can append the archive.

man "mt" for details on how to manually rewind the tape.

Regards,
Paul