Commit Graph

46 Commits

Author SHA1 Message Date
PartialVolume
a83a27f8e5 Fix missing serial number on SAS drive
This was caused by inconsistent labeling of the
serial number by smartctl. In a majority of cases
smartctl would output serial number data using
the label "Serial Number:" however on a SAS
drive we found that smartctl output the label
as "Serial number:" i.e. differs with a lower
case 'n'. Unfortunately we were doing a case
sensitive search for "Serial Number" so the result
being the serial number was not found.

This patch converts both strings in the search
to lower case before searching.

In addition a new field was added to the
anonymize list, "logical unit id:" so when the
-q option is used "serial number", "lu wwn device id:"
and "logical unit id:" are all now anonymized in the
smartctl debug data.
2021-12-12 20:22:35 +00:00
PartialVolume
5cb27e60ce Anonymize 'LU WWN ID' when -q specified.
Add 'LU WWN ID' to the list of data returned
by smartctl that should be anonymized when
-q or --quiet is specified.
2021-11-16 17:48:50 +00:00
PartialVolume
e982ca5fee Add -q --quiet option - anonymize serial numbers
Anonymize the serial numbers in the gui, the
log and the summary table.

If a serial number was obtained from the device,
it is replaced with "XXXXXXXXXXXXXXX".

