martijnvanbrummelen / nwipe

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

nWipe bug - error: Last-odd-block detected #25

Closed thewookiewon closed 6 years ago

thewookiewon commented 7 years ago

nWipe version: nwipe-0.21-i486-1 Parted Magic version: 2016_10_18

So,

If I launch nWipe and select any HDD/SSD on the list, doesn't matter which method is use but usally DoD7 or Gutermann. When I start the wipe I get an error of @nwipe: error: Last-odd-block detected on '/dev/sdc'@ and it then proceeds to continue the wipe but the wipe goes by really quickly I mean a 500GB DoD7 wipe will take less than 3 mins and the percent completed is messed up on Pass 3 of 7 it was at 137%

[2016/11/03 15:15:45] nwipe: info: Automatically enumerated 6 devices. [2016/11/03 15:15:45] nwipe: notice: Opened entropy source '/dev/urandom'. [2016/11/03 15:16:31] nwipe: info: Device '/dev/sdc' has sector size 512. [2016/11/03 15:16:31] nwipe: warning: Changing '/dev/sdc' block size from 4096 to 512. [2016/11/03 15:16:31] nwipe: error: Last-odd-block detected on '/dev/sdc'. [2016/11/03 15:16:31] nwipe: info: Device '/dev/sdc' is size 554482002087141376. [2016/11/03 15:16:31] nwipe: notice: Invoking method 'DoD 5220.22-M' on device '/dev/sdc'. [2016/11/03 15:16:31] nwipe: notice: Starting round 1 of 1 on device '/dev/sdc'. [2016/11/03 15:16:31] nwipe: notice: Starting pass 1 of 7, round 1 of 1, on device '/dev/sdc'. [2016/11/03 15:16:49] nwipe: notice: 1891655680 bytes written to device '/dev/sdc'. [2016/11/03 15:16:49] nwipe: notice: Finished pass 1 of 7, round 1 of 1, on device '/dev/sdc'. [2016/11/03 15:16:49] nwipe: notice: Starting pass 2 of 7, round 1 of 1, on device '/dev/sdc'. [2016/11/03 15:17:07] nwipe: notice: 1891655680 bytes written to device '/dev/sdc'. [2016/11/03 15:17:07] nwipe: notice: Finished pass 2 of 7, round 1 of 1, on device '/dev/sdc'. [2016/11/03 15:17:07] nwipe: notice: Starting pass 3 of 7, round 1 of 1, on device '/dev/sdc'. [2016/11/03 15:17:30] nwipe: notice: 1891655680 bytes written to device '/dev/sdc'. [2016/11/03 15:17:30] nwipe: notice: Finished pass 3 of 7, round 1 of 1, on device '/dev/sdc'. [2016/11/03 15:17:30] nwipe: notice: Starting pass 4 of 7, round 1 of 1, on device '/dev/sdc'. [2016/11/03 15:17:49] nwipe: notice: 1891655680 bytes written to device '/dev/sdc'. [2016/11/03 15:17:49] nwipe: notice: Finished pass 4 of 7, round 1 of 1, on device '/dev/sdc'. [2016/11/03 15:17:49] nwipe: notice: Starting pass 5 of 7, round 1 of 1, on device '/dev/sdc'. [2016/11/03 15:18:07] nwipe: notice: 1891655680 bytes written to device '/dev/sdc'. [2016/11/03 15:18:07] nwipe: notice: Finished pass 5 of 7, round 1 of 1, on device '/dev/sdc'. [2016/11/03 15:18:07] nwipe: notice: Starting pass 6 of 7, round 1 of 1, on device '/dev/sdc'. [2016/11/03 15:18:26] nwipe: notice: 1891655680 bytes written to device '/dev/sdc'. [2016/11/03 15:18:26] nwipe: notice: Finished pass 6 of 7, round 1 of 1, on device '/dev/sdc'. [2016/11/03 15:18:26] nwipe: notice: Starting pass 7 of 7, round 1 of 1, on device '/dev/sdc'. [2016/11/03 15:18:49] nwipe: notice: 1891655680 bytes written to device '/dev/sdc'. [2016/11/03 15:18:49] nwipe: notice: Finished pass 7 of 7, round 1 of 1, on device '/dev/sdc'. [2016/11/03 15:18:49] nwipe: notice: Finished round 1 of 1 on device '/dev/sdc'. [2016/11/03 15:18:49] nwipe: notice: Blanking device '/dev/sdc'.

martijnvanbrummelen commented 7 years ago

Please tell me a bit more about your setup. How many disks, what kind of disks?

thewookiewon commented 7 years ago

