You are not logged in.

#1 2012-12-08 16:08:48

wudu
Member
Registered: 2010-03-08
Posts: 70

dd to wipe partiton, data gets read after write?

Hi,

want to wipe a partition on my hdd. Doing this with dd if=/dev/urandom of=/dev/sdxx and get ~10MB/s (it's a WD green 2TB in USB2 external case). I tried different bs values (2048, 4096, 1M, 4M, default) but nothing helped.

Now I saw in conky that mot of the time read and write speeds are identical. So I assume that the data gets read after write, is that possible? I also tried it with shred, same behavior on read/write except it's a bit slower ~8MB/s. Perhaps this has to do something with USB. Of course I could connect with SATA directly for wiping but the problem then stays for later when I want to use it as external device...

Any suggestions?
Thanks in advance.

Offline

#2 2012-12-08 22:13:47

Tarqi
Member
From: Ixtlan
Registered: 2012-11-27
Posts: 106
Website

Re: dd to wipe partiton, data gets read after write?

Thats probably caused by /dev/urandom. Check you CPU load while dd-ing.


Knowing others is wisdom, knowing yourself is enlightenment. ~Lao Tse

Offline

#3 2012-12-09 10:45:12

wudu
Member
Registered: 2010-03-08
Posts: 70

Re: dd to wipe partiton, data gets read after write?

Thanks, you're right the core dd was running on was on 100%. Nonetheless I'm wondering why conky showed the same speed for read and write.

Offline

#4 2012-12-09 13:05:14

R00KIE
Forum Moderator
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 3,117

Re: dd to wipe partiton, data gets read after write?

wudu wrote:

Nonetheless I'm wondering why conky showed the same speed for read and write.

Because dd has to read the data it is going to write from somewhere.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#5 2012-12-09 14:06:49

brebs
Member
Registered: 2007-04-03
Posts: 3,414

Re: dd to wipe partiton, data gets read after write?

wudu wrote:

data gets read after write

To check the hard drive's setting:

hdparm -R /dev/sda

From man hdparm:

-R     Get/set  Write-Read-Verify  feature,  if  the drive supports it.

Offline

#6 2012-12-09 16:24:49

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,045
Website

Re: dd to wipe partiton, data gets read after write?

If the random generator is too slow you can try frandom instead of urandom.
Here is the wiki page about the topic in general, in case you did not already read it.
https://wiki.archlinux.org/index.php/Securely_wipe_disk

Offline

#7 2012-12-12 05:39:29

wudu
Member
Registered: 2010-03-08
Posts: 70

Re: dd to wipe partiton, data gets read after write?

Thanks for these replies.

@ROOKIE Mh, thats not the case since the data gets read fom /dev/urandom.
@brebs Doesn't know that there are settings/drives supporting that. Good to know but it says "write-read-verify = not supported"
@teateawhy Lready done with urandom but always good to know that this exists.

So I'm still curious whats going on. And now I can say that it still happens with filesystem on that drive while copying files.
Got read = write = 30MB/s copying files from internal SATA connected to external USB 2.0 connected HDD. So overall 60MB/s what I assume it should be but just writing...
Same when using dd with /dev/zero as source just slightly faster.
Finally reading speed is ~85MB/s which seems to bee the USB 2.0 limit, so this works like expected.

Thanks again and perhaps someone can (help me) solve this.

Offline

Board footer

Powered by FluxBB