martijnvanbrummelen / nwipe

nwipe secure disk eraser
GNU General Public License v2.0
688 stars 79 forks source link

nwipe_conf_001 Add /etc/nwipe/nwipe.conf #458

Closed PartialVolume closed 1 year ago

PartialVolume commented 1 year ago
  1. Started constructing the code we will use to access and write to /etc/nwipe/nwipe.conf. The initial use of the nwipe.conf file will be to hold information such as organisation and technician details that will be used on the PDF report certificate. We are using the libconfig library enable us to read and write the conf file. libconfig is very well documented so editing the conf file manually should be pretty straight forward. Nwipe will build a basic conf file to give the user an idea how it should be edited.

  2. Updated the README.md, showing the libconfig-dev, libconfig++-dev needs to be installed.

  3. Added some information about the use of hdparm to detect hidden sectors and also noted that as from v0.35 nwipe will detect hidden sectors, and may well have an extra method to expose those hidden# sectors by restoring the DCO.

mdcato commented 1 year ago

PartialVolume, I tried to send you a logfile (--verbose) from wiping two drives, but the logfile was larger (2,146KB) than the email interface allows, and you've fixed some things I was noting. So, I using the Github web interface to upload the logfile, given that previous files I attached to email didn't make it to you, and will start a new wipe with the #458 changes. nwipe-20230316-2.log

mdcato commented 1 year ago

I've run into a problem with #458. I git the master, ./autogen.sh, ./configure, but then get an error that libconfig is not found. Yum reports that it is installed. May not be an issue with anything associated with nwipe code. Suggestions?

PartialVolume commented 1 year ago

For reading/writing to /etc/nwipe/nwipe.conf, we are using the libconfig library in the latest master. Installation of libconfig is required prior to running ./autogen.sh, including it's -devel package. Maybe you are missing the -devel package but have the binary libconfig installed. I've updated the README.md section that deals with that. Try the following:

yum install libconfig-devel
yum install libconfig++-devel

I've assumed the name of the library is the same under Fedora as it is under Debian/Ubuntu/Neon. Also I'm not 100% sure I need libconfig++-devel installed so if that fails to install but libconfig-devel is ok, then see if it compiles ok with just that one library.

This would suggest the above commands are correct for Fedora. I've not much experience with Fedora I used OpenSuse many years ago but for the last few years have been doing most of my work on KDE Neon (Based on Ubuntu-LTS) with the bleeding edge KDE code.

I'm unclear whether libconfig and libconfig--devel are two different things under Fedora. I may need to update the README.md to also have yum install libconfig as a prerequisite as well as yum install libconfig-devel. What do you think?

PartialVolume commented 1 year ago

To avoid those enormous log files, I need to create a new ultra verbose setting and have the temperature settings only show up if you specify --verbose+.

mdcato commented 1 year ago

Installing libconfig-devel was the key. Now running wipe of 1TB & 4TB with version 0.34.81.

