From 820f6e31a1983e6be37212379a96392aa73e9b76 Mon Sep 17 00:00:00 2001 From: bluesaxman Date: Wed, 8 Sep 2021 14:05:14 -0600 Subject: [PATCH] Added check for success of disk sync, should resolve bad ssd write issues --- wipe.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wipe.pl b/wipe.pl index a07b374..1bc4623 100755 --- a/wipe.pl +++ b/wipe.pl @@ -117,8 +117,11 @@ sub wipethemdrives { seek($diskw,-10240000,2); print $diskw $clobber; #End of Disk close($diskw); -####################################### - system("sync"); #Need to check if this failes and actually fail the disk if it fails. + system("sync ".$disks->{$diskid}{path}) and do { + #if sync failes disk fails + print "\nWipe attemped $color{red}FAILED$color{reset}\n"; + return ($? >> 8); + }; print "Wipe attempt complete, checking..."; # Read open(my $diskr, "<", $disks->{$diskid}{path}) or return warning("could not open $disks->{$diskid}{path}");