Hi,

1 disk at a time but errors on any disk I use. Sata 500gb-1tb desktop hdd

Kind regards,

Lewis Brooks Get Outlook for Mobile

On Fri, Jan 13, 2017 at 8:37 PM +0000, "Martijn van Brummelen" notifications@github.com<mailto:notifications@github.com> wrote:

Please tell me a bit more about your setup. How many disks, what kind of disks?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/martijnvanbrummelen/nwipe/issues/25#issuecomment-272541729, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AT8C1uuzBHU0VmG3Gv4jwU-k0D7jG1PJks5rR-CIgaJpZM4KolWF.

martijnvanbrummelen commented 7 years ago

Will research it later. Thanks for reporting.

kelderek commented 7 years ago

I am experiencing the same issues. I run nwipe through PartedMagic and older versions worked fine, but the newer versions are doing the same thing. I am using the same machine for wiping as before (Dell Optiplex 755) and I am wiping normal sata drives, not SSHD or SSDs. The symptoms are all the same - last-odd-block error followed by unrealistically fast wiping.

martijnvanbrummelen commented 7 years ago

@kelderek thanks for reporting this, do you know which version used to work correctly?

kelderek commented 7 years ago

Some additional observations: I tried running lubuntu 16.10 32 bit and apt-get install nwipe gets me version 0.18. That version seems to run correctly. I downloaded the 0.21 release source and compiled it but that version throws the last-odd-block error and has the weird behavior. Hope this helps!

martijnvanbrummelen commented 7 years ago

@kelderek Thanks for this information, will investigate it further.

kelderek commented 7 years ago

No problem, I will see what version is included in PartedMagic and report back. FYI I downloaded the current master source (shows as 0.22). Running sudo nwipe brings up the GUI as normal, but where the drives should be there is just a diamond and I can't do anything but quit.

kelderek commented 7 years ago

I am using PartedMagic 2017/01/08 (the current stable release), running it 32-bit from RAM. I have tried running nwipe both through the PartedMagic GUI and without it using its extras boot menu to load a command prompt without X and get the same results. The version is PartedMagic is 0.21, the same version I had issues with in lubuntu.

martijnvanbrummelen commented 7 years ago

Version 0.22 isn't official yet so please don't use it . It seems a 32 bit issue.

kelderek commented 7 years ago

I rebooted to a fresh lubuntu live environment (again 32 bit) and built all the 0.18, 0.19, 0.20 and 0.21 releases from source. Same results - 0.18 worked and 0.19 and later did not. I will try to replicate in a 64 bit environment for you, but it sounds like you may have identified the issue.

kelderek commented 7 years ago

Sorry for the delay - I just tested in a lubuntu 64 bit environment and it seems to work fine there so it looks confirmed that it is a 32 bit issue. Is this something you think will be resolved quickly and easily? If you think it will take a while for a fix, I would like to send a note to the PartedMagic guys requesting they downgrade to 0.18 in the meantime.

martijnvanbrummelen commented 7 years ago

thanks for confirming this. I need to create a test environment and do some testing. It should take some time.

kelderek commented 7 years ago

No problem, thank you for your time and effort creating and maintaining nwipe.

spartanbard commented 7 years ago

Wow, this is the first time I've searched for a bug and found people actively discussing what I'm experiencing in the last 24 hours. :)

I'm having the exact same issue while running the new release of Parted Magic (2017_01_08) in 64 bit mode, running from RAM, so the 32 bit theory is out in my case.

I'll get some logs and system info together for your reference here in a bit.

spartanbard commented 7 years ago

Okay, so what was described by theroninhunter is exactly what is happening to me. Wipes almost instantly show over 100% completed, and go up to 300%-500% in less than a minute. A little while longer, and nwipe says (success). This happens when running Parted Magic in both 32 bit and 64 bit for me.

Actually, one of the drives mysteriously doesn't show any activity at all, while the other 3 are going bonkers. It just sits at 0%.

https://youtu.be/DiR1OvXSii0

I'm wiping 4 drives at a time on this machine. I've been using Parted Magic 2013_11_11 for years, and wiping up to hundreds of hard drives per day on multiple machines with no issues whatsoever. Bought the new Parted Magic today, specifically to run nwipe, and no dice.

Here is the log from running in 64 bit on the 4 drives for a few minutes.

Welcome - Parted Magic (Linux 4.9.1-pmagic64)

