Difference between revisions of "Windows create pool in vhdx with ps"
From OpenZFS on OS X
Line 14: | Line 14: | ||
$physdisk = Get-CimInstance -ClassName Win32_DiskDrive -Property * | Where-Object {$_.Index -eq $disk.DiskNumber} | $physdisk = Get-CimInstance -ClassName Win32_DiskDrive -Property * | Where-Object {$_.Index -eq $disk.DiskNumber} | ||
+ | $physdiskpath = $physdisk.Name|split-path -leaf | ||
− | zpool.exe create -O casesensitivity=insensitive -O atime=off -o ashift=12 wintank $ | + | zpool.exe create -O casesensitivity=insensitive -O atime=off -o ashift=12 wintank $physdiskpath |
=== Destroy === | === Destroy === |
Latest revision as of 07:59, 25 May 2022
Create[edit]
$imgpath = "c:\tmp\test.vhdx"
$imgsize = 527433728
New-VHD -Path $imgpath -SizeBytes $imgsize
$disk = Mount-VHD -Path $imgpath -PassThru
get "Physical" disk for mounted vhd
$physdisk = Get-CimInstance -ClassName Win32_DiskDrive -Property * | Where-Object {$_.Index -eq $disk.DiskNumber}
$physdiskpath = $physdisk.Name|split-path -leaf
zpool.exe create -O casesensitivity=insensitive -O atime=off -o ashift=12 wintank $physdiskpath
Destroy[edit]
zpool.exe export wintank
Dismount-VHD -Path $imgpath