martijnvanbrummelen / nwipe

nwipe secure disk eraser
GNU General Public License v2.0
707 stars 80 forks source link

nwipe hangs when erasing via --nogui --autonuke #530

Closed eraser-monkey closed 10 months ago

eraser-monkey commented 10 months ago

I noticed this as of the 0.35 update. I run nwipe with no gui as part of a perl script. This script checks stdout for completion and then logs the erase result to a database. As of 0.35, nwipe completes a wipe, then hangs. It needs to be manually stopped, and then it displays the test results.

I have run this within my perl scripts several times and it hangs every time. My perl scripts are typically erasing several hundred drives concurrently within separate nwipe processes and each process hangs, though the erase completes, and the PDF is generated after I kill the processes. I suspected an issue with my scripts but the issue presents when I run nwipe on it's own.

This is the command I run: sudo nwipe --method=zero --rounds=1 --verify=off --nogui --autonuke /dev/sdz

This is the stdout:

[2023/11/26 19:16:49]  notice: Found /dev/sdz,  ATA-SSD, INTEL SSDSC2BB96,  960 GB, S/N=PHDV711602HH960FGN
[2023/11/26 19:16:49]    info: HPA:  max sectors   = 1875385008/1875385008, accessible max address disabled
 on /dev/sdz
[2023/11/26 19:16:49]    info: HPA values 1875385008 / 1875385008 on /dev/sdz
[2023/11/26 19:16:49]    info: DCO Real max sectors not found
[2023/11/26 19:16:49]    info: libata: apparent max sectors reported as 1875385008 on /dev/sdz
[2023/11/26 19:16:49]    info: No hidden sectors on /dev/sdz
[2023/11/26 19:16:49]    info: func:nwipe_read_dco_real_max_sectors(), DCO real max sectors = 16711681
[2023/11/26 19:16:49]    info:
[2023/11/26 19:16:49]    info: bios-version = 2.15.0
[2023/11/26 19:16:49]    info: bios-release-date = 07/05/2022
[2023/11/26 19:16:49]    info: system-manufacturer = Dell Inc.
[2023/11/26 19:16:49]    info: system-product-name = PowerEdge FC630
[2023/11/26 19:16:49]    info: system-version = Not Specified
[2023/11/26 19:16:49]    info: system-serial-number = H0VC082
[2023/11/26 19:16:49]    info: system-uuid = 4c4c4544-0030-5610-8043-c8c04f303832
[2023/11/26 19:16:49]    info: baseboard-manufacturer = Dell Inc.
[2023/11/26 19:16:49]    info: baseboard-manufacturer = Dell Inc.
[2023/11/26 19:16:49]    info: baseboard-product-name = 0PHY8D
[2023/11/26 19:16:49]    info: baseboard-product-name = Not Specified
[2023/11/26 19:16:49]    info: baseboard-version = A00
[2023/11/26 19:16:49]    info: baseboard-version = Not Specified
[2023/11/26 19:16:49]    info: baseboard-serial-number = .H0VC082.CN701635630074.01.
[2023/11/26 19:16:49]    info: baseboard-serial-number = .4X8FW52..01.
[2023/11/26 19:16:49]    info: baseboard-asset-tag = Not Specified
[2023/11/26 19:16:49]    info: baseboard-asset-tag = Not Specified
[2023/11/26 19:16:49]    info: chassis-manufacturer = Dell Inc.
[2023/11/26 19:16:49]    info: chassis-type = Multi-system
[2023/11/26 19:16:49]    info: chassis-version = PowerEdge FX2s
[2023/11/26 19:16:49]    info: chassis-serial-number = 4X8FW52
[2023/11/26 19:16:49]    info: chassis-asset-tag = Not Specified
[2023/11/26 19:16:49]    info: processor-family = Xeon
[2023/11/26 19:16:49]    info: processor-family = Xeon
[2023/11/26 19:16:49]    info: processor-manufacturer = Intel
[2023/11/26 19:16:49]    info: processor-manufacturer = Intel
[2023/11/26 19:16:49]    info: processor-version = Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz
[2023/11/26 19:16:49]    info: processor-version = Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz
[2023/11/26 19:16:49]    info: processor-frequency = 2300 MHz
[2023/11/26 19:16:49]    info: processor-frequency = 2300 MHz
[2023/11/26 19:16:49]  notice: Opened entropy source '/dev/urandom'.
[2023/11/26 19:16:49]  notice: hwmon: Module drivetemp loaded, drive temperatures available
[2023/11/26 19:16:49]  notice: hwmon: sdz has temperature monitoring
[2023/11/26 19:16:49]    info: Temperature limits for /dev/sdz, critical=N/A, max=N/A, highest=N/A, lowest=N/A, min=N/A, low critical=N/A.
[2023/11/26 19:16:49]  notice: Program options are set as follows...
[2023/11/26 19:16:49]  notice:   autonuke = 1 (on)
[2023/11/26 19:16:49]  notice:   autopoweroff = 0 (off)
[2023/11/26 19:16:49]  notice:   do not wait for a key before exiting
[2023/11/26 19:16:49]  notice:   do not show GUI interface
[2023/11/26 19:16:49]  notice:   banner   = nwipe 0.35
[2023/11/26 19:16:49]  notice:   prng     = Isaac64
[2023/11/26 19:16:49]  notice:   method   = Fill With Zeros
[2023/11/26 19:16:49]  notice:   quiet    = 0
[2023/11/26 19:16:49]  notice:   rounds   = 1
[2023/11/26 19:16:49]  notice:   sync     = 100000
[2023/11/26 19:16:49]  notice:   verify   = 0 (off)
[2023/11/26 19:16:49]  notice: /dev/sdz has serial number PHDV711602HH960FGN
[2023/11/26 19:16:49]  notice: /dev/sdz, sect/blk/dev 512/4096/960197124096
[2023/11/26 19:16:49]  notice: Invoking method 'Fill With Zeros' on /dev/sdz
[2023/11/26 19:16:49]  notice: Starting round 1 of 1 on /dev/sdz
[2023/11/26 19:16:49]  notice: Starting pass 1/1, round 1/1, on /dev/sdz
[2023/11/26 20:20:54]  notice: 960197124096 bytes written to /dev/sdz
[2023/11/26 20:20:54]  notice: Finished pass 1/1, round 1/1, on /dev/sdz
[2023/11/26 20:20:54]  notice: Finished final round 1 of 1 on /dev/sdz
[2023/11/26 20:20:54]  notice: Blanking device /dev/sdz
[2023/11/26 21:26:01]  notice: 960197124096 bytes written to /dev/sdz
[2023/11/26 21:26:01]  notice: [SUCCESS] Blanked device /dev/sdz

