Solved USB 3.0 disks not recognized by Windows if passed through as slots.

So,If I have understood correctly,I should pass the whole disk like this ?
Code:
bhyve -S -c sockets=2,cores=2,threads=2 -m 8G -w -H -A \
-s 0,hostbridge \
-s 1,virtio-blk,/mnt/$vmdisk'p2'/bhyve/os/Linux/impish-cuda-11-5-nvidia-495.img \
-s 2,nvme,/dev/nvd0 \
-s 3,passthru,5/0/0 \
-s 4,passthru,1/0/0 \
-s 8,virtio-net,tap0 \
-s 9,virtio-9p,sharename=/ \
-s 29,fbuf,tcp=0.0.0.0:5900,w=1440,h=900 \
-s 30,xhci,tablet \
-s 31,lpc \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_BHF_CODE.fd \
#-l com1,stdio \
vm0 < /dev/null & sleep 2 && vncviewer 0:0

no problem for me. but then,since I don't see which partitions there are inside the disk,I'm not able to understand which kind of file system should I mount,because the disk appears like this :

Code:
mario@marietto-BHYVE:/home/marietto# fdisk -l

Disk /dev/nvme0n1: 931,51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: bhyve-NVMe                        
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
 
How can I mount the whole disk ?

like this :

Code:
mario@marietto-BHYVE:/home/marietto# mount -t auto /dev/nvme0n1 /mnt/nvme0n1


mount: /mnt/nvme0n1: wrong fs type, bad option, bad superblock on /dev/nvme0n1, missing codepage or helper program, or other error.

it won't work.
 
I want to inform you that I've passed through the M2 disk as a PCI device and now all the partitions inside the disk are correctly detected by Linux. This is the M2 disk that I wanted to pass thru inside the Linux guest os :

Code:
ppt5@pci0:3:0:0:        class=0x010802 rev=0x03 hdr=0x00 vendor=0xc0a9 device=0x5403 subvendor=0xc0a
9 subdevice=0x2100
vendor     = 'Micron/Crucial Technology'
class      = mass storage
subclass   = NVM

so,it's enough to add this device on the file /boot/loader.conf like this :

Code:
pptdevs="3/0/0"

trying to pass it through as a slot does not work because 'nvme' means bhyve will *emulate* an NVME device and it will treat whatever is given to it (/dev/nvd0) as just dumb storage. It doesn't care if /dev/nvd0 is an NVME device. So commands such as nvmecontrol identify etc. in the *guest* won't be passed through to /dev/nvd0 through to it. If I run nvmecontrol identify under ktrace in the guest, I will see something like this :

Code:
3657 nvmecontrol NAMI  "/dev/nvme0ns1"
 3657 nvmecontrol RET   openat 3
 3657 nvmecontrol CALL  ioctl(0x3,NVME_GET_NSID,0x1245f31731a8)
 3657 nvmecontrol RET   ioctl 0
 3657 nvmecontrol CALL  close(0x3)
 3657 nvmecontrol RET   close 0
 3657 nvmecontrol CALL  openat(AT_FDCWD,0x1245f3173260,0<O_RDONLY>)
 3657 nvmecontrol NAMI  "/dev/nvme0"
 3657 nvmecontrol RET   openat 3
 3657 nvmecontrol CALL  ioctl(0x3,NVME_PASSTHROUGH_CMD,0x1245f3173250)
 3657 nvmecontrol RET   ioctl 0
 3657 nvmecontrol CALL  close(0x3)


These ioctls will *not* be passed on the real /dev/nvd0 in the host so they are *not* going to return the same information. If I want to talk to the real nvme device from a guest, I have to use a passthrough device.

Phishfry : this is definitively one FreeBSD question. Please,be careful next time to evaluate correctly what's a FreeBSD question from what it isn't because this is not the first time that you make a categorization error. I suspect that you have the tendency to don't include some questions inside the FreeBSD category because you have some kind of mental bias or maybe some preconception,I'm not sure.
 
Back
Top