
What is the best way to wash a disk? I tried this but it is taking forever. dd if=/dev/zero of=/dev/sdg1 Thanks

On 09/02/2013 02:56 PM, David Zuccaro wrote:
What is the best way to wash a disk?
I tried this but it is taking forever.
dd if=/dev/zero of=/dev/sdg1
Thanks
In years past I successfully used mdsos 3.1 or 5.6 to clean hard drives, just changed the partitioning information for each install and rebooted pc before installation completed, then installed Linux of choice. Linux re partitioning then seemed to remove any chance of finding coherent data even from the hidden Microsoft filesystem on the inside tracks of the hard drive. Roger

On Tue, 3 Sep 2013, 09:53, Roger wrote: } On 09/02/2013 02:56 PM, David Zuccaro wrote: } > What is the best way to wash a disk? } > } > I tried this but it is taking forever. } > } > dd if=/dev/zero of=/dev/sdg1 } > } > } > Thanks } > } } In years past I successfully used mdsos 3.1 or 5.6 to clean hard } drives, just changed the partitioning information for each install and } rebooted pc before installation completed, then installed Linux of } choice. Linux re partitioning then seemed to remove any chance of } finding coherent data even from the hidden Microsoft filesystem on the } inside tracks of the hard drive. } Roger I know of one scenario where an NT4 system had been taken offline and locked in a cupboard for three months, was deemed to be of no further use, and subsequently got reformatted with ext3 (or maybe ext2 - it was Redhat 7-ish). Of course, the minute that happened, someone called up wondering why their website was offline! (You can't make this stuff up - website offline for three months, and they notice _on the day the disk is wiped_). Naturally, they needed it fixed ASAP as it was fundamental to a presentation they were giving the following week. So, the tech reinstalled NT4 again (by this stage, the disk had now been formatted twice). Then, with an assortment of forensic tools, blood, sweat & tears, and a week of sleepless nights, somehow managed to retrieve about 90% of the data! Crisis averted. T.

On 2 September 2013 14:56, David Zuccaro <zuccaro.david@gmail.com> wrote:
What is the best way to wash a disk?
I tried this but it is taking forever. dd if=/dev/zero of=/dev/sdg1
Hi David There may be better ways to erase a disk, see for example https://ata.wiki.kernel.org/index.php/ATA_Secure_Erase but the topic of this message is just how you might be able to get dd to run faster. In my experience dd runs slowly in this situation due to using its outdated default blocksize of 512 bytes/block. It is easy to check this. Here is a demo of how to do it. I used of=/dev/null to test these commands here without writing to an actual disk. You could do that to, and then to get valid data you will need to change that to of=your_actual_device so that data gets written to a physical disk. (Something like the /dev/sdg1 you mentioned above, but be sure to confirm your desired target partition yourself carefully as it will be specific to your system, and you don't want to wash the wrong partition, as you probably know already!). First run dd in the background with the default blocksize, and save its PID in a shell variable: # dd if=/dev/zero of=/dev/null & pid=$! Then immediately (ie while the previous dd command is running in the background) run this # while true ; do kill -USR1 $pid ; sleep 10 ; done which will send the USR1 signal to the running dd process every 10 seconds, and it will display a progress report and average data transfer rate on the terminal, that will look something like this: 8957122+0 records in 8957121+0 records out 4586045952 bytes (4.6 GB) copied, 11.8519 s, 387 MB/s so you can see the data rate, here 387 MB/s for the meaningless demo exercise of writng zeros to /dev/null. Writing to an actual disk will have a more realistic slower MB/s as the zeros actually traverse your SATA bus to the physical disk. When you have seen enough of that, press control-C to abort the "while" command. And then to stop the dd background process, you must do this, otherwise it will run forever because /dev/null will never fill up: # kill -s TERM $pid That completes test #1. Next run a second test, with a bigger blocksize. In my experience larger than 4k gives no benefit so I use bs=4k. Again, for useful data you will need to change of=/dev/null to your actual disk, but you can do a practice run with of=/dev/null so long as you don't forget that the number you get is meaningless. You would start dd like this: # dd if=/dev/zero of=/dev/null bs=4k & pid=$! and the rest of the commands would be the same as above. Try this with your physical disk as a target, and compare the MB/s values to see if the larger block size gives any improvement.

On Tue, 3 Sep 2013, David <bouncingcats@gmail.com> wrote:
That completes test #1. Next run a second test, with a bigger blocksize. In my experience larger than 4k gives no benefit so I use bs=4k. Again, for useful data you will need to change of=/dev/null to your actual disk, but you can do a practice run with of=/dev/null so long as you don't forget that the number you get is meaningless.
I've just done a test on a system with a 500G SATA disk where sda2 is near the start of the disk (sda1 is /boot). In this case cat (which uses a buffer size of 64K) was slightly faster than dd with a 1MB block size. For a casual user the amount of time spent typing and verifying the dd command line would probably be significant when compared to the <30s data transfer so cat would be a better option. # time dd if=/dev/zero of=/dev/sda2 bs=1024k dd: error writing ‘/dev/sda2’: No space left on device 2049+0 records in 2048+0 records out 2147483648 bytes (2.1 GB) copied, 29.4816 s, 72.8 MB/s real 0m29.483s user 0m0.000s sys 0m1.824s # time cat /dev/zero > /dev/sda2 cat: write error: No space left on device real 0m26.553s user 0m0.016s sys 0m1.448s -- My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/
participants (5)
-
David
-
David Zuccaro
-
Roger
-
Russell Coker
-
Tony Crisp