tjohansen14 / diskscrub

Automatically exported from code.google.com/p/diskscrub
GNU General Public License v2.0
0 stars 0 forks source link

[RFE] - a useful sequence: verify #22

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I often find myself needing to verify a disk (a la Solaris's 
format->analyze->verify), essentially confirming that the disk can write/read 
each sector.

Here's a small patch to allow a "verify" sequence.

diff --git a/src/pattern.c b/src/pattern.c
index 9cc258c..f955a73 100644
--- a/src/pattern.c
+++ b/src/pattern.c
@@ -84,6 +84,12 @@ static const sequence_t nnsa_seq = {
     },
 };

+static const sequence_t verify_seq = { 
+    "verify", "Verify Sequence", 1, {
+        { PAT_VERIFY, 1, {0x00} }, 
+    },
+};
+
 static const sequence_t dod_seq = { 
     "dod", "DoD 5220.22-M", 3, {
         { PAT_RANDOM, 0, {0x00} },
@@ -248,6 +254,7 @@ static const sequence_t custom_seq = {

 static const sequence_t *sequences[] = {
        &nnsa_seq,
+       &verify_seq,
        &dod_seq,
        &bsi_seq,
        &usarmy_seq,

Of course, this could be expanded to do two passes (reversing bits, say, with 
"0x00, 0xff" or "0xAA, 0x55").  But I wanted something quick to check some 
drives, and this was it.

Original issue reported on code.google.com by shkam...@gmail.com on 30 Sep 2012 at 6:23

GoogleCodeExporter commented 8 years ago
Sorry it took me so long to notice this issue.  Good idea - it will be in the 
next release.

Original comment by garlick....@gmail.com on 18 Aug 2014 at 11:19