I actually ran into this myself last fall, when I got a new notebook computer and then tested various NVMe drives for use with it. There are existing Linux utilities to do various configurations of multi-threaded I/O benchmarks, and they do it reasonably well. Eg. KDiskMark on KDE/Plasma, or the Gnome disk utility. The subject of benchmarking drives is sufficiently complex, I don't think it belongs in a low-level utility like hdparm, which is used on everything from small micro-controllers, RaspberryPi's,...
Your points about real life and caching are of course valid, but to me it looks as if a single thread cannot achieve the full possible utilization, and therefore the test actually returns too low values. At least lower than the advertising promises. ;-) But it's up to you.
I dunno. I'm kinda torn by this request. How would an extreme multi-threaded read test measure anything relevant to Real Life? The existing -t flag is for measuring sequential read speed, giving an indication of the throughput that real apps might expect to achieve. Eg. KVM or virtualbox saving a multi-GB VM state. Doing simultaneous over-lapping runs of the exact same data blocks from the drive isn't going to be relevant, and might just end up with most threads reading from the on-drive cache, rather...
I dunno. I'm kinda torn by this request. How would an extreme multi-threaded read test measure anything relevant to Real Life? The existing -t flag is for measuring sequential read speed, giving an indication of the throughput that real apps might expect to achieve. Doing simultaneous over-lapping runs of the exact same data blocks from the drive isn't going to be relevant, and might just end up with most threads reading from the on-drive cache, rather than the flash memory.
Add a multi thread option for -t
Unfortunately, SATA Port Multipliers are surprisingly difficult. They never really got the "love" they deserved from chip makers and manufacturers, and the result is that getting FIS based switching (FBS) to work, end-to-end, is a rare thing. The chipset inside the port-multiplier itself (aka. "the dock"), and its firmware, both have to support FBS without any chip-specific quirks (aka. "secret bug fixes"). Then the host controller (the "card") also has to have FBS and NCQ support, and its firmware...
Both cards I'm testing with state they utilise FIS. Startech PEXESATA2 - Silicon Image - SiI3132 and Startech PEXESAT322I - ASMedia - ASM1061 According to Startech's documentation, both support FIS
Unable to run multiple hdparm secure erase actions in parallel against multiple drives using port multiplier
Not all SATA Port-Multiplier chips are capable of running multiple commands simultaneously. That is likely the issue you see here -- hardware, not software. Command-Based-Switching (CBS) is the most common type, and those can only control a single drive at any point in time. FIS-Based-Switching (FBS) are the better kind of port-multipler, and those can treat each drive completely independently, with multiple commands in-flight to multiple drives simultaneously. Cheers
Unable to run multiple hdparm secure erase actions in parallel against multiple drives using port multiplier
Replace ultrabayd unsafe echo of BEL character with printf
set-sector-size and -Istdout woes with TOSHIBA MG09ACA18TE
The datasheet clearly shows that only the models with an "S" as the 5th character support changing the sector size. Yours has an "A". Drive doesn't support it.
Migration to a more collaboration friendly codebase
This issue happens also on TOSHIBA MG10ACA20TA.
Thank you so much! This worked for me too on TOSHIBA MG10ACA20TA
HDparm creating sdX:sdX1 spurious logs in kernel log
Rejected. This is a distro bug, not an hdparm bug. Fix your distro's scripts.
HDparm creating sdX:sdX1 spurious logs in kernel log
hdparm 9.65 / remove extra EOL whitesapce from the output
hdparm 9.65 / add --long option suport for all options
No. Keeping this away from Microsoft.
fdevname memory leak
fdevname memory leak
Not a real issue with anything. The memory involved is tiny, and everything is freed when the program exits.
Try that and report back.
--- hdparm-9.65/hdparm.c 2022-09-06 13:02:56.000000000 -0400 +++ hdparm/hdparm.c 2024-03-25 20:30:28.873285139 -0400 @@ -2,7 +2,7 @@ * hdparm.c - Command line interface to get/set hard disk parameters. * - by Mark Lord (C) 1994-2022 -- freely distributable. */ -#define HDPARM_VERSION "v9.65" +#define HDPARM_VERSION "v9.65+" #define _LARGEFILE64_SOURCE /*for lseek64*/ #define _BSD_SOURCE /* for strtoll() */ @@ -3040,16 +3040,18 @@ static void get_security_password (int h } else if (!handle_NULL ||...
I get this output even when using -q (quite) when setting the SATA drive password or similar when issuing the erase command. Issuing SECURITY_SET_PASS command, password=...
Prevent password in output
I had the same issue both with a Toshiba and a Seagate driver. In the end I ended using the tool openSeaChest_FormatUnit and with that I was able to correctly change the logical sector size on both HDDs. You can download the tool from here: https://github.com/Seagate/ToolBin (binaries avail here: https://github.com/Seagate/ToolBin/tree/master/openSeaChest/bin-build/22.07.26/ ) And there is a quick guide on how to use it here: https://wiki.archlinux.org/title/Advanced_Format#Seagate The tool its from...
hdparm -t does not display accurate bandwidth for fast SSD
fdevname memory leak
Dear @hdparm team, @ideguy, It is possible to put the project on GitHub? Thanks in advance.
Hi, Is it anywhere hdparm VCS repo? If not .. is it possible to create such repo best on github/giltlab? (because SF git interface sucks)
Add missing SATA and ACS/AST/APT revisions to identify
Please close/delete this ticket, I have created an entry in patches.
Patch to add missing ssd form factors on NOMINAL FORM FACTOR
Add missing SSD Form Factor values on the NOMINAL FORM FACTOR
sanitize crypto scramble not correct
hdparm -C Update to display EPC check power mode states
set-sector-size and -Istdout woes with TOSHIBA MG09ACA18TE
Security as a background process
I have no idea what you are asking. Both '-y' and '-Y' work as intended for me -- I use them regularly, and one can even verify them by using '-C' afterward to read back the (new) drive state.
Sleep Now and Stand By Now.
I have no idea what you are asking. Both '-y' and '-Y' work as intended for me -- I use them regularly, and one can even verify them by using '-C' afterward to read back the (new) drive state.
Sleep Now and Stand By Now.
Parsing in other software: https://github.com/doug-gilbert/sg3_utils/blob/main/lib/sg_lib.c#L1840 Note about incorrect byte order i fixed there: https://github.com/doug-gilbert/sg3_utils/pull/25
Fix parsing sense data
hdparm-9.65 is released
Fix built with glibc 2.36
Okay, I'll put that #ifndef in place for v9.65 and hope that it does more good than harm. Thanks
`set-sector-size` out of range
Yes, that got fixed ages ago! :)
oh , debian stable provided hdparm version is 9.60, update to newest hdparm everything is good :)
`set-sector-size` out of range
one option is to make an ifdef around the include of linux/fs.h: #ifndef FSCONFIG_SET_FLAG #include <linux/fs.h> #endif
if at all this depends on the glibc version I think. the patch looks good to me. I have tested the following patch against glibc 2.19 and gcc 4.8, which is the oldest I still have around, and it compiles flawless. I have removed all linux/ includes as they should come via glibc (via sys/) instead: --- hdparm-9.64/hdparm.c +++ hdparm-9.64/hdparm.c @@ -24,9 +24,6 @@ #include <sys/mount.h> #include <sys/mman.h> #include <sys/user.h> -#include <linux/types.h> -#include <linux/fs.h> -#include <linux/major.h>...
This shouldn't have anything to do with GCC(?). At least for my tests hdparm 9.64 with the patch applied compiled fine on two systems, one with glibc 2.35 and one with glibc 2.36 where it failed to build without the patch.
Thanks. But doing this will break builds with older versions. Can you make it conditional upon the version of GCC ?
proposed fix
Fix built with glibc 2.36
hdparm-9.64 is released
Issue trying to secure erase.
Fix for some unit formatting issues
hdparm-9.63 is released
I have renamed the new flag to be "--sanitize-overwrite-passes" to avoid confusion with existing flags where "-pass" refers to a password. Otherwise, applied for hdparm-9.63.
Hi Mark, did you have a time to look at the path bellow ?
adding patch adding option to specify the pass count
hdparm --sanitize-overwrite do not have an option to change the count parameter and default value
Not a bug. It does what one asks it to do. If one wants just a single-pass erase, then use "--security-erase" instead. But I'm totally open to anyone who wants to submit a patch which adds a command-line option to specify the exact number of sanitize cycles. Cheers
I'm looking through the source code, and I see provisions such as: switch (sanitize_feature) { case SANITIZE_STATUS_EXT: printf("Sanitize status:\n"); sanitize_state = get_sanitize_state(r.hob.nsect); sanitize_normal_output(sanitize_state, &r); break; When I run an enhanced secure erase command, I simply get nothing, it states that it's performing the erase, but nothing changes, then eventually at 30 minutes the process ends. Am I doing something wrong? How do I monitor this process?
hdparm --sanitize-overwrite do not have an option to change the count parameter and default value
addendum, this looks mpt3sas specific, the sata interfaces aren't timing out after all
scsi timeouts in latest ubuntu kernels
On 22/09/2021, Mark Lord ideguy@users.sourceforge.net wrote: Applied, thanks. I especially like how it nicely handles "0" as well as "1". :) Oh yes :) The second case instead always has plural hours and never 1 minute. If it ever gets internationalized this will all need reworking, but for now... Blessings & thanks M
Applied, thanks. I especially like how it nicely handles "0" as well as "1". :)
hdparm -I 12 says "(1 minutes)" and -I 242 "(1 hours)"
"I have no idea why the compiler is treating bit shift output as signed value performing sign extension instead of zero extension." The reason is that unsigned short promotes to signed int unless short and int have the same length. ISO C language standard, section 6.3.1.1. Mr. Lord fixed hdparm but C is unfixable.
hdparm -I 12 says "(1 minutes)" and -I 242 "(1 hours)"
hdparm -I /dev/sda crashes device
Kernel (libata) bug, not hdparm.
The error still exists in versoin 9.62.
hdparm --dco-identify reports invalid value for Real max sectors
Fix this and similar bugs elsewhere in the code. hdparm-9.62 now available.
hdparm-9.62 is released
hdparm --dco-identify reports invalid value for Real max sectors
hdparm-9.61 is released
-J Get/set Western DIgital "Idle3" timeout for a WDC "Green" drive (DANGEROUS) There is support in there, but this was written many years ago, and WD may have changed the protocol. So it might still work, or it might brick your drive. Your call. WD doesn't tell us how it works, so that's the best shot at it for now.
This should have been added in version 9.38. Though documentation claims it's not somehow as good as it could. Is idle3ctl also lacking in this regard?
hdparm-9.60 is released
hdparm-9.59 is released