Closed way2me closed 2 years ago
Do you only have one nvme device? If not, make sure nvme0 really is the parent controller to nvme0n1. Sometimes it's not. So if you have more than one nvme, try to use the nvme0n1 handle consistently rather than sometimes using nvme0.
If you have only one, or are sure nvme0 is the parent to nvme0n1, then the 2nd format command looks fine. Does it work if you use lbaf 0?
If not, try using namespace id 0xffffffff. Some controllers just don't allow formatting a specific namespace, even if they only have one. The 'id-ctrl' fna field should indicate if this is one of those types, though that's not the right return code even if this is one of those kinds of controllers.
I have only 1 drive in this laptop. With 0xffffffff, same output with lbaf=0 too, result is same, failed with same output
ubuntu@ubuntu:~$ sudo nvme format /dev/nvme0 -n 0xffffffff -l 1
NVMe status: INVALID_FORMAT: The LBA Format specified is not supported. This may be due to various conditions(0x10a)
ubuntu@ubuntu:~$ sudo nvme id-ctrl -H /dev/nvme0n1
NVME Identify Controller:
vid : 0x1c5c
ssvid : 0x1c5c
sn : XXXXXXXXXXXXX
mn : SKHynix_HFS512GD9TNG-L5B0B
fr : 80750C10
rab : 4
ieee : ace42e
cmic : 0
[3:3] : 0 ANA not supported
[2:2] : 0 PCI
[1:1] : 0 Single Controller
[0:0] : 0 Single Port
mdts : 6
cntlid : 0x1
ver : 0x10300
rtd3r : 0x7a120
rtd3e : 0x1e8480
oaes : 0x200
[14:14] : 0 Endurance Group Event Aggregate Log Page Change Notice Not Supported
[13:13] : 0 LBA Status Information Notices Not Supported
[12:12] : 0 Predictable Latency Event Aggregate Log Change Notices Not Supported
[11:11] : 0 Asymmetric Namespace Access Change Notices Not Supported
[9:9] : 0x1 Firmware Activation Notices Supported
[8:8] : 0 Namespace Attribute Changed Event Not Supported
ctratt : 0
[9:9] : 0 UUID List Not Supported
[7:7] : 0 Namespace Granularity Not Supported
[5:5] : 0 Predictable Latency Mode Not Supported
[4:4] : 0 Endurance Groups Not Supported
[3:3] : 0 Read Recovery Levels Not Supported
[2:2] : 0 NVM Sets Not Supported
[1:1] : 0 Non-Operational Power State Permissive Not Supported
[0:0] : 0 128-bit Host Identifier Not Supported
rrls : 0
crdt1 : 0
crdt2 : 0
crdt3 : 0
oacs : 0x17
[9:9] : 0 Get LBA Status Capability Not Supported
[8:8] : 0 Doorbell Buffer Config Not Supported
[7:7] : 0 Virtualization Management Not Supported
[6:6] : 0 NVMe-MI Send and Receive Not Supported
[5:5] : 0 Directives Not Supported
[4:4] : 0x1 Device Self-test Supported
[3:3] : 0 NS Management and Attachment Not Supported
[2:2] : 0x1 FW Commit and Download Supported
[1:1] : 0x1 Format NVM Supported
[0:0] : 0x1 Security Send and Receive Supported
acl : 3
aerl : 7
frmw : 0x16
[4:4] : 0x1 Firmware Activate Without Reset Supported
[3:1] : 0x3 Number of Firmware Slots
[0:0] : 0 Firmware Slot 1 Read/Write
lpa : 0x2
[3:3] : 0 Telemetry host/controller initiated log page Not Supported
[2:2] : 0 Extended data for Get Log Page Not Supported
[1:1] : 0x1 Command Effects Log Page Supported
[0:0] : 0 SMART/Health Log Page per NS Not Supported
elpe : 255
npss : 4
avscc : 0x1
[0:0] : 0x1 Admin Vendor Specific Commands uses NVMe Format
apsta : 0x1
[0:0] : 0x1 Autonomous Power State Transitions Supported
wctemp : 359
cctemp : 360
mtfa : 0
hmpre : 0
hmmin : 0
tnvmcap : 0
unvmcap : 0
rpmbs : 0
[31:24]: 0 Access Size
[23:16]: 0 Total Size
[5:3] : 0 Authentication Method
[2:0] : 0 Number of RPMB Units
edstt : 60
dsto : 1
fwug : 0
kas : 0
hctma : 0x1
[0:0] : 0x1 Host Controlled Thermal Management Supported
mntmt : 273
mxtmt : 358
sanicap : 0x3
[31:30] : 0 Additional media modification after sanitize operation completes successfully is not defined
[29:29] : 0 No-Deallocate After Sanitize bit in Sanitize command Supported
[2:2] : 0 Overwrite Sanitize Operation Not Supported
[1:1] : 0x1 Block Erase Sanitize Operation Supported
[0:0] : 0x1 Crypto Erase Sanitize Operation Supported
hmminds : 0
hmmaxd : 0
nsetidmax : 0
anatt : 0
anacap : 0
[7:7] : 0 Non-zero group ID Not Supported
[6:6] : 0 Group ID does not change
[4:4] : 0 ANA Change state Not Supported
[3:3] : 0 ANA Persistent Loss state Not Supported
[2:2] : 0 ANA Inaccessible state Not Supported
[1:1] : 0 ANA Non-optimized state Not Supported
[0:0] : 0 ANA Optimized state Not Supported
anagrpmax : 0
nanagrpid : 0
sqes : 0x66
[7:4] : 0x6 Max SQ Entry Size (64)
[3:0] : 0x6 Min SQ Entry Size (64)
cqes : 0x44
[7:4] : 0x4 Max CQ Entry Size (16)
[3:0] : 0x4 Min CQ Entry Size (16)
maxcmd : 0
nn : 1
oncs : 0x5e
[7:7] : 0 Verify Not Supported
[6:6] : 0x1 Timestamp Supported
[5:5] : 0 Reservations Not Supported
[4:4] : 0x1 Save and Select Supported
[3:3] : 0x1 Write Zeroes Supported
[2:2] : 0x1 Data Set Management Supported
[1:1] : 0x1 Write Uncorrectable Supported
[0:0] : 0 Compare Not Supported
fuses : 0
[0:0] : 0 Fused Compare and Write Not Supported
fna : 0x6
[2:2] : 0x1 Crypto Erase Supported as part of Secure Erase
[1:1] : 0x1 Crypto Erase Applies to All Namespace(s)
[0:0] : 0 Format Applies to Single Namespace(s)
vwc : 0x1
[0:0] : 0x1 Volatile Write Cache Present
awun : 0
awupf : 0
nvscc : 1
[0:0] : 0x1 NVM Vendor Specific Commands uses NVMe Format
nwpc : 0
[2:2] : 0 Permanent Write Protect Not Supported
[1:1] : 0 Write Protect Until Power Supply Not Supported
[0:0] : 0 No Write Protect and Write Protect Namespace Not Supported
acwu : 0
sgls : 0
[1:0] : 0 Scatter-Gather Lists Not Supported
mnan : 0
subnqn :
ioccsz : 0
iorcsz : 0
icdoff : 0
ctrattr : 0
[0:0] : 0 Dynamic Controller Model
msdbd : 0
ps 0 : mp:6.3000W operational enlat:5 exlat:5 rrt:0 rrl:0
rwt:0 rwl:0 idle_power:- active_power:-
ps 1 : mp:2.4000W operational enlat:30 exlat:30 rrt:1 rrl:1
rwt:1 rwl:1 idle_power:- active_power:-
ps 2 : mp:1.9000W operational enlat:100 exlat:100 rrt:2 rrl:2
rwt:2 rwl:2 idle_power:- active_power:-
ps 3 : mp:0.0500W non-operational enlat:1000 exlat:1000 rrt:3 rrl:3
rwt:3 rwl:3 idle_power:- active_power:-
ps 4 : mp:0.0040W non-operational enlat:1000 exlat:9000 rrt:3 rrl:3
rwt:3 rwl:3 idle_power:- active_power:-
fna : 0x6
[2:2] : 0x1 Crypto Erase Supported as part of Secure Erase
[1:1] : 0x1 Crypto Erase Applies to All Namespace(s)
[0:0] : 0 Format Applies to Single Namespace(s)
I think you'd have to open a bug with your vendor at this point.
Any other way to change sector size?
No other spec defined way. Your drive is simply not behaving to the spec, so I'd guess it's a drive firmware bug. You'll need to contact the vendor for a solution.
@way2ezee is it pc401 drive?
@way2ezee is it pc401 drive?
It may appear so based on the model number, though I am not sure what the L5B0B suffix indicates. That actually looks closer aligned to the PC601 from what I can gather from the public listings on skhynix.com.
Seems like pc601 judging by sn. I'd try to contact Lenovo & hynix simultaneously.
Yep, pc601
@way2ezee Sorry, my comment may look misleading - please e-mail them. As it's PC601, it might get fixed.
They do not take customers seriously https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T-series-Laptops/nvme-format-failing-with-4096-sector-size/m-p/5043069?page=1#5160285
Don't take it personally. Your experience so far is par for the course with any vendor.
BTW, they seem to think it could be a security setting on the device. That could certainly prevent a format command, but I don't think they're using the correct error code. Security sequences should use the "Command Sequence Error".
On a side note, while the 4k format provides all the right guarantees for more optimal access granularity, as long as you partition your device on a 4k boundary, most Linux filesystems will use 4k aligned access too.
I got error performing sanitize
or format
:
[tom@ideapad ~]$ sudo nvme sanitize /dev/nvme0n1 -a 2
NVMe status: ACCESS_DENIED: Access to the namespace and/or LBA range is denied due to lack of access rights(0x4286)
[tom@ideapad ~]$ sudo nvme format /dev/nvme0 -n 1 -l 1
You are about to format nvme0, namespace 0x1.
Controller nvme0 has child namespace(s):nvme0n1
WARNING: Format may irrevocably delete this device's data.
You have 10 seconds to press Ctrl-C to cancel this operation.
Use the force [--force|-f] option to suppress this warning.
Sending format operation ...
NVMe status: INVALID_FORMAT: The LBA Format specified is not supported. This may be due to various conditions(0x410a)
And the suspend trick worked for me on my IdeaPad S540-13ARE / WD SN 730: https://superuser.com/questions/1574424/format-ssd-with-nvme-lba-format-specified-is-not-supported
Looks like some UEFI firmwares implement some sort of freeze for NVMe drives like they did for ATA drives...I recall the same trick can help on some machine if one wants to perform ATA Secure Erase on an internally attached SATA SSD...
Thank you @tomty89 can confirm that silly workaround worked
# nvme id-ns /dev/nvme0 --namespace-id=1 -H
LBA Format 0 : Metadata Size: 0 bytes - Data Size: 512 bytes - Relative Performance: 0 Best (in use)
LBA Format 1 : Metadata Size: 0 bytes - Data Size: 4096 bytes - Relative Performance: 0 Best
# nvme format /dev/nvme0n1 --lbaf=1
You are about to format nvme0n1, namespace 0x1.
Namespace nvme0n1 has parent controller(s):nvme0
...
Sending format operation ...
NVMe status: INVALID_FORMAT: The LBA Format specified is not supported. This may be due to various conditions(0x10a)
# systemctl suspend
...physically wake machine....
# nvme format /dev/nvme0 --lbaf=1
You are about to format nvme0, namespace 0xffffffff(ALL namespaces).
Controller nvme0 has child namespace(s):nvme0n1
Sending format operation ...
Success formatting namespace:ffffffff
failed to re-read partition table
My setup in case it helps
sn : ADA8N658110108P6M
mn : SHGP31-2000GM
Doesn't seem there is anything we can do here. Closing the issue, if you think is still relevant please reopen.
Had the same problem with WD SN700, the suspend trick worked for me :+1:
The suspend/resume trick has worked for me as well on a number of motherboards, but not all. So YMMV, depending on the motherboard.
Please see my comment on this related issue here. It covers what is happening, why the suspend/resume trick often works, and what you can do when it does not.
Please help me to troubleshoot this problem.
Command Output:-
Thanks