root@PartedMagic:~# nwipe [2017/02/22 20:13:20] nwipe: info: Automatically enumerated 5 devices. [2017/02/22 20:13:20] nwipe: notice: Opened entropy source '/dev/urandom'. [2017/02/22 20:13:34] nwipe: info: Device '/dev/sda' has sector size 512. [2017/02/22 20:13:34] nwipe: warning: Changing '/dev/sda' block size from 4096 to 512. [2017/02/22 20:13:34] nwipe: error: Last-odd-block detected on '/dev/sda'. [2017/02/22 20:13:34] nwipe: info: Device '/dev/sda' is size 554482001146732544. [2017/02/22 20:13:34] nwipe: info: Device '/dev/sdb' has sector size 512. [2017/02/22 20:13:34] nwipe: warning: Changing '/dev/sdb' block size from 4096 to 512. [2017/02/22 20:13:34] nwipe: notice: Invoking method 'DoD Short' on device '/dev/sda'. [2017/02/22 20:13:34] nwipe: notice: Starting round 1 of 1 on device '/dev/sda'. [2017/02/22 20:13:34] nwipe: error: Last-odd-block detected on '/dev/sdb'. [2017/02/22 20:13:34] nwipe: info: Device '/dev/sdb' is size 554482001146732544. [2017/02/22 20:13:34] nwipe: notice: Starting pass 1 of 3, round 1 of 1, on device '/dev/sda'. [2017/02/22 20:13:34] nwipe: info: Device '/dev/sdc' has sector size 512. [2017/02/22 20:13:34] nwipe: warning: Changing '/dev/sdc' block size from 4096 to 512. [2017/02/22 20:13:34] nwipe: error: Last-odd-block detected on '/dev/sdc'. [2017/02/22 20:13:34] nwipe: info: Device '/dev/sdc' is size 554482001323581440. [2017/02/22 20:13:34] nwipe: info: Device '/dev/sdd' has sector size 512. [2017/02/22 20:13:34] nwipe: warning: Changing '/dev/sdd' block size from 4096 to 512. [2017/02/22 20:13:34] nwipe: error: Last-odd-block detected on '/dev/sdd'. [2017/02/22 20:13:34] nwipe: info: Device '/dev/sdd' is size 554482004265492480. [2017/02/22 20:13:34] nwipe: notice: Invoking method 'DoD Short' on device '/dev/sdc'. [2017/02/22 20:13:34] nwipe: notice: Starting round 1 of 1 on device '/dev/sdc'. [2017/02/22 20:13:34] nwipe: notice: Starting pass 1 of 3, round 1 of 1, on device '/dev/sdc'. [2017/02/22 20:13:34] nwipe: notice: Invoking method 'DoD Short' on device '/dev/sdb'. [2017/02/22 20:13:34] nwipe: notice: Starting round 1 of 1 on device '/dev/sdb'. [2017/02/22 20:13:34] nwipe: notice: Starting pass 1 of 3, round 1 of 1, on device '/dev/sdb'. [2017/02/22 20:13:34] nwipe: notice: Invoking method 'DoD Short' on device '/dev/sdd'. [2017/02/22 20:13:34] nwipe: notice: Starting round 1 of 1 on device '/dev/sdd'. [2017/02/22 20:13:34] nwipe: notice: Starting pass 1 of 3, round 1 of 1, on device '/dev/sdd'. [2017/02/22 20:13:46] nwipe: notice: 951246848 bytes written to device '/dev/sdb'. [2017/02/22 20:13:46] nwipe: notice: Finished pass 1 of 3, round 1 of 1, on device '/dev/sdb'. [2017/02/22 20:13:46] nwipe: notice: Starting pass 2 of 3, round 1 of 1, on device '/dev/sdb'. [2017/02/22 20:13:46] nwipe: notice: 951246848 bytes written to device '/dev/sda'. [2017/02/22 20:13:46] nwipe: notice: Finished pass 1 of 3, round 1 of 1, on device '/dev/sda'. [2017/02/22 20:13:46] nwipe: notice: Starting pass 2 of 3, round 1 of 1, on device '/dev/sda'. [2017/02/22 20:13:54] nwipe: notice: 1128095744 bytes written to device '/dev/sdc'. [2017/02/22 20:13:54] nwipe: notice: Finished pass 1 of 3, round 1 of 1, on device '/dev/sdc'. [2017/02/22 20:13:54] nwipe: notice: Starting pass 2 of 3, round 1 of 1, on device '/dev/sdc'. [2017/02/22 20:13:57] nwipe: notice: 951246848 bytes written to device '/dev/sdb'. [2017/02/22 20:13:57] nwipe: notice: Finished pass 2 of 3, round 1 of 1, on device '/dev/sdb'. [2017/02/22 20:13:57] nwipe: notice: Starting pass 3 of 3, round 1 of 1, on device '/dev/sdb'. [2017/02/22 20:13:59] nwipe: notice: 951246848 bytes written to device '/dev/sda'. [2017/02/22 20:13:59] nwipe: notice: Finished pass 2 of 3, round 1 of 1, on device '/dev/sda'. [2017/02/22 20:13:59] nwipe: notice: Starting pass 3 of 3, round 1 of 1, on device '/dev/sda'. [2017/02/22 20:14:09] nwipe: notice: 951246848 bytes written to device '/dev/sdb'. [2017/02/22 20:14:09] nwipe: notice: Finished pass 3 of 3, round 1 of 1, on device '/dev/sdb'. [2017/02/22 20:14:09] nwipe: notice: Finished round 1 of 1 on device '/dev/sdb'. [2017/02/22 20:14:09] nwipe: notice: Blanking device '/dev/sdb'. [2017/02/22 20:14:12] nwipe: notice: 951246848 bytes written to device '/dev/sda'. [2017/02/22 20:14:12] nwipe: notice: Finished pass 3 of 3, round 1 of 1, on device '/dev/sda'. [2017/02/22 20:14:12] nwipe: notice: Finished round 1 of 1 on device '/dev/sda'. [2017/02/22 20:14:12] nwipe: notice: Blanking device '/dev/sda'. [2017/02/22 20:14:13] nwipe: notice: 1128095744 bytes written to device '/dev/sdc'. [2017/02/22 20:14:13] nwipe: notice: Finished pass 2 of 3, round 1 of 1, on device '/dev/sdc'. [2017/02/22 20:14:13] nwipe: notice: Starting pass 3 of 3, round 1 of 1, on device '/dev/sdc'. [2017/02/22 20:14:20] nwipe: notice: Verifying that '/dev/sdb' is empty. [2017/02/22 20:14:22] nwipe: notice: Verified that '/dev/sdb' is empty. [2017/02/22 20:14:22] nwipe: notice: Blanked device '/dev/sdb'. [2017/02/22 20:14:24] nwipe: notice: Verifying that '/dev/sda' is empty. [2017/02/22 20:14:32] nwipe: notice: Verified that '/dev/sda' is empty. [2017/02/22 20:14:32] nwipe: notice: Blanked device '/dev/sda'. [2017/02/22 20:14:32] nwipe: notice: 1128095744 bytes written to device '/dev/sdc'. [2017/02/22 20:14:32] nwipe: notice: Finished pass 3 of 3, round 1 of 1, on device '/dev/sdc'. [2017/02/22 20:14:32] nwipe: notice: Finished round 1 of 1 on device '/dev/sdc'. [2017/02/22 20:14:32] nwipe: notice: Blanking device '/dev/sdc'. [2017/02/22 20:14:52] nwipe: notice: Verifying that '/dev/sdc' is empty. [2017/02/22 20:15:09] nwipe: notice: Verified that '/dev/sdc' is empty. [2017/02/22 20:15:09] nwipe: notice: Blanked device '/dev/sdc'. Program interrupted (caught signal 2)

