openzfsonwindows / ZFSin

OpenZFS on Windows port
https://openzfsonwindows.org
1.2k stars 68 forks source link

zfs pool on usb stick not detected #230

Open superbonaci opened 4 years ago

superbonaci commented 4 years ago

zpool created with FreeBSD on usb stick. Testing operating system: Windows 10 build 18362. OpenZFS installed: OpenZFSOnWindows-debug-20200206.exe

The pool was created as tank pool, then renamed to zfs pool. Then label zfs was added to ad0 with glabel.

root@ubuntu:/# lsblk -o NAME,TYPE,FSTYPE,LABEL,SIZE,MODEL,MOUNTPOINT /dev/sdb
NAME TYPE FSTYPE     LABEL  SIZE MODEL          MOUNTPOINT
sdb  disk zfs_member zfs    3,9G ADATA

When attached to Windows:

C:\WINDOWS\system32>zpool list
no pools available
C:\WINDOWS\system32>zpool import
path '\\?\usbstor#disk&ven_xxxx&prod_xxxx_xxxxx&rev_x.xx#xxxxxxxxxxxxxxxx&0#{xxx}'
 and '\\?\PhysicalDrive4'
read partitions ok 1
    mbr 0: type 4 off 0x0 len 0xXXXXXXXXX
asking libefi to read label
[...]
no pools available to import

Linux finds the pool properly:

root@debian:~# zpool import
   pool: zfs
     id: 1934444923061399555
  state: ONLINE
 status: Some supported features are not enabled on the pool.
 action: The pool can be imported using its name or numeric identifier, though
    some features will not be available without an explicit 'zpool upgrade'.
 config:

    zfs         ONLINE
      sdb       ONLINE
lundman commented 4 years ago

If it is on a partition, as opposed to whole-disk, then ZFSin will not yet "see" it. The partition choice for pools have not yet been implemented. It is assumed wholedisk, or file-based.

I'll see if I have some time to look at it. In fact, if you could make a small - mostly empty - pool the way you made it (that doesn't work) and send it to me, I'll have something to work on.

superbonaci commented 4 years ago

I've used the whole disk, "zpool create tank da1", not any partition inside. Will try to make the raw image and send it to you.

superbonaci commented 4 years ago

email sent

lundman commented 4 years ago

Downloaded, used vhdtool to convert .raw to .vhd, mounted as disk, and it imports fine:

  pool: zfs
 state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
        still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
        the pool may no longer be accessible by software that does not support
        the features. See zpool-features(5) for details.
  scan: none requested
config:

        NAME                   STATE     READ WRITE CKSUM
        zfs                    ONLINE       0     0     0
          /dev/physicaldrive3  ONLINE       0     0     0

Is this an actual USB stick? I perhaps should try that locally.

superbonaci commented 4 years ago

Yes, it's an USB stick. Only fixed disk are supported?

superbonaci commented 4 years ago

Downloaded, used vhdtool to convert .raw to .vhd, mounted as disk, and it imports fine:

Hi again, did the same as you, downloaded VhdTool 1.0.0.1, then converted the dd file to vhd, then mounted it with Windows Disk Management, then zpool.exe import zfs worked fine.

But for some reason when the device is a usb stick doesn't detect it. Maybe any usb stick can do it, you can just create any test device for it.

I've mounted the vhd as read-write, then the zpool, and works fine as fas a you use any command line to operate the filesystem. Using Windows Explorer crashes Windows 10, will create another ticket for it.

lundman commented 4 years ago

It's meant to work, but clearly doesn't - in a VM it isn't always easy to test a physical USB stick, but I have a few ways to try.

superbonaci commented 4 years ago

I guess you will need a physical computer with Windows 10 installed, because I have more bugs to report. Virtualbox, QEMU and VMware Workstation have its bugs. Also unless you are using full device passthrough/VFIO/IOMMU you will have a hard time testing. Even latest versions of virtual machines can't get proper 3D acceleration because Nvidia GeForce cards don't allow this, only Nvidia Quadro unless you do some real hacking with 2 graphics cards and things like that...

superbonaci commented 4 years ago

Ok tried myself with a virtual machine inside Virtualbox, linux host and Windows 10 guest, same thing as native W10 installation. When you connect the usb-stick to the virtual machine from Virtualbox -> Devices -> USB -> usb-stick doesn't detect the pool. You can test it on a virtual machine no need for native W10 install.

lundman commented 4 years ago

I'm remote from the vmware host as well, but I'll assemble some hardware here and give it a go. It is high time for me to do more hardware tests

superbonaci commented 4 years ago

Additional issue here: https://github.com/openzfsonwindows/ZFSin/issues/244

lundman commented 4 years ago

I've not forgotten this, but things are busy at the moment :)

superbonaci commented 4 years ago

Still happening with OpenZFSOnWindows-debug-20200402.exe