Fix a minor error in the reporting of the
discs total number of blocks. This only
affects reporting to the log file and
does not affect the programs operation.
We already determine the bus type,
ATA, USB, NVME, VIRT (loop) etc
and display the bus type on the GUI.
libparted prefixes the model number
with ATA which we don't need, especially
as we try to keep the drive display length
to a maximum of 80 characters.
Previously if a drive failed during
a multiple drive wipe and the user
decided to abort nwipe to say remove
the drive and start over, the user would
use CONTROl-C to abort. This would be
reflected in the summary table as ALL drives
having been aborted including the drive that
failed. It makes more sense for a failed drive
to be marked as failed in the summary table
even though the user aborted the wipe.
This patch fixes that, so that if a drive failed
it reflects that drives status in the summary
even if the user aborts the wipe.
Recompiled ShredOS with support for Smartmontools, C++ V7.x support. Nwipe in this version of ShredOS, now supports the display of serial numbers for USB bridges that have chipsets that support ATA pass through functionality.
If a USB device generated a particular error
code from smartmontools, the --nousb option
incorrectly did not exclude it from the
enumerated drives.
This has now been corrected.
This was a very obscure segmentation fault I
stumbled across while testing the drive
selection window. I confirmed it exists
in all versions at least going back prior
to 0.24 and maybe a lot earlier.
It was a very tricky bug to track down as you
had to do some very specific things to cause it to
occur. Probably most people would not have seen
it, however for those that did, this was what you
needed to do to trigger it.
1. First you had to be wiping more than one drive.
2. Then you needed to scroll down to the bottom
drive in the list.
3. You then needed to minimise the vertical height
of the terminal so you could no longer see the
selected drive.
4. Then you needed to expand the vertical height
of the terminal. This last step would trigger a
segmentation fault and crash nwipe.
So, the theory. nwipe uses four variables to
allow you to scroll through multiple displayed
drives. These four variables are:
count = the number of enumerated drives.
slots = the number of available horizontal lines
to display the drives. The number of slots
varies depending upon vertical resizing
of the terminal. So slots is calculated
in real time.
focus = which drive the GUI '>' pointer is pointing to.
offset = A value between 0 and slots that describes
what drives are displayed in the available
slots.
offset is then used along with i in a for loop to index
the drive contexts. This is where the segfault
occurred.
The calculation failed to take correct account of a varying
number of slots so in the condition described above the
offset would create an index that was out of bounds.
So first I fixed the miss calculation and second I placed
an if statement that acts as a bounds checker so if
ever this code is changed by someone in the future and
they break the calculation the bounds checker 'if' statement
will log the details of the error and prevent a segfault which
is far easier to debug.
Added NVME and VIRT to device type table.
VIRT are virtual devices such as loop devices
created with losetup.
NVME for solid state storage devices.
Due to the longer device names used for NVME, I will
need to do some work on the device name in the selection
window so column alignment is maintained.
Benefits include:
1. Standard fixed width output for disk
throughput, combined throughput and disk
capacity. Allows for better column alignment
when wiping multiple drives.
2. Removal of about 40 lines of duplicated code.
For drives that are wiping the percentage
completion is displayed. To retain column
alignment when wiping multiple drives, the
percentage values from 0.01% to 9.99% are
displayed with a leading space, i.e
[ 9.99%, then 10.00% to 99.99% is displayed
as, i.e [10.01%, etc..
When wiping a drive a status message is displayed
that show [writing] or [syncing] or [verifying] or
[blanking] etc. Previously there were two bracketed
fields, [syncing] occupied one field and all the others
occupied the other field.
To conserve screen space they all occupy the same
bracketed field.
The bracketed field is also now a fixed length of
9 characters padded with spaces as necessary to maintain
column alignment when wiping multiple drives simultaneously.
a wipe has finished.
This problem was not seen when wiping multiple drives
of the same size as they all ended at the same time.
Also not seen when wiping a single drive, but if you
wiped multiple drives of different sizes where the
drive wipes ended at different times then you could
see the throughput being calculated as steadily dropping
for a drive that had completed it's wipe.
Also fixed overall throughput. When all wipes had completed
overall throughput showed the throughput of the last drive
that finished. It should show 0 B/s as all wiping had
ceased. In the log table you will see individual drive
throughput and overall throughput which is the sum of
all the drives throughputs.
If you use the option --nousb, all USB devices will be ignored.
They won't show up in the GUI and they won't be wiped if you use
the --nogui --autonuke command. They will even be ignored if you
specifically name them on the command line.
I've always wondered, when you first view
all the drives, why drives above 999GB appeared
in their GB nomenclature instead of TB. For
instance a 2TB drive would appear as 2000GB.
Unlike other places in nwipe that does a proper
job of describing capacity just this one location
in the program was wrong.
This information was obtained by a call to a function
in libparted. Maybe when libparted was written there
was no such thing as a TByte drive ?? Who knows, so
anyway it was far easier to use nwipes build in function
called 'determine_C_B_nomenclature()' This provides us
with the correct nomenclature that is a fixed number of
digits (three) and prefixed with spaces so the length
is always the same. In the GUI this gives a nice
list when viewing multiple drives that appears in neat
columns.