If the serial number could not be obtained from the
device, it's replaced with "???????????????".
2021-11-15 18:19:47 +00:00
PartialVolume
0960fd1259 Remove /dev/ from gui for long filenames
This fixes column alignment issues in the gui
with nvme drives i.e. nvme0n1 etc. If the drive
name including path exceeds 8 characters the
/dev/ is removed and prefixed with spaces to
a total max length of 8 characters.
2021-11-15 09:57:46 +00:00
PartialVolume
90ed59fe06 Added temperature to drive selection window
Also removed 1. 2. etc from drive selection
to reduce the line length. Also removed the
space between > and [, ie "> [wipe]" becomes
">[wipe]" These changes remove 3 characters
and help to reduce the affect of the additional
temperature field [30C] which add 5 characters.
Therefore the line length overall, increased by
5-3 = 2 characters.

This helps to reduce line wrapping on 80
character terminals, when the drive model length
exceeds 24 characters.
2021-11-12 23:23:57 +00:00
PartialVolume
74fa192efa Change message for unknown serial no.
Changed message from (No ATA pass-thru) to (S/N: unknown)
2021-11-07 00:10:38 +00:00
PartialVolume
aa196b9602 Merge pull request #356 from Firminator/patch-2
Update device.c
2021-11-07 00:05:19 +00:00
PartialVolume
366249b76a Check smartctl for unresolved bus types SATA
For some controllers/drivers the readlink method of
obtaining the bus type for GUI display does not work.

If we haven't already resolved the bus type, we then
also check smartctl for the transport protocol
for SATA.
2021-11-05 23:43:43 +00:00
Firminator
02c1fa4780 Update device.c
correct a few typos not found by codespell
2021-11-04 23:35:00 -04:00
Dimitri Papadopoulos
b2c22d58cb Typos found by codespell 2021-11-02 08:13:48 +01:00
PartialVolume
3c4e51a1ff Add SAS to GUI.
For some controllers/drivers the readlink method of
obtaining the bus type for GUI display does not work.

If we haven't already resolved the bus type, we then
also check smartctl for the transport protocol
for SAS.
2021-11-01 22:54:55 +00:00
PartialVolume
fcd35ea910 Remove redundant ATA prefix from the model number.
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.
2020-04-08 17:05:06 +01:00
PartialVolume
0488138c43 Fix --nousb missing a drive
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.
2020-04-01 21:29:08 +01:00
PartialVolume
497fcb73b5 Add NVME & VIRT to device types.
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.
2020-03-31 15:14:41 +01:00
PartialVolume
4fe7f4a697 Fix incorrect readlink error message 2020-03-27 21:40:56 +00:00
PartialVolume
b9a9386d2f Add --nousb option.
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.
2020-03-27 20:57:33 +00:00
PartialVolume
e46e80277d Fix incorrect disk capacity nomenclature.
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.
2020-03-26 19:41:07 +00:00
PartialVolume
2446db741f Fix the way I look for smartctl & readlink 2020-03-25 22:26:43 +00:00
PartialVolume
055b90d4c7 fix smartctl directory search 2020-03-25 18:20:06 +00:00
PartialVolume
a2f70661b8 Search extra directories for smartctl & readlink
This is mainly required for Debian sid if using
su instead of su - to run nwipe.
2020-03-25 17:35:14 +00:00
PartialVolume
186ec9172c Tidy the smartctl & readlink warning messages 2020-03-25 15:02:40 +00:00
PartialVolume
fdf3140249 Fix duplicated serial number
If any drive doesn't have a serial number it's
serial number field was populated with the previous
drives serial number.

This is fixed by this patch.
2020-03-24 23:07:39 +00:00
PartialVolume
541a002a99 Add serial number support for USB devices
Add serial number support for USB devices for USB
to IDE/SATA adapters. Note this will only work
with USB IDE/SATA adapters that support ATA pass
through. See #149 for further details of
supported devices.

This patch requires readlink and smartmontools (smartctl)
to be installed. If not installed the serial number for
supported USB hardware will be missing.

The device type, i.e USB or ATA is now shown on the selection
and wipe windows.
2020-03-24 21:01:05 +00:00
PartialVolume
e955725fc5 Style formatting 2020-03-13 17:48:20 +00:00
PartialVolume
1c1b25e1ae Keep nwipe_log notices succinct
1. Keep nwipe_log notices succinct and below 80 chars in length including
timestamp. This is especially relevant for 80x30 terminal use such
as ALT-F2 etc or Shredos without losing any information.

2. Add [SUCCESS] to blanked & verified messages to make them stand out for quicker checking.
2020-03-13 17:24:08 +00:00
louib
49aa14a490 Prefixing device fields with _device.
Also added a `device_label` field to centralize
the creation of the device label. This fixes the
labels for devices without a serial number, and
makes sure we have the same label format everywhere.
2020-01-12 14:24:32 -05:00
louib
a5a3f3b9a3 Formatting device module. 2020-01-05 16:29:27 -05:00
PartialVolume
3110267373 Add error checking code to pthread_mutex_lock functions
Move flush of logs into final cleanup function
Minor alteration to one or two error messages
2019-12-01 22:22:47 +00:00
PartialVolume
5199fb1793 Fix wipe status saying Success when it never even started.
Capitalise success and failure messages in GUI and log to make them stand out
2019-11-06 20:03:39 +00:00
PartialVolume
f6c1cab28a Have nwipe continue with following devices even if one fails 2019-11-06 14:13:33 +00:00
PartialVolume
661785294c Merge pull request #109 from louib/documentation
Fix typos in README and comments.
2019-11-02 22:51:07 +00:00
louib
7b1a5b98a7 Fix typos in README and comments. 2019-11-02 18:33:36 -04:00
Martijn van Brummelen
11ed6b1472 Merge pull request #71 from PartialVolume/exclude-drive-181116
Enhancement: Add exclude drive option
2019-09-04 08:18:32 +02:00
Nick Law
cd3716f260 Use stdint.h, ncurses.h and panel.h instead of netinet/in.h 2018-11-24 23:32:20 +00:00
Nick Law
27bb409efa Enhancement: Add exclude drive option 2018-11-20 16:03:32 +00:00
Martijn van Brummelen
5cb6003fc0 Fixes spurious character at the end of serial no string. 2018-11-16 22:35:32 +01:00
Nick Law
9c69bc0e1a Fix non display of serial numbers for ATA/SCSI devices 2018-11-16 11:13:49 +00:00
Martijn van Brummelen
b0bc174d32 pre-0.24 2017-12-06 20:09:47 +01:00
kelderek
0b1cb83013 added #include <sys/ioctl.h> so it can get device name 2017-12-04 17:33:09 -05:00
Martijn van Brummelen
d9ba357722 add friendly disk size 2017-12-02 19:46:38 +01:00
Martijn van Brummelen
c8a5a16108 place files in normal location 2017-02-21 22:31:11 +01:00
Martijn van Brummelen
4e64cab3c3 use localtime instead of gmtime for logging 2017-02-13 13:40:00 +01:00
Martijn van Brummelen
e7d9ff73fe remove unused netinet/in.h 2017-02-12 20:14:55 +01:00
Martijn van Brummelen
1fce0eb936 make code more readable 2017-02-12 19:53:32 +01:00
Andy Beverley
7ac6de9933 Add additional info to status screen when blanking 2013-09-07 00:19:37 +01:00
Andy Beverley
b40d4d10c8 Initial commit 2013-09-06 23:38:39 +01:00