And the 32 bit:

Welcome - Parted Magic (Linux 4.9.1-pmagic)

root@PartedMagic:~# nwipe [2017/02/22 20:25:10] nwipe: info: Automatically enumerated 5 devices. [2017/02/22 20:25:10] nwipe: notice: Opened entropy source '/dev/urandom'. [2017/02/22 20:25:14] nwipe: info: Device '/dev/sda' has sector size 512. [2017/02/22 20:25:14] nwipe: warning: Changing '/dev/sda' block size from 4096 to 512. [2017/02/22 20:25:14] nwipe: error: Last-odd-block detected on '/dev/sda'. [2017/02/22 20:25:14] nwipe: info: Device '/dev/sda' is size 554482001146732544. [2017/02/22 20:25:14] nwipe: info: Device '/dev/sdb' has sector size 512. [2017/02/22 20:25:14] nwipe: warning: Changing '/dev/sdb' block size from 4096 to 512. [2017/02/22 20:25:14] nwipe: error: Last-odd-block detected on '/dev/sdb'. [2017/02/22 20:25:14] nwipe: info: Device '/dev/sdb' is size 554482001146732544. [2017/02/22 20:25:14] nwipe: notice: Invoking method 'DoD Short' on device '/dev/sda'. [2017/02/22 20:25:14] nwipe: notice: Starting round 1 of 1 on device '/dev/sda'. [2017/02/22 20:25:14] nwipe: notice: Starting pass 1 of 3, round 1 of 1, on device '/dev/sda'. [2017/02/22 20:25:14] nwipe: info: Device '/dev/sdc' has sector size 512. [2017/02/22 20:25:14] nwipe: warning: Changing '/dev/sdc' block size from 4096 to 512. [2017/02/22 20:25:14] nwipe: error: Last-odd-block detected on '/dev/sdc'. [2017/02/22 20:25:14] nwipe: info: Device '/dev/sdc' is size 554482001323581440. [2017/02/22 20:25:14] nwipe: info: Device '/dev/sdd' has sector size 512. [2017/02/22 20:25:14] nwipe: warning: Changing '/dev/sdd' block size from 4096 to 512. [2017/02/22 20:25:14] nwipe: error: Last-odd-block detected on '/dev/sdd'. [2017/02/22 20:25:14] nwipe: info: Device '/dev/sdd' is size 554482004265492480. [2017/02/22 20:25:14] nwipe: notice: Invoking method 'DoD Short' on device '/dev/sdc'. [2017/02/22 20:25:14] nwipe: notice: Starting round 1 of 1 on device '/dev/sdc'. [2017/02/22 20:25:14] nwipe: notice: Starting pass 1 of 3, round 1 of 1, on device '/dev/sdc'. [2017/02/22 20:25:14] nwipe: notice: Invoking method 'DoD Short' on device '/dev/sdb'. [2017/02/22 20:25:14] nwipe: notice: Starting round 1 of 1 on device '/dev/sdb'. [2017/02/22 20:25:14] nwipe: notice: Starting pass 1 of 3, round 1 of 1, on device '/dev/sdb'. [2017/02/22 20:25:14] nwipe: notice: Invoking method 'DoD Short' on device '/dev/sdd'. [2017/02/22 20:25:14] nwipe: notice: Starting round 1 of 1 on device '/dev/sdd'. [2017/02/22 20:25:14] nwipe: notice: Starting pass 1 of 3, round 1 of 1, on device '/dev/sdd'. [2017/02/22 20:25:26] nwipe: notice: 951246848 bytes written to device '/dev/sdb'. [2017/02/22 20:25:26] nwipe: notice: Finished pass 1 of 3, round 1 of 1, on device '/dev/sdb'. [2017/02/22 20:25:26] nwipe: notice: Starting pass 2 of 3, round 1 of 1, on device '/dev/sdb'. [2017/02/22 20:25:27] nwipe: notice: 951246848 bytes written to device '/dev/sda'. [2017/02/22 20:25:27] nwipe: notice: Finished pass 1 of 3, round 1 of 1, on device '/dev/sda'. [2017/02/22 20:25:27] nwipe: notice: Starting pass 2 of 3, round 1 of 1, on device '/dev/sda'. [2017/02/22 20:25:33] nwipe: notice: 1128095744 bytes written to device '/dev/sdc'. [2017/02/22 20:25:33] nwipe: notice: Finished pass 1 of 3, round 1 of 1, on device '/dev/sdc'. [2017/02/22 20:25:33] nwipe: notice: Starting pass 2 of 3, round 1 of 1, on device '/dev/sdc'. [2017/02/22 20:25:37] nwipe: notice: 951246848 bytes written to device '/dev/sdb'. [2017/02/22 20:25:37] nwipe: notice: Finished pass 2 of 3, round 1 of 1, on device '/dev/sdb'. [2017/02/22 20:25:37] nwipe: notice: Starting pass 3 of 3, round 1 of 1, on device '/dev/sdb'. [2017/02/22 20:25:40] nwipe: notice: 951246848 bytes written to device '/dev/sda'. [2017/02/22 20:25:40] nwipe: notice: Finished pass 2 of 3, round 1 of 1, on device '/dev/sda'. [2017/02/22 20:25:40] nwipe: notice: Starting pass 3 of 3, round 1 of 1, on device '/dev/sda'. [2017/02/22 20:25:48] nwipe: notice: 951246848 bytes written to device '/dev/sdb'. [2017/02/22 20:25:48] nwipe: notice: Finished pass 3 of 3, round 1 of 1, on device '/dev/sdb'. [2017/02/22 20:25:48] nwipe: notice: Finished round 1 of 1 on device '/dev/sdb'. [2017/02/22 20:25:48] nwipe: notice: Blanking device '/dev/sdb'. [2017/02/22 20:25:52] nwipe: notice: 1128095744 bytes written to device '/dev/sdc'. [2017/02/22 20:25:52] nwipe: notice: Finished pass 2 of 3, round 1 of 1, on device '/dev/sdc'. [2017/02/22 20:25:52] nwipe: notice: Starting pass 3 of 3, round 1 of 1, on device '/dev/sdc'. [2017/02/22 20:25:52] nwipe: notice: 951246848 bytes written to device '/dev/sda'. [2017/02/22 20:25:52] nwipe: notice: Finished pass 3 of 3, round 1 of 1, on device '/dev/sda'. [2017/02/22 20:25:52] nwipe: notice: Finished round 1 of 1 on device '/dev/sda'. [2017/02/22 20:25:52] nwipe: notice: Blanking device '/dev/sda'. [2017/02/22 20:25:59] nwipe: notice: Verifying that '/dev/sdb' is empty. [2017/02/22 20:26:05] nwipe: notice: Verifying that '/dev/sda' is empty. [2017/02/22 20:26:10] nwipe: notice: Verified that '/dev/sdb' is empty. [2017/02/22 20:26:10] nwipe: notice: Blanked device '/dev/sdb'. [2017/02/22 20:26:11] nwipe: notice: 1128095744 bytes written to device '/dev/sdc'. [2017/02/22 20:26:11] nwipe: notice: Finished pass 3 of 3, round 1 of 1, on device '/dev/sdc'. [2017/02/22 20:26:11] nwipe: notice: Finished round 1 of 1 on device '/dev/sdc'. [2017/02/22 20:26:11] nwipe: notice: Blanking device '/dev/sdc'. [2017/02/22 20:26:16] nwipe: notice: Verified that '/dev/sda' is empty. [2017/02/22 20:26:16] nwipe: notice: Blanked device '/dev/sda'. [2017/02/22 20:26:30] nwipe: notice: Verifying that '/dev/sdc' is empty. [2017/02/22 20:26:49] nwipe: notice: Verified that '/dev/sdc' is empty. [2017/02/22 20:26:49] nwipe: notice: Blanked device '/dev/sdc'. Program interrupted (caught signal 2)

