- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Wiping Disks: more than /dev/zero ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 04:39 AM
06-21-2002 04:39 AM
Ideally, management wants three layers of garbage on the drive. I would like to write a layer of zero, than a layer of ones, then another layer of zeros.
What would I do to get something like a '/dev/one' ?
Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 04:43 AM
06-21-2002 04:43 AM
Re: Wiping Disks: more than /dev/zero ...
has management considered formatting the drives using command mediainit. This can also be run from the support CD I believe.
cheers
John.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 05:57 AM
06-21-2002 05:57 AM
Re: Wiping Disks: more than /dev/zero ...
I would suggest writing a simple C program to do this for you.
Attached is an example. If you don't know C, have someone check it for you - I haven't any way to test it. It compiles on my UNIX box here, though.
Good luck!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 06:09 AM
06-21-2002 06:09 AM
Re: Wiping Disks: more than /dev/zero ...
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 06:11 AM
06-21-2002 06:11 AM
Re: Wiping Disks: more than /dev/zero ...
I have used mediainit in the past, and afterwards, the drives it was used on are flaky. The mean-time-to-failure afterwards is usually less than 1000 hours in my experience. Since all my systems are covered by a contract, and I used a HP provided command, they were replaced by HP. I would prefer not to have to deal with the associated downtime this time around. (I realize there could be other factors that caused those disks to fail, but I don't want to go through that again.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 06:16 AM
06-21-2002 06:16 AM
Re: Wiping Disks: more than /dev/zero ...
C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 06:17 AM
06-21-2002 06:17 AM
Re: Wiping Disks: more than /dev/zero ...
you might wish to read this thread which covered this type of issue once before.
cheers
John.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 06:29 AM
06-21-2002 06:29 AM
Re: Wiping Disks: more than /dev/zero ...
opps forgot to paste the thread
John.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 06:33 AM
06-21-2002 06:33 AM
Re: Wiping Disks: more than /dev/zero ...
I was wondering... Since your management is so keen on protecting the company's data, are your computers locked up in a vault? At highly secure government sites, the computers are locked in a vault along with the users. Do you find this uncomfortable?
Marty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 06:40 AM
06-21-2002 06:40 AM
Re: Wiping Disks: more than /dev/zero ...
I realize I could use mediainit, but like I mentioned before, I do not wish to use it.
Thanks for the replies so far, but I am really looking for something similar to /dev/zero, but for 'ones'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 07:06 AM
06-21-2002 07:06 AM
Re: Wiping Disks: more than /dev/zero ...
cat /dev/zero | tr '\0' '\377' | dd bs=64k of=/dev/rdsk/cXtYdZ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 07:16 AM
06-21-2002 07:16 AM
Re: Wiping Disks: more than /dev/zero ...
I dont see how you can create a /dev/one device file. However, you can simulate it.
eg. if you do;
dd if=/dev/zero of=/tmp/0 count=1
Then look at /dev/zero it looks like this;
512 bytes /tmp/0
if you cat it it looks like this;
cat /tmp/0|vis
\000\000\000\000....... (full of null zeroes)
You can count up the characters like this;
cat /tmp/0|wc -c
and the result is 512 bytes again.
So, now we can create a /tmp/1 file like this;
let x=0;while [ $x -lt 512 ]
do
let x=$x+1
echo "\001\c" >>/tmp/1
done
If you check the resulting file is looks like this;
512 bytes /tmp/1
You can verify its contents again by doing;
cat /tmp/1|wc -c
and the result is 512 bytes again and you can view it with;
cat /tmp/1|vis
and it looks like this;
\001\001\001..... (full of ones)
So /tmp/0 and /tmp/1 are the same (except one has zero nulls and the other one nulls).
Now, how to use dd from this instead of a /dev/one file. You need to use the oseek option which means skip a record on the output device (a disk or a flat file) for each iteration, depending on how big your disk is. eg. if diskinfo says your disk is 4000000 kbytes then divide 4000000000/512 to get the number of iterations to run (4000000 * 1000 / 512 bytes);
let x=0;while [ $x -lt 7812500 ]
do
let x=$x+1
dd if=/dev/one of=/dev/rdsk/cxxxxx oseek=$x
done
Ive tested it on an old disk here, worked fine. This would take a long while to run but you could write just a random pattern of ones if you wanted (just as good) by increasing x by say 10 instead of 1 (or even increase it by a random number!).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 07:17 AM
06-21-2002 07:17 AM
Re: Wiping Disks: more than /dev/zero ...
Clay - if you cat /dev/zero and pipe output into vis you will see that its not all \000 so I dont think your tr command will work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 07:22 AM
06-21-2002 07:22 AM
SolutionI think you have the answer though Clay - this works a treat;
cat /dev/zero | tr '\000' '\001' | dd of=/dev/rdsk/cxxxxx bs=64k
This will keep running until end of device (end of the disk) and you will get an I/O error, but it works fine. Tested it on output to some files, output same as my previous long winded answer but much simpler!
And you can substitute \001 for whatever you want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 07:34 AM
06-21-2002 07:34 AM
Re: Wiping Disks: more than /dev/zero ...
Now here is my plan for each disk (non-vg00) to wipe:
1)# mknod /dev/zero c 3 0x000003
2)# chmod 444 /dev/zero
3)# dd if=/dev/zero of=/dev/rdsk/cXtYdZ bs=64k
4)# cat /dev/zero | tr '\000' '\001' | dd of=/dev/rdsk/cxxxxx bs=64k
5)# dd if=/dev/zero of=/dev/rdsk/cXtYdZ bs=64k
Because of the I/O error associated with the commands, this process would be manual and not scripted.
Thanks again !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 07:43 AM
06-21-2002 07:43 AM
Re: Wiping Disks: more than /dev/zero ...
If you are running 11.11 you should already have /dev/zero. If not, do this to create it:
# mknod /dev/zero c 3 0x000003 #...on 10.20
# mknod /dev/zero c 3 0x000004 #...on 11.x
# chown bin:bin /dev/zero
# chmod 666 /dev/zero
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 07:58 AM
06-21-2002 07:58 AM
Re: Wiping Disks: more than /dev/zero ...
Why the 'chmod 666', shouldn't 444 suffice ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 08:08 AM
06-21-2002 08:08 AM
Re: Wiping Disks: more than /dev/zero ...
No reason other than I made it look like /dev/null, but in the case of /dev/zero readonly permissions are perfectly fine!
/No Points Please/
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 10:27 AM
06-21-2002 10:27 AM
Re: Wiping Disks: more than /dev/zero ...
Not to be nit-picky but a tr '\000' to '\001' is only flipping 1 bit whereas a tr '\000' '\377' flips every bit. There appears to be a bug in tr in that it behaves differently if reading input from a pipe.
cat /dev/zero | tr '\0' '\377' is broken
but
tr '\0' '\377' < /dev/zero works perfectly (and is more efficient to boot). I should have tested my 'off the cuff' idea but it was so neat I just had to post it as soon as I saw the thread.
Anyway, this command should work AND flip all your bits to '1'.
tr '\0' '\377' < /dev/zero | dd bs=64k of=/dev/rdsk/cXtYdZ
-------------------------------------------
Now as to whether any of this process to 'wipe' disk makes sense ....
Regards, Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 10:40 AM
06-21-2002 10:40 AM
Re: Wiping Disks: more than /dev/zero ...
BTW, I stumbled on this. With regard to leaving write permissions on or off, try this with your /dev/zero file:
# chmod 666 /dev/zero
# cat /etc/hosts > /dev/zero
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2002 04:16 AM
06-22-2002 04:16 AM
Re: Wiping Disks: more than /dev/zero ...
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x81b73a7b3682d611abdb0090277a778c,00.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2002 07:21 AM
06-22-2002 07:21 AM
Re: Wiping Disks: more than /dev/zero ...
If you create a /dev/zero c 3 3 on 10.20,11.0, or 11.11 they all display the garbaged output stream. I have absolutely no idea why
cat /dev/zero | tr produces a little garbage and yet tr < /dev/zero works perfectly.
On 11.x, Major device 3 Minor device 4 works perfectly.
The funny thing is that a minor device 3 3 can (rather than the proper 3 4) be created on 11x
and the device behaves like the 10.20 3 3 device. Sadly, if you attempt a mknod /dev/zero c 3 4 on 10.20 the device is non-functional so the best you can do on 10.20 is to create a 3 3 device but accept that it's not perfect.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2002 07:36 AM
06-22-2002 07:36 AM
Re: Wiping Disks: more than /dev/zero ...
I reduced the problem to it's simplest form:
For any /dev/zero with device numbers 3,3
cat /dev/zero | dd bs=1k count=2 | od -c
produces garbage but
dd bs=1k count=2 if=/dev/zero | od -c
is perfect. I still have no idea why.
The good news is that that for 11x mknod /dev/zero c 3 4
produces perfect results everytime.
Note: mknod /dev/zero c 3 4 on 10.20 produces a non-functional /dev/zero.
Regards, Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2002 02:52 PM
06-22-2002 02:52 PM
Re: Wiping Disks: more than /dev/zero ...
in case your idea of writing zeros then one then zeros to a disk is to make the contents of that disk absolutely unrecoverable, your wrong!
Physical Desaster Recover companies will still be able to read the data as it was previusly written to the disk...
The simple reason is that the write-head of the disk does not (never) exactly overwrite the old track but moves over the center of that track but not exactly the center of the track.
If I remember right, then you need about 17 (seventeen!) overwrites of the same track to be *certain* you cannot recover any data!
And even then I would recommend to alternatively write 0x55 and 0xAA patterns...
Just my $0.02,
Wodisch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2002 07:40 AM
06-24-2002 07:40 AM
Re: Wiping Disks: more than /dev/zero ...
I never stated it had to be totally unrecoverable, just that my client's management wanted the disk to be overwritten 3 times. They understand that *anything* can be recovered, they just want to make sure that who ever is going to try that has to jump through some hoops.
I've read theory white papers about methods that can read disks well after the 17 overwriting as well. The more $$$ you have to dispose, the more options you have to recover it. Unless of course you melt it ;)
I would like to say thanks again for all the responses, and see you on the boards!