Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add serial number support for USB devices #230

Conversation

PartialVolume
Copy link
Collaborator

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.

Chipsets that support this include:
ASMedia, Initio, Oxford, newer JMicron-JM20329, JM20335-39, Prolific PL2507/3507 PL2571/2771/2773/2775 ,Sunplus SPIF215/6, SPIF225/6.
Jmicron, Prolific and Sunplus supports fully ATA pass-through.

Further information can be found here:
https://www.smartmontools.org/wiki/USB

In addition, the device type, i.e USB or ATA is now shown on the selection
and wipe windows.

Closes #149

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 martijnvanbrummelen#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.
@PartialVolume PartialVolume merged commit 6943e35 into martijnvanbrummelen:master Mar 24, 2020
@PartialVolume PartialVolume deleted the Get_device_bus_type_and_serial_number branch March 24, 2020 22:51
@mdcato
Copy link

mdcato commented Mar 29, 2020 via email

@PartialVolume
Copy link
Collaborator Author

@mdcato Thanks for the detailed feedback, it is much appreciated.

Thanks for the info on the USB to IDE/SATA adapters, I need to capture this info somewhere in a table, maybe start a supported USB adapters page on the Github nwipe wiki page (which is currently empty).

Special thanks for reporting the throughput discrepancy. I saw a discrepancy only the once and thought that's odd ! there's a bug in there somewhere. After that one occurence I didn't see it again. However I think the reason for that is that when I wiped multiple drives they were all the same size on the same type of interface (ATA) so all wipes ended pretty much at the same time. It sounds like if you have multiple wipes that end at different times the throughput calculation is still running for the wipes that ended, hence the lower values you are seeing. I'll take a look at the code and issue a patch today or Monday.

Another thing I noticed in the GUI is that [writing] and [syncing] seem to be mutually exclusive (replaced by [-------] when the other is showing). It seems these could thus occupy the same position on the screen so the info could be spread across the 80-column width. Also, since I’m on a roll, it would be nice if the throughput values’ formatting was %3llu to right justify the numeric portion. And [blanking] (10 chars total) is wider than [writing] or [syncing] (9 chars total) so once blanking begins, it forces everything following to the right be 1 character (I like columns for quick glances at progress).

Totally agree on all the points you raise here. After I'd created the [---------] I did think we don't need that, just use the one bracketed text that just changes depending on what it's doing and like you say free's up some space. Also noted the difference in characters length between blanking and syncing and will fix that Monday. ( I like columns that all line up too ).

@mdcato
Copy link

mdcato commented Mar 29, 2020 via email

@PartialVolume
Copy link
Collaborator Author

Can you send me the output of

smartctl --all /dev/nvme0n1
smartctl -i /dev/nvme0n1

Using whatever the device name is of your 240GB samsung 970 EVO Plus.
Connected via your USB adapter but also via the NVME bus on you motherboard if your motherboard supports NVME. Just want to see if there is a reason why it's missing the serial number.

Unfortunately, my kit is all old equipment, so can't troubleshoot this my end.

I've sorted the throughput issue, I'm just running tests on multiple drives of different sizes to confirm its working. It was indeed still calculating throughout on a completed wipe. Once all the tests have passed I'll merge Monday morning GMT.

@mdcato
Copy link

mdcato commented Mar 29, 2020 via email

@PartialVolume
Copy link
Collaborator Author

@mdcato that's great thanks. Am I correct in assuming the serial number does show up in nwipe for the NVME drive that's connected directly to the motherboard?

@mdcato
Copy link

mdcato commented Mar 30, 2020 via email

@PartialVolume
Copy link
Collaborator Author

@mdcato Adding NVME instead of UNK should be ok. I use readlink for the process of identifying the bus when libparted doesn't recognize it.

Can you run

sudo readlink /dev/nvme0n1

and paste the path it returns.

Depending on what's produced I can then work with that data to add NVME. Thanks.

@PartialVolume
Copy link
Collaborator Author

PartialVolume commented Mar 30, 2020

@mdcato I've merged the throughput fix, next time you have a chance can you download the latest master and run some wipes on multiple discs of different sizes to check the individual drive throughputs show the throughput of the drive when wipe finished rather than the throughput gradually getting less and less while other drives are still wiping.

I ran tests on two disks of different sizes that were showing this problem. After the patch it all looks good at this end.

Thanks

@mdcato
Copy link

mdcato commented Mar 30, 2020 via email

@PartialVolume
Copy link
Collaborator Author

@mdcato I wonder if it's got anything to do with this bug https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1647485

Can you

ls -al /dev/

and paste here. Also what distro and version are you using ?

@mdcato
Copy link

mdcato commented Mar 30, 2020 via email

@mdcato
Copy link

mdcato commented Mar 30, 2020 via email

@PartialVolume
Copy link
Collaborator Author

Sorry ! I gave you some duff info. You need to type

sudo readlink /sys/block/nvme0n1

and not

sudo readlink /dev/nvme0n1

@mdcato
Copy link

mdcato commented Mar 30, 2020 via email

@PartialVolume
Copy link
Collaborator Author

That's great, thanks. That's all I need to add NVME.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disks plugged into USB don't show serial number, while direct SATA/IDE/SCSI do.
2 participants