For contrast, here is a log from me starting the same 4 drives using my old version of Parted Magic from 2013, which had nwipe version 0.14. I didn't run the wipe all the way, but I left it going for maybe an hour. Percentages looked exactly right.

Welcome - Parted Magic (Linux 3.10.18-pmagic64)

root@partedmagic:~# nwipe [2017/02/22 11:30:44] nwipe: info: Automatically enumerated 5 devices. [2017/02/22 11:30:44] nwipe: notice: Opened entropy source '/dev/urandom'. [2017/02/22 11:30:46] nwipe: info: Device /dev/sda has serial number 080527BB6200WBFBVYNF [2017/02/22 11:30:46] nwipe: info: Device '/dev/sda' has sector size 512. [2017/02/22 11:30:46] nwipe: warning: Changing '/dev/sda' block size from 4096 to 512. [2017/02/22 11:30:46] nwipe: info: Device '/dev/sda' is size 120034123776. [2017/02/22 11:30:46] nwipe: info: Device /dev/sdb has serial number 100808PBL200CSHZ6ADN [2017/02/22 11:30:46] nwipe: info: Device '/dev/sdb' has sector size 512. [2017/02/22 11:30:46] nwipe: warning: Changing '/dev/sdb' block size from 4096 to 512. [2017/02/22 11:30:46] nwipe: info: Device '/dev/sdb' is size 250059350016. [2017/02/22 11:30:46] nwipe: notice: Invoking method 'DoD Short' on device '/dev/sda'. [2017/02/22 11:30:46] nwipe: notice: Starting round 1 of 1 on device '/dev/sda'. [2017/02/22 11:30:46] nwipe: notice: Starting pass 1 of 3, round 1 of 1, on device '/dev/sda'. [2017/02/22 11:30:46] nwipe: info: Device /dev/sdc has serial number 090920FB2200VCGTK5GA [2017/02/22 11:30:46] nwipe: info: Device '/dev/sdc' has sector size 512. [2017/02/22 11:30:46] nwipe: warning: Changing '/dev/sdc' block size from 4096 to 512. [2017/02/22 11:30:46] nwipe: info: Device '/dev/sdc' is size 160041885696. [2017/02/22 11:30:46] nwipe: info: Device /dev/sdd has serial number 705BF7ORS [2017/02/22 11:30:46] nwipe: info: Device '/dev/sdd' has sector size 512. [2017/02/22 11:30:46] nwipe: warning: Changing '/dev/sdd' block size from 4096 to 512. [2017/02/22 11:30:46] nwipe: info: Device '/dev/sdd' is size 250059350016. [2017/02/22 11:30:46] nwipe: notice: Invoking method 'DoD Short' on device '/dev/sdb'. [2017/02/22 11:30:46] nwipe: notice: Starting round 1 of 1 on device '/dev/sdb'. [2017/02/22 11:30:46] nwipe: notice: Starting pass 1 of 3, round 1 of 1, on device '/dev/sdb'. [2017/02/22 11:30:46] nwipe: notice: Invoking method 'DoD Short' on device '/dev/sdc'. [2017/02/22 11:30:46] nwipe: notice: Starting round 1 of 1 on device '/dev/sdc'. [2017/02/22 11:30:46] nwipe: notice: Starting pass 1 of 3, round 1 of 1, on device '/dev/sdc'. [2017/02/22 11:30:46] nwipe: notice: Invoking method 'DoD Short' on device '/dev/sdd'. [2017/02/22 11:30:46] nwipe: notice: Starting round 1 of 1 on device '/dev/sdd'. [2017/02/22 11:30:46] nwipe: notice: Starting pass 1 of 3, round 1 of 1, on device '/dev/sdd'. Program interrupted (caught signal 2)

