# 查看物理磁盘
Get-PhysicalDisk | ft FriendlyName,DeviceId,BusType,UniqueId,Size,MediaType -auto
# 物理磁盘改名
Set-PhysicalDisk -UniqueId "youruniqueid" -NewFriendlyName "yourname"
# 新建存储池
New-StoragePool -StoragePoolFriendlyName "EmmaStoragePool" -StorageSubSystemFriendlyName (Get-StorageSubSystem).FriendlyName -PhysicalDisks (Get-PhysicalDisk -CanPool $true) -LogicalSectorSizeDefault 512 -FaultDomainAwarenessDefault PhysicalDisk
# 设置存储池 设置Mirror为一个列(磁盘)写入 Parity(奇偶校验)为五列写入
Get-Storagepool "EmmaStoragePool" | Set-ResiliencySetting -Name Mirror -NumberOfColumnsDefault 1
Get-Storagepool "EmmaStoragePool" | Set-ResiliencySetting -Name Parity -NumberOfColumnsDefault 5
# 查看新建的存储池
$pool = get-storagepool -FriendlyName "EmmaStoragePool"
Get-Physicaldisk -StoragePool $pool
# 新建存储层
# 一块SSD时使用以下命令 ResiliencySettingName是弹性设置名称 Simple是raid0 Mirror是raid1 Parity是raid5
New-StorageTier -StoragePoolFriendlyName "EmmaStoragePool" -FriendlyName SSDTier -MediaType SSD -ResiliencySettingName Simple
# 多块SSD时使用以下命令 NumberOfColumns是数据同时写入磁盘数量,PhysicalDiskRedundancy是最大允许磁盘损坏数量
New-StorageTier -StoragePoolFriendlyName "EmmaStoragePool" -FriendlyName SSDTier -MediaType SSD -ResiliencySettingName Mirror -NumberOfColumns 1 -PhysicalDiskRedundancy 1 -FaultDomainAwareness PhysicalDisk
# HDD层
New-StorageTier -StoragePoolFriendlyName "EmmaStoragePool" -FriendlyName HDDTier -MediaType HDD -ResiliencySettingName Parity -NumberOfColumns 5 -PhysicalDiskRedundancy 1 -FaultDomainAwareness PhysicalDisk
# 查看新建的存储层
Get-StorageTier | FT FriendlyName, ResiliencySettingName, PhysicalDiskRedundancy, FaultDomainAwareness, NumberOfDataCopies
# 移除存储层
# Remove-StorageTier -FriendlyName "HDDTier"
# 新建虚拟磁盘
$SSD = Get-StorageTier -FriendlyName SSDTier
$HDD = Get-StorageTier -FriendlyName HDDTier
# 磁盘大小后期可调节
New-VirtualDisk -StoragePoolFriendlyName "EmmaStoragePool" -FriendlyName "Disk-1" -StorageTiers $SSD, $HDD -StorageTierSizes 10GB, 16GB
# 新建卷
New-Volume -StoragePoolFriendlyName Pool1 -FriendlyName "EmmaStoragePool" -FileSystem ReFS -StorageTierFriendlyName SSDTier, HDDTier -StorageTierSizes 40GB, 200GB -WriteCacheSize 1GB
# 一步到位,直接建立卷
New-Volume -StoragePoolFriendlyName "EmmaStoragePool" -FriendlyName "EmmaStoragePoolDisk" -AccessPath "D:" -ProvisioningType "Fixed" -StorageTiers (Get-StorageTier -FriendlyName "SSDTier"), (Get-StorageTier -FriendlyName "HDDTier") -StorageTierSizes 5GB, 50GB -FileSystem NTFS
# 调整存储层大小
Get-StorageTie
Resize-StorageTier -InputObject (Get-StorageTier -FriendlyName "Disk-1-SSDTier") -Size 48GB
Resize-StorageTier -InputObject (Get-StorageTier -FriendlyName "Disk-1-HDDTier") -Size 65GB
# https://www.bilibili.com/read/cv4017897?spm_id_from=333.999.0.0
标签:存储,Get,Windows,StorageTier,StoragePoolFriendlyName,EmmaStoragePool,FriendlyName,
From: https://www.cnblogs.com/chasingdreams2017/p/16886646.html