Skip to content
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 list shows incorrect usage/size and format #2173

Closed
mxiong90 opened this issue Dec 26, 2023 · 8 comments · Fixed by linux-nvme/libnvme#774
Closed

nvme list shows incorrect usage/size and format #2173

mxiong90 opened this issue Dec 26, 2023 · 8 comments · Fixed by linux-nvme/libnvme#774

Comments

@mxiong90
Copy link

mxiong90 commented Dec 26, 2023

nvme-cli version 2.7 or higher shows incorrect usage and format. size is 7.68 TB, but shows 61.45TB and format show 512B with older nvm-cli, but sees 4KiB.

nvme version 2.7.1 (git 2.7.1)
libnvme version 1.7 (git 1.7)

[700147.853053][T3178441] block nvme0n1: No UUID available providing old NGUID
[700147.864077][T3178441] block nvme1n1: No UUID available providing old NGUID
Node                  Generic               SN                   Model                                    Namespace  Usage                      Format           FW Rev
--------------------- --------------------- -------------------- ---------------------------------------- ---------- -------------------------- ---------------- --------
/dev/nvme0n1          /dev/ng0n1            S791NG0W700267       SAMSUNG MZTL27T6HBLA-00A07               0x1          0.00   B /  61.45  TB      4 KiB +  0 B   GDC6602Q
/dev/nvme1n1          /dev/ng1n1            S791NG0W700262       SAMSUNG MZTL27T6HBLA-00A07               0x1          0.00   B /  61.45  TB      4 KiB +  0 B   GDC6602Q

v2.6
nvme version 2.6 (git 2.6)
libnvme version 1.6 (git 1.6)

Node                  Generic               SN                   Model                                    Namespace  Usage                      Format           FW Rev
--------------------- --------------------- -------------------- ---------------------------------------- ---------- -------------------------- ---------------- --------
/dev/nvme0n1          /dev/ng0n1            S791NG0W700267       SAMSUNG MZTL27T6HBLA-00A07               0x1          0.00   B /   7.68  TB    512   B +  0 B   GDC6602Q
/dev/nvme1n1          /dev/ng1n1            S791NG0W700262       SAMSUNG MZTL27T6HBLA-00A07               0x1          0.00   B /   7.68  TB    512   B +  0 B   GDC6602Q
@ikegami-t
Copy link
Contributor

Seems caused by the PR linux-nvme/libnvme#754 changes linux-nvme/libnvme@7959f52 so can you test the issue behavior by reverting the commit? (Since the issue not caused on my local environment as the nvme list works correctly with the latest version.) Note: The PR includes the changes linux-nvme/libnvme@5224243 also so may needed to revert the commit also but not sure.

@mxiong90
Copy link
Author

mxiong90 commented Jan 6, 2024

was able to duplicate using nvme-cli v2.6 with libnvme v1.7 and libnvme v1.7.1

./nvme version
nvme version 2.6 (git 2.6)
libnvme version 1.7 (git 1.7)

[ 2135.952268][T23119] block nvme0n1: No UUID available providing old NGUID
[ 2135.960255][T23119] block nvme1n1: No UUID available providing old NGUID
[ 2135.968229][T23119] block nvme2n1: No UUID available providing old NGUID
[ 2135.976210][T23119] block nvme3n1: No UUID available providing old NGUID
Node                  Generic               SN                   Model                                    Namespace  Usage                      Format           FW Rev
--------------------- --------------------- -------------------- ---------------------------------------- ---------- -------------------------- ---------------- --------
/dev/nvme0n1          /dev/ng0n1            S791NG0W700245       SAMSUNG MZTL27T6HBLA-00A07               0x1          0.00   B /  61.45  TB      4 KiB +  0 B   GDC6602Q
/dev/nvme1n1          /dev/ng1n1            S791NG0W700251       SAMSUNG MZTL27T6HBLA-00A07               0x1          0.00   B /  61.45  TB      4 KiB +  0 B   GDC6602Q
/dev/nvme2n1          /dev/ng2n1            S791NG0WB00094       SAMSUNG MZTL27T6HBLA-00A07               0x1          0.00   B /  61.45  TB      4 KiB +  0 B   GDC6602Q
/dev/nvme3n1          /dev/ng3n1            S791NG0W700250       SAMSUNG MZTL27T6HBLA-00A07               0x1          0.00   B /  61.45  TB      4 KiB +  0 B   GDC6602Q

