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

NVME Admin command error: INVALID_OPCODE(2001) #84

Closed
mdp2000 opened this Issue May 9, 2016 · 19 comments

Comments

Projects
None yet
9 participants
@mdp2000

mdp2000 commented May 9, 2016

I purchased Parted Magic to erase the drive in a new X1 Carbon 20FB-004QUS, however, although I can run Erase Disk - NVMe Secure Erase option and see the drive (Samsung MZVKV512HAJH-000L1), the erase process ends with "/dev/nvme0n1: Error! Disk is not erased". I then attempted a command line "nvme format /dev/nvme0n1 --ses=1", as well as "nvme format /dev/nvme0n1" (which a Parted Magic support forum admin confirmed is the command they use), but in both cases I get "Admin command error:INVALID_OPCODE(2001)" as the result. The Parted Magic forum admin requested that I contact you directly for assistance. Any feedback on how to correctly secure erase this drive is appreciated.

Thank you.

@keithbusch

This comment has been minimized.

Contributor

keithbusch commented May 9, 2016

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

?

@mdp2000

This comment has been minimized.

mdp2000 commented May 9, 2016

Yes, same error.

@keithbusch

This comment has been minimized.

Contributor

keithbusch commented May 9, 2016

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.

@keithbusch

This comment has been minimized.

Contributor

keithbusch commented May 10, 2016

Closing; this appears to be a device side issue.

@keithbusch keithbusch closed this May 10, 2016

@keithbusch

This comment has been minimized.

Contributor

keithbusch commented May 3, 2017

@eheiman

This comment has been minimized.

eheiman commented Jul 6, 2017

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.

@keithbusch

This comment has been minimized.

Contributor

keithbusch commented Jul 6, 2017

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.

@eheiman

This comment has been minimized.

eheiman commented Jul 6, 2017

@keithbusch

This comment has been minimized.

Contributor

keithbusch commented Jul 6, 2017

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.

@eheiman

This comment has been minimized.

eheiman commented Jul 6, 2017

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

@keithbusch

This comment has been minimized.

Contributor

keithbusch commented Jul 6, 2017

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

@cbeyls

This comment has been minimized.

cbeyls commented Aug 4, 2017

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.

@eheiman

This comment has been minimized.

eheiman commented Aug 7, 2017

@fallspectrum

This comment has been minimized.

fallspectrum commented Aug 9, 2017

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

@PeterSurda

This comment has been minimized.

PeterSurda commented Aug 26, 2017

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.

@keithbusch

This comment has been minimized.

Contributor

keithbusch commented Aug 28, 2017

That sounds like a firmware bug.

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

@toyg

This comment has been minimized.

toyg commented May 24, 2018

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
@trourance

This comment has been minimized.

trourance commented Oct 12, 2018

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)
@KaLisdef

This comment has been minimized.

KaLisdef commented Nov 13, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment