verify (read and write) sectors at a harddisk ( for example after wipe )

Hello

the last days i have wiped a harddisk with a nwipe.
now i want to test if the sectors are correct overwritten with random data or better at the end with the blanking pass.

to do that i have used

root@host:~$ dd if=/dev/sda of=testSector count=1 bs=512 skip=848234
root@host:~$ ls -lah testSector 
-rw-r--r-- 1 root root 512 Mai 9 20:51 testSector

where 848234 is the Sector Number in that example

the result is

root@host:~$ cat testSector | od -o
0000000 000000 000000 000000 000000 000000 000000 000000 000000
*
0001000

that means the disk is at that sector successfully blanked 😉

 

Hint: to write some random data to this sector you can use the seek option

dd if=/dev/urandom of=/dev/sda  count=1 bs=512 seek=848234
root@host:~$ dd if=/dev/urandom of=/dev/sda count=1 bs=512 seek=84234
1+0 Datensätze ein
1+0 Datensätze aus
512 bytes copied, 0,000171533 s, 3,0 MB/s
root@host:~$ dd if=/dev/sda of=testSector count=1 bs=512 skip=848234
root@host:~$ cat testSector | od -o
0000000 152264 101766 076373 004631 135374 176667 050103 073263
0000020 003573 113101 054520 134473 050305 161767 062320 122631
0000040 112241 040731 164452 151325 110756 103712 122175 007127
0000060 106677 111246 151736 134123 070055 071502 127052 006733
0000100 016462 140063 106340 075113 135236 040731 070540 050634
0000120 120725 012544 137356 004304 135025 077212 037105 063232
0000140 017500 020745 164012 066752 117227 034401 102106 002367
0000160 043327 102742 100723 021743 104661 175100 167331 121240
0000200 161230 165423 021265 031457 053316 140015 007725 136412
0000220 100223 067136 166016 042721 046442 002012 121731 024135
0000240 044776 050324 126152 127215 057712 041523 113266 024335
0000260 016362 000614 135326 162237 055575 117146 014014 116267
0000300 004072 173014 122470 135151 122400 041037 100437 151255
0000320 162432 103334 023300 074714 056124 016406 007221 032507
0000340 121605 047133 027122 030424 137170 123053 103476 161352
0000360 063070 052450 111541 022277 015016 113155 027252 147123
0000400 131134 031073 117501 126474 047361 041560 013720 073711
0000420 024352 117055 016246 054663 172336 036371 027345 020214
0000440 160543 152253 010601 115263 176535 106513 112731 150711
0000460 146652 032205 156223 173052 070052 120633 160266 057257
0000500 175317 177705 063171 004156 075675 115245 072707 165572
0000520 011106 075707 062765 035245 042650 121131 036537 110032
0000540 077717 112056 160525 132765 054451 033665 116436 003052
0000560 030666 137100 072461 047316 034617 176217 013447 012607
0000600 006055 010351 010703 010537 050256 132356 147016 016417
0000620 017170 015713 035343 026253 047034 036250 165207 107541
0000640 005664 044402 073542 051567 060003 044253 152435 063107
0000660 033037 101026 012541 130057 021666 124712 106530 065053
0000700 026762 166473 122303 140272 054466 135251 107330 142724
0000720 075672 047672 003550 136406 100752 004503 013000 074173
0000740 160230 167304 126156 043055 042616 035035 127507 170670
0000760 167460 155627 013361 033221 101157 100050 130744 112503
0001000