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 devices are not showed up in lsscsi #4

Open
wxiong38 opened this issue Jul 7, 2023 · 10 comments
Open

nvme devices are not showed up in lsscsi #4

wxiong38 opened this issue Jul 7, 2023 · 10 comments

Comments

@wxiong38
Copy link

wxiong38 commented Jul 7, 2023

[root@ltcrain119-lp2 src]# ./lsscsi
[0:0:1:0] disk AIX VDASD 0001 /dev/sda
[0:0:2:0] cd/dvd AIX VOPTA /dev/sr0
[N:0:65:1] disk 3.2TB NVMe Gen4 U.2 SSD__1 -

We expect to see /dev/nvmxxx in lsscsi.

Thanks,
Wend

@doug-gilbert
Copy link
Owner

This seems to be a great opportunity to use my new clone_pseudo_fs utility found in this account. By default it will clone /sys to /tmp/sys . Then /tmp/sys can be compressed into a tarball (e.g. 'cd /tmp ; tar cvf sys_nvme_iss3.tar.gz sys') and then email the tarball to me. It is fine to do that as a non-root user. Beware of the security implications: don't do it if there is "secret" hardware on your machine. If that is not a concern, it will allow me to use the --sysfsroot= option on lsscsi to examine what is happening on your machine. My email address can be found in the lsscsi manpage.
Thanks in advance.

@jackeichen
Copy link

jackeichen commented Jul 25, 2023

I had the same problem, one type disk works well, while another doesn't:

[root@localhost tmp]# lsscsi -V
release: 0.32 2021/05/05 [svn: r167]

[root@localhost ~]# lsscsi
[0:0:0:0] disk Micron_5 400_MTFDDAK3T8TG 0 /dev/sda
[N:0:129:1] disk SAMSUNG MZWLO1T9HCJR-00A07__1 -
[N:1:65:1] disk SAMSUNG MZWLJ7T6HALA-00007__1 -
[N:2:6:1] disk SAMSUNG MZQL21T9HCJR-00B7C__1 /dev/nvme2n1
[N:3:65:1] disk SAMSUNG MZWLR3T8HCLS-00A07__1 -

Bellow is the difference:
[root@localhost ~]# find / -name nvme2n1
/dev/nvme2n1
/sys/kernel/debug/block/nvme2n1
/sys/class/block/nvme2n1
/sys/devices/pci0000:c2/0000:c2:04.0/0000:c7:00.0/nvme/nvme2/nvme2n1
/sys/block/nvme2n1
[root@localhost ~]# find / -name nvme0n1
/dev/nvme0n1
/sys/kernel/debug/block/nvme0n1
/sys/class/block/nvme0n1
/sys/devices/virtual/nvme-subsystem/nvme-subsys0/nvme0n1
/sys/block/nvme0n1

@doug-gilbert
Copy link
Owner

Thanks for the report. The difference seems to be nvme2n1 is a direct connect and nvme0n1 is "virtual" which I take to mean some intermediate device such as a PCIe switch (something similar to a SAS expander) is between that SSD and the CPU. I have the same request for you as the previous reporter: could you use clone_pseudo_ps to clone your /sys and then tar/compress the copy and email it to me. You can use the --exclude=<glob_pattern> option one or more times to prune out anything from your /sys that may comprise your security. I would like the paths that include "nvme" and are in sysfs (e.g. /sys/kernel/debug is another filesystem). Thanks in advance.

@doug-gilbert
Copy link
Owner

Almost 2 months have passed but no data has been provided to help me find this bug. I have been doing more work on clone_pseudo_fs (found under this github account) to prune only needed parts from /sys so lsscsi -y will work on NVMe devices. Only my laptop /sys contains 52057 nodes (regular files, directories, symlinks, etc) and with the following invocation that number goes down to 348 nodes under /tmp/sys :
clone_pseudo_fs -s /sys -d /tmp/sys -E device -E subsystem -p /sys/class/nvme -S
So hopefully the reporters in this thread will see fit to send me via private email these tar-ed up reduced datasets so I can look into this issue. My email address can be found in the normal places, for example the 'REPORTING BUGS' section in the lsscsi manpage. Thanks in advance.

@ze-tomreid
Copy link

ze-tomreid commented Dec 1, 2023

I have run into the same issue with a pair of Dell Express Flash PM1725b 1.6TB drives.
I have emailed the clone_pseudo_fs output in case that helps.

Something I noticed:
https://lore.kernel.org/all/[email protected]/t/
If I turn off multipathing in nvme core, lsscsi can see the dev notes properly (they don't appear under virtual).

@doug-gilbert
Copy link
Owner

Thanks for the report. Still awaiting the email with the clone_pseudo_fs output. Under the examples directory in that repository is a prun4lsscsi_nvme.sh script to reduce the size of that output. Perhaps it might prune too much but you could check that with 'lsscsi --sysfsroot=xxx' .

@ze-tomreid
Copy link

Hi Doug,
Did you receive the email? I sent it from [email protected], to the email listed on the man page.
The attachment was a 1.9MB .tar.gz from running:
clone_pseudo_fs -s /sys -d /tmp/sys -E device -E subsystem -p /sys/class/nvme -S
Cheers,
Tom

@doug-gilbert
Copy link
Owner

Still haven't received any email from you. I also sent you an email, did you receive that? Some email servers don't like the "interlog.com" domain (e.g. FreeBSD newsgroups). Perhaps you might try sending tarball to Martin Wilck [email protected] and ask him to relay it to me. Also I would like '-p /sys/devices/virtual/nvme-subsystem' or '-p /sys/class/nvme-subsystem' added to the clone_pseudo_fs invocation that you have shown above. It seems that lsscsi needs to data-mine that sysfs sub-directory looking for anything not under /sys/class/nvme .

doug-gilbert pushed a commit that referenced this issue Dec 18, 2023
Start to work on 'missing NVME device nodes' issue
[#4]
More work needed on corner cases. NVMe device
scanning may need rewrite.

Add experimental cmake support and keep autotools.
Autotools is still preferred and better tested.



git-svn-id: https://svn.bingwo.ca/repos/lsscsi/trunk@194 aaa919c1-9816-4d37-901d-0171dbb97e96
@doug-gilbert
Copy link
Owner

Svn revision 194 has just been mirrored here. It attempts to address this issue but misses some corner cases. A full fix might involve a partial rewrite. Anyway, feedback would be appreciated.

@jackeichen
Copy link

jackeichen commented Feb 4, 2024

@doug-gilbert Sorry miss your message. The new code works in my test.

If you still need some feedback, show it in this issue. I have watching this project, and should not miss it now : )

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

No branches or pull requests

4 participants