1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
Param ( [Parameter(Mandatory=$false, ValueFromPipeline=$true)] [string]$ComputerName = $env:COMPUTERNAME ) $PhysicalDevices = Get-WmiObject Win32_DiskDrive -ComputerName $ComputerName foreach ($Device in $PhysicalDevices) { $DiskIndex = $Device.Index $DeviceModel = $Device.Model $DeviceSize = [math]::truncate($Device.Size / 1GB) Write-Host "`nDISK $DiskIndex $DeviceModel [$DeviceSize GB]" $Partitions = Get-WmiObject Win32_DiskPartition -ComputerName $ComputerName | Where-Object {$_.DiskIndex -eq $DiskIndex} foreach ($Partition in $Partitions) { $ID = $Partition.Index $Offset = $Partition.StartingOffset $PartitionSize = [math]::truncate($Partition.Size / 1GB) if ($Offset % 4096) { Write-Host "+ PARTITION $ID [$PartitionSize GB] is not correctly aligned, offset is $Offset bytes"` -BackgroundColor DarkRed } else { Write-Host "+ PARTITION $ID [$PartitionSize GB] is correctly aligned, offset is $Offset bytes" } } } |
1 2 3 4 5 6 7 8 9 |
PS C:\Temp>PS C:\temp> .\Get-PartitionOffset.ps1 -ComputerName pc12398 DISK 0 ADATA SSD S511 120GB ATA Device [111 GB] + PARTITION 0 [0 GB] is correctly aligned, offset is 1048576 bytes + PARTITION 1 [111 GB] is correctly aligned, offset is 105906176 bytes DISK 1 WDC WD20EURS-63S48Y0 ATA Device [1863 GB] + PARTITION 0 [1863 GB] is correctly aligned, offset is 1048576 bytes PS C:\temp> |
1 2 3 4 5 6 7 8 9 10 11 12 |
PS C:\temp> .\Get-PartitionOffset.ps1 -ComputerName exchcas02 DISK 0 VMware Virtual disk SCSI Disk Device [64 GB] + PARTITION 0 [0 GB] is correctly aligned, offset is 1048576 bytes + PARTITION 1 [64 GB] is correctly aligned, offset is 105906176 bytes DISK 1 VMware Virtual disk SCSI Disk Device [1999 GB] + PARTITION 0 [1999 GB] is correctly aligned, offset is 1048576 bytes DISK 2 VMware Virtual disk SCSI Disk Device [14 GB] + PARTITION 0 [14 GB] is correctly aligned, offset is 1048576 bytes PS C:\temp> |
1 2 3 4 5 6 7 8 9 10 11 |
PS C:\temp> .\Get-PartitionOffset.ps1 DISK 0 SAMSUNG SSD PM810 FDE 2.5" 128GB ATA Device [119 GB] + PARTITION 0 [119 GB] is correctly aligned, offset is 2097152 bytes DISK 1 SD Memory Card [30 GB] + PARTITION 0 [30 GB] is correctly aligned, offset is 4194304 bytes DISK 2 Corsair Flash Voyager USB Device [7 GB] + PARTITION 0 [7 GB] is correctly aligned, offset is 40960 bytes PS C:\temp> |
source:
http://pctuning.tyden.cz/software/ladeni-windows/17030-optimalizace-windows-7-pro-ssd-co-funguje-a-co-ne?start=2
http://lifehacker.com/5837769/make-sure-your-partitions-are-correctly-aligned-for-optimal-solid-state-drive-performance
1 |
Get-WmiObject -Class Win32_Printer -Computer PRNSRV | Select Name, DriverName, PortName | Sort Name | Ft -AutoSize |
fsutil behavior query disabledeletenotify
DisableDeleteNotify = 0
If Windows returned 0, TRIM is enabled.