These were run on a Dell Optiplex 960 Processor : 2x Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz Memory : 5937MB (751MB used)

Unrelated to this exact topic, but I also noticed that this version of nwipe does not show serial numbers in the logs, which is important to me. Was that taken out intentionally at some point since version 0.14? I haven't used any versions between then and now.

If there is any other testing I can do to help, let me know. I'm not a programmer, but I have lots of different types of hardware I can throw at this to experiment, if it would be helpful.

martijnvanbrummelen commented 7 years ago

Will create a test enviroment one of these days to fix it. Thanks for reporting.

kelderek commented 7 years ago

I asked the PartedMagic guy to revert to 0.18 because it didn't seem to exhibit the problem, but they reported back that 0.18 didn't compile. I found it PartedMagic was based on Slackware so I setup a 64 bit slackware machine and tried compiling it, but got the off64_t error (issue #19). I applied the workaround you found of just defining off64_t as off_t in nwipe.h and it compiled, but I got the last odd block error. Maybe off64_t and off_t are aren't actually the same?

kelderek commented 7 years ago

I have probably spent more time fooling with this than I should have, but here are my results. I haven't done serious programming since my CS days in college 15 years ago, so I may be off base. From what I have gleaned from Google, it seems off64_t and off_t aren't very standardized across languages and compilers, hence the need for the workaround in issue #19.

Looking at the code, c2[i]->device_size is set equal to size64, then there is an if statement saying if they aren't equal, throw the last-odd-block error. Given that flow it seems like they should never be unequal since the code literally sets them equal right before checking. It seems that off64_t is a signed 64 bit int and size64 is unsigned, which would explain the problems doing a direct comparison of the two.

After fiddling around and trying different things, what seemed to work for me was removing all the off64_t references. Specifically I started with version 0.21, reverted issue #19's fix then did a find/replace of off64_t for u64 in all the source files. After that it compiled perfectly in 64 bit slackware, no longer throws the last-odd-block error, and seems to wipe at the regular pace.

I don't pretend to understand all the implications of making the change, but from what I have seen so far the only thing that might be a concern is that lseek returns off_t (possibly off64_t on 64 bit systems, although I think that is only lseek64). In nwipe.c it looks like it is only used for drive sizing, but the results are immediately trashed anyway when c2[i]->device_size is set equal to size64.

It is used more extensively in pass.c, but that seems to be for error/sanity checking and doesn't through errors as u64. That could be a false negative since it went from a signed to unsigned type. It may be that in pass.c it needs to be off64_t (with issue #19 fix back in place) or it would work better as a long long int or similar signed data type.

Please let me know what you think or if you would like me to test a patch for you. Thanks!

kelderek commented 7 years ago

Because I can't just leave well enough along I started again with a fresh 0.21 and this time just changed the device_size type from off64_t to u64 in context.h and the c2[i]->device_size comparison using off64_t to u64 in nwipe.c (line 354 of the current version of the file). That seemed to also resolve issues with a lot fewer changes.

kelderek commented 7 years ago

Ok - last thing and I will stop spamming you. I looked in the last dban code I could find (from 2006) and it used loff_t so I thought maybe that was better or at least more explicit than off64_t. But a bit of Googling makes me the actual timeline goes like this loff_t replaced by off64_t as a bridge to large file system support, finally replaced by off_t which should work anywhere. So maybe the best solution would be to replace off64_t with off_t?

As I said earlier, I haven't done serious programming in quite a long time, so I might be misunderstanding. For reference, here is a link to patch notes for XFS where they talk about doing just that for XFS http://oss.sgi.com/archives/xfs/2016-08/msg00264.html

kelderek commented 7 years ago

Also I tested PartedMagic 32 & 64, both from RAM and standard live environment. All versions gave the last-odd-block error and wacky timings with the 0.21 version of nwipe it uses.

spartanbard commented 7 years ago

Something I noticed today that I don't think was mentioned before, is that in 0.21, when selecting the disks to be wiped, the number of bytes listed on the right side changes when the disks are selected, and then goes back to what it displayed previously when deselected. Odd.

Is that behavior fixed as well with your tweaks? @kelderek

img_20170223_142404 img_20170223_142410 img_20170223_142416 img_20170223_142421 img_20170223_142425 img_20170223_142428

kelderek commented 7 years ago

I can't say I understand why, but changing to u64 does seem to fix that as well. I had noticed that behavior a while ago, but forgot about it. I verified the behavior with the vanilla 0.21 build and then used the build where I just changed device_size and the one comparison to u64. It is just odd because the code is displaying the same variable (device_size) in both instances. It seems to be the heisenberg variable - reading its value changes it, lol. Maybe it is is a signed/unsigned issue again, I don't know.

kelderek commented 7 years ago

Curiously I noticed that when I run vanilla nwipe 0.21 on Ubuntu 16.10 64 bit, it does not have the drive size display issue that slackware/partedmagic does. At this point I wonder if all our problems are due to compiler differences. Ubuntu 16.10 is using gcc 6.2.0 but slackware is back on gcc 5.3.0. Perhaps related to nwipe's switch from loff_t to off64_t and this Gnu C bug that was fixed in 2015: https://sourceware.org/bugzilla/show_bug.cgi?id=19086

It doesn't appear to call the buggy function explicitly, but if one of the included libraries does and it swaps two parameters around it might make sense that it would get toggled every time it was used.

kelderek commented 7 years ago

@martijnvanbrummelen I was thinking about it and I think long long it would be better than my original choice of u64 since it is still the same bit size as off64_t but unlike u64, long long it is signed and an offset variable could easily be negative in some circumstances. Probably not so much in nwipe's use case, but it still could be. I tried it out with long long int instead of the u64 for device_size (same changes in context.h and nwipe.c as my earlier post) and it seems to be working well for both the last-odd-block issue and the size display issue.

BTW I tried using off_t instead of off64_t and it didn't fix anything. I suspect it is due to that compiler bug I referenced.

kelderek commented 7 years ago

@martijnvanbrummelen any thoughts on switching device_size to long long? Would it help if I generated a diff/patch with my changes?

martijnvanbrummelen commented 6 years ago

@kelderek any news on this patch?

kelderek commented 6 years ago

Sorry, I never heard back from you about my questions and saw no activity in the code so I assumed you weren't interested or the project was on hold. I would have to set the whole environment up again and unfortunately I won't have time for that for at least a month. As I recall, it ended up being just changing the device_size type from "off64_t" to "long long" in context.h (line 85) and the c2[i]->device_size comparison from using "off64_t" to "long long" in nwipe.c (line 353) You could consider this post a manual patch ;)

