1. Fix a bug in the static and random pass code
where I unnecessarily moved the decrement of z (the
count of bytes remaining) to after the periodic sync
which meant every time it sync'ed z wasn't decremented due
to r being used as a general results variable for the
fdatasync function.
I prefer to just have a variable be responsible for just
one thing hence my assumption r wasn't used for two different
things.
Changed the position of the decrement of z, pass_done and
round_done to their original position prior to the periodic
sync.
1. Added the red cross icon located on the top right of
the certificate. This is displayed when the wipe is aborted
or failed to complete due to disc I/O errors etc. The
green tick icon is displayed on a successful wipe.
2. When the user manually aborts the wipe, the bytes so
far erased incorrectly displayed as zero. This change updates the
c->bytes_erased variable in the static pass and random
pass functions to correct this.
1. Added rounds requested & completed. Coloured
green if equal and red if not.
2. Fixed endtime sometimes not being recorded when
a wipe is aborted. This affected the creation of the
PDF filename. Now ok.
3. Added throughput using the appropriate nomenclature
such as KB/sec MB/sec, GB/sec etc
1. Added bytes erased including percentage, green
if equal to disc size and red if the drive hasn't been
fully erased at least once.
2. Added explanation of bytes erased to certificate.
3. Added throughput
1. Change model/serial no in header to bold and move left
2. Create a filename for the report that identifies the
wipe uniquely ie:
nwipe_report_YY-MM-DD_HH-MM-SS_Model_XXXX_Serial_XXXX.pdf
3. Move size data 2 characters right to allow for up to two
space prefix on size string. So data doesn't get written over
the end of the 'Size:' label.
1. Fix @param in pdfgen.h, committed and accepted upstream
2. Added size of disk in bytes
3. When NVME drive show message "Not applicable" for HPA, DCO
4. Highlight status ERASED, FAILED etc with coloured ellipse
5. Added function help for nwipe_log (shows in hints in IDE)
1. Rearranged the layout so the Tech/ID signature
is at the bottom of the report.
2. Added start date/time
3. Added end date/time
4. Changed data from helvetica to helvetica-bold
5. Created a definition for PDF_DARK_GREEN text in
create_pdf.h and moved the previously created PDF_GRAY
to create_pdf.h, to keep pdfgen.h vanilla.
6. Added the erasure status, ERASED, FAILED, ABORTED.
ERASED in green and FAILED, ABORTED in red.
Further code to follow ..
1. Display unknown in serial number field for loopback device
2. Added device type, USB, SATA, VIRT etc
3. Added duration of wipe in hh:mm:ss
4. Added pseudo random number generator type, twister, isaac etc
5. Added final blanking pass type, none, zeros, ones
6. Added number of rounds
1. Changed most titles in certificate to gray with
the data in black.
Started adding real data to template including:
Model, serial no., method, verify, size.
more code to follow...
1. Embed the images contained in the PDF into nwipes code
rather than use external image files.
2. Changed the font from Times New Roman to Helvetica
to give it a cleaner look.
I was searching for a DBAN alternative that runs in a normal Linux distro so I can hot-swap drives and not hale to reboot the system. When I found nwipe, I went to install it in a grml live system. Turns out, nwipe ships with grml by default as you can see in [grml's dpkg.list](https://packages.grml.org/files/grml64-small_2021.07/dpkg.list).
It's not exactly the most up-to-date version (0.30-1+b2 for amd64) because grml is close to Debian stable. It even comes with the the small live system image.
Although reported in issues some time ago, make it clear nwipe doesn't support HDA and you will need to run hdparm in order to detect and if necessary correct the disks reported size prior to running nwipe.
If you use the --logfile option but specify a filename
that will be created in a directory that is not writable,
for instance, a system directory such as /proc/sys/ or
your current directory happens to be a system directory
that you are running nwipe from while not specifying a
writable path for the log file then nwipe would exit with
a segfault.
This is now fixed and if the logfile cannot be created
or opened then an appropriate message is displayed and
nwipe is aborted.
This fixes a issue related to konsole and terminals based on Konsole,
like cool retro terminal. If you exit the terminal before exiting nwipe,
nwipe will then continue running in the background but detached from any
terminals input/output. This causes a call to halfdelay()/getch() to
return immediately, thus removing the delay and causing the thread to
run at full speed causing 100% CPU in a core. This requires nwipe to
then be killed manually. This patch is related to the last patch in
that both patches do much the same thing but the previous patch fixes
the problem when nwipe is sitting at the drive selection screen, while
this patch fixes the problem during a wipe.
This problem would only be seen in specific KDE konsole related
terminals and only if you do not exit nwipe by using nwipe's control c
to abort or use the space bar on completion of the wipe.
Much like the same check we perform in the nwipe_gui_select() function,
here we check that we are not looping any faster than as defined by the
halfdelay() function, typically this loop runs at 10 times a second.
This check makes sure that if the loop runs faster than double this
value i.e 20 times a second then the program exits. This check is
therefore determining whether the getch() function is returning
immediately rather than blocking for the defined period of 100ms.
Why is this necessary? Some terminals (konsole & deriviatives) that are
exited while nwipe is still running fail to terminate nwipe this causes
the halfdelay()/getch() functions to immediately fail causing the loop
frequency to drastically increase. We detect that speed increase here
and therefore close down nwipe. This doesn't affect the use of the tmux
terminal by which you can detach and reattach to running nwipe
processes. The tmux terminal will still work correctly when a nwipe
session is detached.
when Konsole terminal exited while nwipe is sitting at the
drive selection screen.
To avoid 100% CPU usage, check for a runaway condition caused by the
function "keystroke = getch() that immediately returns an error
condition. We check for an error condition because getch() returns a
ERR value when the timeout value "timeout( 250 );" expires as well as
when a real error occurs. We can't differentiate from normal operation
and a failure of the getch function to block for the specified period
of timeout. So here we check the while loop hasn't exceeded the number
of expected iterations per second ie. a timeout(250) block value of
250ms means we should not see any more than (1000/250) = 4 iterations.
We double this to 8 to allow a little tolerance. Why is this necessary?
It's been found that in KDE konsole and other terminals based on the QT
terminal engine exiting the terminal without first existing nwipe
results in nwipe remaining running but detached from any interface
which causes getch to fail and its associated timeout. So the CPU or
CPU core rises to 100%. Here we detect that failure and exit nwipe
gracefully with the appropriate error. This does not affect use of
tmux for attaching or detaching from a running nwipe session when
sitting at the selection screen. All other terminals correctly
terminate nwipe when the terminal itself is exited.