From: PartialVolume @.> Sent: Saturday, March 18, 2023 04:29 To: martijnvanbrummelen/nwipe @.> Cc: Mike Cato / Hays Technical Services @.>; Comment @.> Subject: Re: [martijnvanbrummelen/nwipe] nwipe_conf_001 Add /etc/nwipe/nwipe.conf (PR #458)

For reading/writing to /etc/nwipe/nwipe.conf, we are using the libconfig library in the latest master. Installation of libconfig is required prior to running ./autogen.sh, including it's -devel package. Maybe you are missing the -devel package but have the binary libconfig installed. I've updated the README.md section that deals with thathttps://github.com/martijnvanbrummelen/nwipe#fedora-prerequisites. Try the following:

yum install libconfig-devel

yum install libconfig++-devel

I've assumed the name of the library is the same under Fedora as it is under Debian/Ubuntu/Neon. Also I'm not 100% sure I need libconfig++-devel installed so if that fails to install but libconfig-devel is ok, then see if it compiles ok with just that one library.

Thishttps://installati.one/fedora/34/libconfig/ would suggest the above commands correct for Fedora. I've not much experience with Fedora I used OpenSuse many years ago but for the last few years have been doing most of my work on KDE Neon (Based on Ubuntu-LTS) with the bleeding edge KDE code.

I'm unclear whether libconfig and libconfig--devel are two different things under Fedora. I may need to update the README.md to also have yum install libconfig as a prerequisite as well as yum install libconfig-devel. What do you think?

— Reply to this email directly, view it on GitHubhttps://github.com/martijnvanbrummelen/nwipe/pull/458#issuecomment-1474787317, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANGK2PQYUWRYQSIYKIJVGXDW4V55BANCNFSM6AAAAAAV7C2NGY. You are receiving this because you commented.Message ID: @.**@.>>

mdcato commented 1 year ago

That’s probably a good idea, or perhaps a log level (--verbose=xx ?) in case you want to turn different subsystems logging on? (I know, that increases complexity somewhat, but future-proofing.)

From: PartialVolume @.> Sent: Saturday, March 18, 2023 04:45 To: martijnvanbrummelen/nwipe @.> Cc: Mike Cato / Hays Technical Services @.>; Comment @.> Subject: Re: [martijnvanbrummelen/nwipe] nwipe_conf_001 Add /etc/nwipe/nwipe.conf (PR #458)

To avoid those enormous log files, I need to create a new ultra verbose setting and have the temperature settings only show up if you specify --verbose+.

— Reply to this email directly, view it on GitHubhttps://github.com/martijnvanbrummelen/nwipe/pull/458#issuecomment-1474790369, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANGK2PSQ3RCQLVYIROZDHS3W4V7ZPANCNFSM6AAAAAAV7C2NGY. You are receiving this because you commented.Message ID: @.**@.>>

mdcato commented 1 year ago

Also, there was a Github email interface problem recently when I sent logfile + screenshots + PDFs, which is why I was saying I needed to use the Github web interface. That may lessen the priority on logfile changes since the logfile alone is not the real culprit.

From: Mike Cato / Hays Technical Services Sent: Saturday, March 18, 2023 10:16 To: martijnvanbrummelen/nwipe @.>; martijnvanbrummelen/nwipe @.> Cc: Comment @.***> Subject: RE: [martijnvanbrummelen/nwipe] nwipe_conf_001 Add /etc/nwipe/nwipe.conf (PR #458)

That’s probably a good idea, or perhaps a log level (--verbose=xx ?) in case you want to turn different subsystems logging on? (I know, that increases complexity somewhat, but future-proofing.)

From: PartialVolume @.**@.>> Sent: Saturday, March 18, 2023 04:45 To: martijnvanbrummelen/nwipe @.**@.>> Cc: Mike Cato / Hays Technical Services @.**@.>>; Comment @.**@.>> Subject: Re: [martijnvanbrummelen/nwipe] nwipe_conf_001 Add /etc/nwipe/nwipe.conf (PR #458)

To avoid those enormous log files, I need to create a new ultra verbose setting and have the temperature settings only show up if you specify --verbose+.

— Reply to this email directly, view it on GitHubhttps://github.com/martijnvanbrummelen/nwipe/pull/458#issuecomment-1474790369, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANGK2PSQ3RCQLVYIROZDHS3W4V7ZPANCNFSM6AAAAAAV7C2NGY. You are receiving this because you commented.Message ID: @.**@.>>

mdcato commented 1 year ago

Here's results from running 0.34.81 (commit #458). Attached are the --verbose logfile and PDF reports. In the PDF reports, the Bytes Erased percentage is a LARGE percentage rather than something <100, and the HA/DCO size is reported as a large negative number. nwipe-20230318-2.log nwipe_report_2023-03-18-14-09-49_Model_ST1000DM003_1SB1_Serial_ZN15TA6Y.pdf nwipe_report_2023-03-19-03-11-38_Model_ST4000NM0033_9ZM_Serial_Z1Z7NVF7.pdf

PartialVolume commented 1 year ago

Thanks, really useful. Not sure I get a chance to fix that tonight as I've got a early start tomorrow, but hopefully tomorrow night I'll upload the fix.

Unrelated to this but I come across a very rare bug, where after completion of the ones wipe, last pass verification, no blanking it finished with 66.7%. I repeated the wipe multiple times with different drives, even a 1 MB loop drive. I could not reproduce.

After looking at the code, I found it was caused by an un-initialised variable. Due to the nature of the bug and the variable, It would only happen on the ones wipe or ones or zeros verification. All other wipes not affected .And it would only generate a percentage other than 100% on completion if the contents of the initialised variable was 1 or 6. I don't know what those odds are but maybe 2,147,483,647.5 to 1 for a 32 bit integer. That was the equivalent of me winning the lottery seeing that bug !