kelderek commented 6 years ago

@martijnvanbrummelen There should be a pull request for you now with the changes above

martijnvanbrummelen commented 6 years ago

Please test with version 0.22

kelderek commented 6 years ago

Mostly good news! I downloaded and recompiled both 0.21 and 0.22 and verified that 0.21 still has the problem in current OSes. 0.22 works well. It does not report a last-odd-block error and the drive size doesn't change like it was before for @spartanbard. The drive size is a much more friendly display of GB now as well. There is one minor regression, though. 0.21 will show the drive name, e.g. "ATA WDC WD2500BJKT-7" between the device path and drive size. 0.22 just says (null) for all drives.

martijnvanbrummelen commented 6 years ago

Thanks for reporting. I already noticed the NULL bug, which I am investigating at the moment. Hopefully fixed in the next release.

kelderek commented 6 years ago

You probably already know this, but it seems to be tied to the #include <netinet/in.h> line you took out of device.c. If I add that back in the device name shows up again.

kelderek commented 6 years ago

I think I got it worked out for you. You are calling ioctl to get the hard drive information, but I think it must not be loaded when that code runs. It appears to be called by both nwipe.h and nwipe.c so I don't know why it isn't there, but if I add it to device.c, suddenly it works again. I think netinet/in.h must use it internally, so that is why it worked with that include. I will do another pull request.

kelderek commented 6 years ago

BTW I should have mentioned that v0.22 also fixed the issue with the crazy percentages and super short wipe times.