41

I'm shopping for a new NVMe SSD drive for my laptop and with the second deciding factor being Linux compatibility, I'd looked up the names of specific drives in the source code of Linux and discovered that their controllers have quirks that have to be worked around.

Now, I figured out more or less how quirks affecting one of the controllers impact its functionality under Linux, but there's another controller that I have a trouble understanding how disabling the aforementioned command limits the functionality of, if at all; therefore I'd like to ask you all, under what circumstances is the command used by a host and can disabling it lower the performance or power efficiency of an impacted controller/drive?

To be clear, the quirk workaround I'm talking a about is NVME_QUIRK_DISABLE_WRITE_ZEROES.

top 16 comments
sorted by: hot top controversial new old
[-] themoonisacheese@sh.itjust.works 27 points 1 year ago

Considering what specific nvme drive to use on Linux hasn't been a real problem for at least 5 years, especially if you just plan to stick it in a laptop. Just buy a drive from a reputable brand from a reputable source.

[-] penquin@lemm.ee 14 points 1 year ago

I have a WD black SN770 in my main desktop and it works no issues. I even have btrfs on it, and some people suggested that btrfs would have some issues with nvmes, but here I am over a year later with zero issues. Speed on these things is out of this world.

[-] ReversalHatchery@beehaw.org 3 points 1 year ago

That's good news, but what if this affects wear leveling? Or efficiency in some other way, that would result in these dying sooner than expected (still years probably, but.. yeah)

[-] penquin@lemm.ee 2 points 1 year ago

I make back ups. If this dies, I'll get another one. They became very cheap lately. 1TB is like $55

[-] ReversalHatchery@beehaw.org 1 points 1 year ago

Others may still be interested in longevity. Like me. $55 is, while not expensive, not cheap either for me, or at least not in the way that I would be comfortable replacing it every 1-2 years. I'm not swimming in money at that amount has a better place than a recurring spending. I doubt I am in a minority with this.

It's good to know what the quirks mean, and if it means any longevity problem, because if the above turns out as a problem, it may be cheaper in the long term to buy a better drive.

[-] penquin@lemm.ee 1 points 1 year ago

I ain't rich either. I just don't think the drive will die in a year or two. I've had mine for over a year now and it's still solid. It might die earlier if you keep distro-hopping with all that erasing and writing you put on it. I'm pretty sure it'll last a very long time. I also have a laptop from 2018 and it still has the same nvme drive running solid. I remember checking its life with some command in the terminal (don't remember what it is) and it was at 57%.

[-] mvirts@lemmy.world 8 points 1 year ago

Isn't that referring to the write zeros ata command to erase the whole drive?

[-] Bitrot@lemmy.sdf.org 10 points 1 year ago

No, it is referring to the NVMe write zeroes command that is used to set a range of blocks to zero. It seems like it is related to deallocate/TRIM functionality but I can only find documentation about the command without a good definition of why it would be used.

Some drives say they support it but don’t really, or it negatively affects performance, so they have quirks.

[-] forestfuturist@lemmy.world 1 points 11 months ago

What if you try to wipe a NVME-drive for which this quirk is enabled by default in the kernel? Does that mean that even if you used something like the 'erase device' function in GNOME Disks on said drive, it would in fact not actually completely zero the drive? What if you use GNOME Disks to wipe a partition on said drive?

Or does this quirk refer to an entirely different operation?

[-] Bitrot@lemmy.sdf.org 2 points 11 months ago

Different feature. NVMe drives include a format command that can zero the drive or do a more in depth erasure, newer drives also have the sanitize option. I think this command just lets the system send a bunch of zeroes instead of having to send each one individually.

[-] forestfuturist@lemmy.world 1 points 11 months ago

Thanks for the answer! So do I assume correctly then that things like using the 'overwrite data'-option when running BleachBit, or wiping/erasing partitions or disks with zeroes in GNOME Disks or GParted actually does zero the data like normal, even if the quirk is enabled?

[-] Bitrot@lemmy.sdf.org 1 points 11 months ago

It depends how those tools are working at a lower level. Usually it is better to use a security erase feature in the drive itself, or the NVMe format command. Every drive has some sort of implementation.

SSDs have a lot of tricks to increase performance and longevity, things like wear leveling or not actually writing all those zeroes to the NAND, so writing all zeroes may leave a lot of data untouched on the actual drive while the firmware keeps a tally.

[-] MNByChoice@midwest.social 8 points 1 year ago

I am coming at this from a more general angle, so this may not be as applicable.

When a repeated series of inputs is written to a drive, a number of optimisations can be applied. If the user wants a large number of zeros written, the drive's firmware can use a short cut. Instead of writing those zeros, it can make a note that a number of blocks, at a location, are all zero.

This becomes apparent if one runs fio against the raw block devices versus a software later like LVM. Some operations against some layers will be unreasonably fast. There is a lot of nuance to this.

My read of the quirk is an incompatibility between what Linux expects and the firmware. Enable the quirk only if the dmesg errors are present. Do not expect that the drive has been zeroed. If you want your data secure at disposal of the drive, the then use encryption.

[-] swizzle9144@lemmy.blahaj.zone 2 points 1 year ago

Thanks a lot! This clarifies it for me, and if I understand correctly, it shouldn't be a concern for me since my laptop isn't used for data-intensive computing.

[-] forestfuturist@lemmy.world 1 points 11 months ago

What if you try to wipe a NVME-drive for which this quirk is enabled by default in the kernel? Does that mean that even if you used something like the 'erase device' function in GNOME Disks on said drive, it would in fact not actually completely zero the drive? What if you use GNOME Disks to wipe a partition on said drive?

Or does this quirk refer to an entirely different operation?

[-] MNByChoice@midwest.social 2 points 11 months ago

A bit outside of my knowledge, but I understand that too be a long standing issue. Wiping issues are a good reason to encrypt a NVMe drive.

This page suggest the nvmi-cli has a secure format command that will do it. http://blog.pythonaro.com/2018/05/how-to-securely-wipe-nvme-drive.html?m=1

Hopefully, someone more knowledgeable will also tag me in their response.

this post was submitted on 19 Oct 2023
41 points (97.7% liked)

Linux

47733 readers
1041 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS