灬小肥狗灬
1
灬小肥狗之家灬

【随手记】PowerShell磁盘操作命令

$SSDs = Get-PhysicalDisk | Where-Object {$_.mediatype -eq "SSD"} | Where-Object {$_.usage -eq "auto-select"}| Where-Object {$_.canpool -eq $True}
$HDDs = Get-PhysicalDisk | Where-Object {$_.mediatype -eq "HDD"} | Where-Object {$_.canpool -eq $True}

Get-Partition 
Resize-Partition -DiskNumber 13 -PartitionNumber 2 -Size (70T) -AsJob
Resize-VirtualDisk -FriendlyName "TierdMajor" -Size (85TB) -AsJob

Remove-Partition -DiskNumber 13 -PartitionNumber 2
Remove-VirtualDisk -FriendlyName "TierdMajor"
Remove-StorageTier -FriendlyName "SSD_Tier"
Remove-StorageTier -FriendlyName "HDD_Tier"
Remove-StoragePool -FriendlyName "CompanyData"

$PhysicalDisk = (Get-PhysicalDisk -canpool $true)
New-StoragePool -FriendlyName "ALFD-SP" -StorageSubSystemFriendlyName "Windows Storage*" -PhysicalDisks $PhysicalDisk
New-StorageTier -FriendlyName "ALFD-ST" -StoragePoolFriendlyName "ALFD-SP" -MediaType SSD
New-StorageTier -FriendlyName "ALFD-HT" -StoragePoolFriendlyName "ALFD-SP" -MediaType HDD -ResiliencySettingName Parity -NumberOfColumns 6
$ST = Get-StorageTier -FriendlyName "ALFD-ST"
$HT = Get-StorageTier -FriendlyName "ALFD-HT"
Remove-VirtualDisk -FriendlyName "ALFD-VD"
New-VirtualDisk -StoragePoolFriendlyName"ALFD-Storage" -FriendlyName "ALFD-VD" -StorageTiers @($ST, $HT) -StorageTierSizes @(7.4TB, 88TB) -WriteCacheSize 4GB

Add-PhysicalDisk 

Get-Disk |? {$_.Number -eq 13}|New-Partition -AssignDriveLetter -Size 40TB | Format-Volume -FileSystem REFS -NewFileSystemLabel Media  -Confirm:$false

灬小肥狗灬

文章作者

发表回复

textsms
account_circle
email

12 − 4 =

灬小肥狗之家灬

【随手记】PowerShell磁盘操作命令
$SSDs = Get-PhysicalDisk | Where-Object {$_.mediatype -eq "SSD"} | Where-Object {$_.usage -eq "auto-select"}| Where-Object {$_.canpool -eq $True} $HDDs = …
扫描二维码继续阅读
2022-11-22