./nvme version
nvme version 2.6 (git 2.6)
libnvme version 1.7.1 (git 1.7.1)

./nvme list
[ 1678.289917][T22288] block nvme0n1: No UUID available providing old NGUID
[ 1678.297927][T22288] block nvme1n1: No UUID available providing old NGUID
[ 1678.305914][T22288] block nvme2n1: No UUID available providing old NGUID
[ 1678.313897][T22288] block nvme3n1: No UUID available providing old NGUID
Node                  Generic               SN                   Model                                    Namespace  Usage                      Format           FW Rev
--------------------- --------------------- -------------------- ---------------------------------------- ---------- -------------------------- ---------------- --------
/dev/nvme0n1          /dev/ng0n1            S791NG0W700245       SAMSUNG MZTL27T6HBLA-00A07               0x1          0.00   B /  61.45  TB      4 KiB +  0 B   GDC6602Q
/dev/nvme1n1          /dev/ng1n1            S791NG0W700251       SAMSUNG MZTL27T6HBLA-00A07               0x1          0.00   B /  61.45  TB      4 KiB +  0 B   GDC6602Q
/dev/nvme2n1          /dev/ng2n1            S791NG0WB00094       SAMSUNG MZTL27T6HBLA-00A07               0x1          0.00   B /  61.45  TB      4 KiB +  0 B   GDC6602Q
/dev/nvme3n1          /dev/ng3n1            S791NG0W700250       SAMSUNG MZTL27T6HBLA-00A07               0x1          0.00   B /  61.45  TB      4 KiB +  0 B   GDC6602Q

@igaw
Copy link
Collaborator

igaw commented Jan 18, 2024

Could you post the output of

cat /sys/class/nvme/nvme0/nvme0n1/queue/physical_block_size

and

nvme id-ns /dev/nvme0n1

I am sure physical_block_size says it's 4k, but the interesting part is what nvme id-ns will tell us.

@mxiong90
Copy link
Author

Thanks, below is output.

cat /sys/class/nvme/nvme0/nvme0n1/queue/physical_block_size
4096

and

nvme id-ns /dev/nvme0n1

NVME Identify Namespace 1:
nsze    : 0x37e3e92b0
ncap    : 0x37e3e92b0
nuse    : 0
nsfeat  : 0x1a
nlbaf   : 1
flbas   : 0
mc      : 0
dpc     : 0
dps     : 0
nmic    : 0
rescap  : 0
fpi     : 0x80
dlfeat  : 9
nawun   : 1023
nawupf  : 7
nacwu   : 0
nabsn   : 1023
nabo    : 0
nabspf  : 7
noiob   : 0
nvmcap  : 7681501126656
npwg    : 255
npwa    : 7
npdg    : 255
npda    : 7
nows    : 255
mssrl   : 0
mcl     : 0
msrc    : 0
nulbaf  : 0
anagrpid: 0
nsattr  : 0
nvmsetid: 0
endgid  : 0
nguid   : 37393130577002450025384700000001
eui64   : 0000000000000000
lbaf  0 : ms:0   lbads:9  rp:0 (in use)
lbaf  1 : ms:0   lbads:12 rp:0

@keithbusch
Copy link
Contributor

Wait, why would we check physical? The logical is the one to use.

@mxiong90
Copy link
Author

mxiong90 commented Jan 18, 2024

adding logical block size, output shows 512

cat /sys/class/nvme/nvme0/nvme0n1/queue/logical_block_size
512                                          

@igaw
Copy link
Collaborator

igaw commented Jan 19, 2024

Wait, why would we check physical? The logical is the one to use.

My bad, I got this wrong. Let me fix this.

@igaw
Copy link
Collaborator

igaw commented Jan 19, 2024

Should work again as expected. Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants