Code Monkey home page Code Monkey logo

Comments (29)

cbeyls avatar cbeyls commented on June 23, 2024 11

I owned 2 laptops with Samsung PM951 and PM961 SSDs and both had the same issue: oacs shows support but the format command returns INVALID_OPCODE(2001).
For both machines, the fix is to put to laptop to sleep, then resume it. After resume, the Samsung SSD accepts the command.

from nvme-cli.

cbeyls avatar cbeyls commented on June 23, 2024 6

@nama08 To perform a low-level format on Lenovo Thinkpad machines (both SATA and NVME), you have to use the Lenovo EFI application which allows to reset the cryptographic key and erase the drive: https://support.lenovo.com/be/fr/downloads/ds019026
This tool works with all generations of Thinkpad machines including the most recent ones.

from nvme-cli.

cbeyls avatar cbeyls commented on June 23, 2024 3

You need to have a Thinkpad machine listed on the Lenovo tool page. I personally own a T480S with a Samsung NVME drive (model MZVLB256, exactly the same as yours) and I can confirm the tool works with this drive (and I could not use nvme format with it either). The Lenovo tool is a bootable USB key image (UEFI application) so the installed OS is irrelevant. After you use the tool, your drive will be wiped clean and you can then install any OS, including Linux.

I was also able to upgrade the firmware of the Samsung drive directly from Linux using the nvme command line tool, by identifying the proper file in the Windows zip archive and following these instructions.

from nvme-cli.

keithbusch avatar keithbusch commented on June 23, 2024

That doesn't sound right since format is not an optional command to support for any device. It's required. Perhaps the device's status is incorrect, and maybe it doesn't like using the "all namespaces". Do you get the same error from running:

# nvme format /dev/nvme0 -n 1

?

from nvme-cli.

mdp2000 avatar mdp2000 commented on June 23, 2024

Yes, same error.

from nvme-cli.

keithbusch avatar keithbusch commented on June 23, 2024

Okay, in this case, I recommend forwarding the error to the controller vendor. It sounds like they require something not defined in the specification, or they simply don't support the nvme format admin command.

from nvme-cli.

keithbusch avatar keithbusch commented on June 23, 2024

Closing; this appears to be a device side issue.

from nvme-cli.

keithbusch avatar keithbusch commented on June 23, 2024

from nvme-cli.

eheiman avatar eheiman commented on June 23, 2024

Samsung PM961 128G responds with NVME Admin command error:8193 when nvme_format_ns /dev/nvme0n1 is sent on ASrock Taichi Z270 running CentOS 7.3.1611.el7.
Same SSD/same command/same OS issued on ASUS Maximus Gene VII Z97 completes successfully. Please advise possible problem(s) on Z270 system.

from nvme-cli.

keithbusch avatar keithbusch commented on June 23, 2024

That looks like you're using an older version of this tool, so I'm going to assume 8193 is in decimal. That's 2001 in hex, and according to the spec, that's an invalid opcode error. Supporting the format opcode is optional, so it sounds like controller chose not to support it, and that's okay from a specification standpoint.

from nvme-cli.

eheiman avatar eheiman commented on June 23, 2024

from nvme-cli.

keithbusch avatar keithbusch commented on June 23, 2024

If you want to verify if your controller supports the Format NVM command, run nvme id-ctrl /dev/nvme0 | grep oacs. If value does not have bit 1 set, your controller doesn't support the command, and there's nothing wrong with that from an implementation compliance standpoint.

from nvme-cli.

eheiman avatar eheiman commented on June 23, 2024

Both Z270 and Z97 systems yield oacs : 0x7. I suspect OP_CODE is modified by Z270 versus Z97. Comments will be appreciated.
Samsung_format_Z270.txt

from nvme-cli.

keithbusch avatar keithbusch commented on June 23, 2024

An oacs of 7 is advertising support for format nvm. If it's not working, you should take this issue to your vendor.

from nvme-cli.

eheiman avatar eheiman commented on June 23, 2024

from nvme-cli.

fallspectrum avatar fallspectrum commented on June 23, 2024

Just confirming that putting the machine to sleep has also resolved this issue for me.

from nvme-cli.

PeterSurda avatar PeterSurda commented on June 23, 2024

I know it's closed but I'm just adding that I had the same problem and the same solution (suspend + resume) worked. Laptop with Intel HM175 Express Chipset and Samsung SM961 512GB.

from nvme-cli.

keithbusch avatar keithbusch commented on June 23, 2024

That sounds like a firmware bug.

In any case, I hope everyone running this command is aware it obliterates your data. :)

from nvme-cli.

toyg avatar toyg commented on June 23, 2024

Almost a year later, and Samsung NVMEs are still behaving in the same way.

$> sudo nvme format /dev/nvme0n1
NVME Admin command error:INVALID_OPCODE(2001)
$> systemctl suspend
$> sudo nvme format /dev/nvme0n1
Success formatting namespace:1

from nvme-cli.

trourance avatar trourance commented on June 23, 2024

It's not working for me if I boot on an usb key to format it.

[liveuser@localhost ~]$ sudo nvme list
Node             SN                   Model                                    Namespace Usage                      Format           FW Rev  
---------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
/dev/nvme0n1     S308NAAH500323       SAMSUNG MZSLW1T0HMLH-000L1               1         220.14  GB /   1.02  TB    512   B +  0 B   3L0QCXY7

[liveuser@localhost ~]$ sudo nvme format -s1 /dev/nvme0n1
NVME Admin command error:INVALID_OPCODE(2001)
[liveuser@localhost ~]$ systemctl suspend 
[liveuser@localhost ~]$ sudo nvme format -s1 /dev/nvme0n1
NVME Admin command error:INVALID_OPCODE(2001)

from nvme-cli.

KaLisdef avatar KaLisdef commented on June 23, 2024

Hi everyone,
I've just tested the nvme format command and it worked with a live debian/gnome on a Samsung 970 EVO.
I did not had to enter in a sleep state.

from nvme-cli.

nama08 avatar nama08 commented on June 23, 2024

Hi,
I am having challenges with NVME format on Samsung drive (MZVLB256HAHQ).

Error: NVME Admin command error:INVALID_OPCODE(2001)

Note: I have been contacting Samsung support, and they weren't able to help because this particular NVMe drive was OEM. When contacted Lenovo /OEM, but no luck there as well as they do not provide support for these drives.

from nvme-cli.

nama08 avatar nama08 commented on June 23, 2024

@nama08 To perform a low-level format on Lenovo Thinkpad machines (both SATA and NVME), you have to use the Lenovo EFI application which allows to reset the cryptographic key and erase the drive: https://support.lenovo.com/be/fr/downloads/ds019026
This tool works with all generations of Thinkpad machines including the most recent ones.

Hi and thanks for your valuable reply. I will check this out. As mentioned earlier, I was in contact with Samsung support and they weren't able to help.
By the way is this process is NIST compliant?
Support for Linux based environment?

from nvme-cli.

nama08 avatar nama08 commented on June 23, 2024

Hi,
I have now checked the EFI shell, and it worked just fine.
However, I wasn't able to save the output (proof that disk is wiped securely). Is there a way to save the output /log?

from nvme-cli.

comicfans avatar comicfans commented on June 23, 2024

I have wd sn 750 1TB, nvme format gives error first,(change block size from 512 to 4096, got error code 0x4001, I'm not sure). then I tried supend/resume and it helped me

from nvme-cli.

aggieNick02 avatar aggieNick02 commented on June 23, 2024

Same drive as @comicfans (model number WDBRPG0010BNC-WRSN). On a brand new never touched drive, just running
sudo nvme format /dev/nvme0n1
returned
NVMe status: INVALID_FORMAT: The LBA Format specified is not supported. This may be due to various conditions(0x410a)

Suspend and resume fixed the issue, with the original command running succesfully after resume. So bizarre.

from nvme-cli.

Lantizia avatar Lantizia commented on June 23, 2024

Just so @trourance doesn't feel he's not the only one.

I have a Dell XPS 9360 which came with this Samsung PM961 NVMe 512GB drive...
PXL_20240212_080146851
P/N: MZVLW512HMJP - 000D1
Model: MZ - VLW512A
DP/N: 068V6F
Firmware: CXY74D1Q (which is a Dell firmware, fwupd/LVFS doesn't know of anything newer... unless someone knows of one?)

Using the latest nvme-cli version 2.7.1 via the AppImage (and I tried compiling manually too) I get this...

root@trisquel:/# ./nvme-cli-latest-x86_64.AppImage id-ctrl /dev/nvme0n1 | grep oacs
oacs      : 0x17
root@trisquel:/# ./nvme-cli-latest-x86_64.AppImage list
Node                  Generic               SN                   Model                                    Namespace  Usage                      Format           FW Rev  
--------------------- --------------------- -------------------- ---------------------------------------- ---------- -------------------------- ---------------- --------
/dev/nvme0n1          /dev/ng0n1                  S33YNX0J302237 PM961 NVMe SAMSUNG 512GB                 0x1        462.32  GB / 512.11  GB    512   B +  0 B   CXY74D1Q
root@trisquel:/# ./nvme-cli-latest-x86_64.AppImage format -f -s1 /dev/nvme0n1
NVMe status: Invalid Command Opcode: A reserved coded value or an unsupported value in the command opcode field(0x2001)
root@trisquel:/# systemctl suspend
root@trisquel:/# ./nvme-cli-latest-x86_64.AppImage format -f -s1 /dev/nvme0n1
NVMe status: Invalid Command Opcode: A reserved coded value or an unsupported value in the command opcode field(0x2001)
root@trisquel:/# ./nvme-cli-latest-x86_64.AppImage security-recv /dev/nvme0n1 -t 16 -p 0xef -n 0 -x 16
NVME Security Receive Command Success:0
       0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
0000: 00 0e 00 01 00 01 ff fe 00 29 00 00 00 00 00 00 "........)....."

So I guess bit 9 being 29 means it's still frozen... despite me issuing a command to suspend.

The only other things I've seen is this Wiki article from Thomas-Krenn-Wiki.pl which says a BIOS update to their Supermicro fixed it for them... but there are no further BIOS updates for this XPS 9360... it's on the latest.

from nvme-cli.

Lantizia avatar Lantizia commented on June 23, 2024

In the end I've found that the Dell BIOS supports a 'data wipe' and it's managed to issue the command instead... the SSD was wiped in only a handful of seconds.

But then that does mean there isn't a problem with the device... so the issue must be how nvme-cli communicates with it?

Should this issue be reopened?

from nvme-cli.

keithbusch avatar keithbusch commented on June 23, 2024

The Dell BIOS is more than likely performing some kind of vendor unique sequence to unlock this operation. There's nothing wrong with the nvme-cli tooling from the protocol perspective, but we don't inherently know vendor specific magic. We'd need to know what command sequence the special BIOS updater is doing in order to script up an equivalent with this tool.

from nvme-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.