At this point it hangs indefinitely, in this case I stopped it with ctrl-C at 23:57, 90 minutes later.

After the nwipe is stopped it outputs the erasure result:

^C
Waiting for wipe thread to cancel for /dev/sdz
^C
******************************** Error Summary *********************************
!   Device | Pass Errors | Verifications Errors | Fdatasync I\O Errors
--------------------------------------------------------------------------------
       sdz |           0 |                    0 |                    0
********************************************************************************

********************************* Drive Status *********************************
!   Device | Status | Thru-put | HH:MM:SS | Model/Serial Number
--------------------------------------------------------------------------------
       sdz | Erased |    0 B/s | 02:09:12 | INTEL SSDSC2BB96/PHDV711602HH960FGN
.--------------------------------------------------------------------------------
[2023/11/26 23:42:28] Total Throughput    0 B/s, Fill With Zeros, 1R+B+NV
********************************************************************************

Creating PDF report in .

[2023/11/26 23:42:28]    info: Nwipe was aborted by the user. Check the summary table for the drive status.
********************************************************************************

Creating PDF report in .

[2023/11/26 23:42:28]    info: Nwipe was aborted by the user. Check the summary table for the drive status.

System info: Linux ERASE01 5.15.0-58-generic #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

PartialVolume commented 10 months ago

Sounds like it might be a symptom of the --autopoweroff bug fixed here https://github.com/martijnvanbrummelen/nwipe/commit/7f39d81548309faaed195ced07222fc42315181f

Can you build from the master, version should be 0.35.1 in nwipes title bar and see if it now works.

PartialVolume commented 10 months ago

Just checked this out and can confirm it's a different problem. Will commit a fix shortly.

PartialVolume commented 10 months ago

Fixed by commit https://github.com/martijnvanbrummelen/nwipe/commit/3f78d76bacee4bcbe0e7ffa00bb96acaa43fe025

v0.35.3

PartialVolume commented 10 months ago

If possible can you build the master, nwipe title version will be 0.35.3 and confirm it's now working correctly by exiting on completion of the wipes in --nogui mode.

Thanks.

PartialVolume commented 10 months ago

Please re-open if still an issue, however my tests show this is now resolved.

eraser-monkey commented 10 months ago

Confirmed, it is completing the erase and showing the full logs!

Thanks