openzfsonwindows / ZFSin

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

Creating zpool on separate partition on same vdev works but flags an error #349

Open Chewbakka-Wakka opened 1 year ago

Chewbakka-Wakka commented 1 year ago

zpool create -f -O casesensitivity=insensitive -O compression=zstd -O atime=off -O dedup=on -O recordsize=512k data \?\G: working on dev '\?\G:' setting path here '/dev/Harddisk0Partition4' setting physpath here '\?\G:' cannot open '/dev/Harddisk0Partition4': No such file or directory

zpool list NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT data 366G 159K 366G - - 0% 0% 1.00x ONLINE -

wmic diskdrive list brief Caption DeviceID Model Partitions Size Samsung SSD 850 EVO 500GB \.\PHYSICALDRIVE0 Samsung SSD 850 EVO 500GB 4 500105249280

wmic logicaldisk list brief DeviceID DriveType FreeSpace ProviderName Size VolumeName B: 4 16690061312 469259460608 C: 3 40385957888 106204553216 D: 2 380775579136 380775603712 data G: 3 M: 4 16690053120 1287157645312

Get-Partition -DiskNumber 0 | ForEach-Object {"\Device\Harddisk$($.DiskNumber)\Partition$($.PartitionNumber)"} \Device\Harddisk0\Partition1 \Device\Harddisk0\Partition2 \Device\Harddisk0\Partition3 \Device\Harddisk0\Partition4 \Device\Harddisk0\Partition5

It would be good to add onto the existing readme file how to do this correctly by identification of full partition path, but as it stands the drive on the separate partition must be mounted in order to create the pool. Otherwise it will not work but this seems a bit clumsy having 2 drive letters for 1 partition as shown here.

andrewc12 commented 1 year ago

Yeah having some way of doing this a bit easier would be nice.

Does \Device\Harddisk0\Partition4 actually work?

I don't know where I found it but this is what I use when I have a raw partition without a drive letter zpool.exe create -f tank Harddisk0Partition4

andrewc12 commented 1 year ago

That PowerShell snippet looks useful so I'll be taking that :)

andrewc12 commented 1 year ago

Also I should point out that the repo for the build you are running is https://github.com/openzfsonwindows/openzfs/

Chewbakka-Wakka commented 1 year ago

Passing the full device path does not work it would appear. You can pass \?\G: as seen above and the pool is fully functional.

zpool create -f -O casesensitivity=insensitive -O compression=zstd -O atime=off -O dedup=on -O recordsize=512k data \Device\Harddisk0\Partition4 cannot open 'C:\Device\Harddisk0\Partition4': No such file or directory

Yes that way by using only Harddisk0Partition4 also works, yet flags the same error:

zpool create -f -O casesensitivity=insensitive -O compression=zstd -O atime=off -O dedup=on -O recordsize=512k -O sync=disabled data Harddisk0Partition4

Expanded path to '\?\Harddisk0Partition4' working on dev '\?\Harddisk0Partition4' setting path here '/dev/Harddisk0Partition4' setting physpath here '\?\Harddisk0Partition4' cannot open '/dev/Harddisk0Partition4': No such file or directory

Chewbakka-Wakka commented 1 year ago

I will raise another issue after more experiments on https://github.com/openzfsonwindows/openzfs/ for the duplicate drive letters if it is. I have found it is possible to have 2 D:\ drives...