Categories
Lansweeper

LANSweeper : Unaligned Disk Report

LANSweeper : Unaligned Disk Report

The SQL below will display all disks, that are over 1GB in size and not a system boot disk, in an ‘un-aligned’ state.

Select Top 1000000 tblComputers.ComputerUnique, tblComputers.Computername, tblComputers.Domain, 
Web40OSName.OSname, tblOperatingsystem.Description, CAST(ROUND(((tblDiskPartition.size/1024)/1024)/1024,2,0) As Decimal(20,2)) As 'Size (GB)' , tblDiskPartition.StartingOffset, 
tblDiskPartition.DeviceID, 
CASE WHEN (tblDiskPartition.StartingOffset/4096 != ROUND(tblDiskPartition.StartingOffset/4096,0)) THEN 'FALSE' ELSE 'TRUE' END As 'Is Aligned?'

From tblDiskPartition 
Inner Join tblComputers On tblDiskPartition.Computername = tblComputers.Computername 
Inner Join tblComputersystem On tblComputers.Computername = tblComputersystem.Computername 
Inner Join tblOperatingsystem On tblComputers.Computername = tblOperatingsystem.Computername 
Inner Join web40ActiveComputers On tblComputers.Computername = web40ActiveComputers.Computername 
Inner Join Web40OSName On Web40OSName.Computername = tblComputers.Computername

Where tblDiskPartition.StartingOffset/4096 != ROUND(tblDiskPartition.StartingOffset/4096,0) 
and (tblDiskPartition.bootpartition = 0 or tblDiskPartition.BootPartition = NULL) 
and ROUND(((tblDiskPartition.size/1024)/1024)/1024,2) > 1

Group By tblComputers.ComputerUnique, tblComputers.Computername, tblComputers.Domain, Web40OSName.OSname, 
tblOperatingsystem.Description, Web40OSName.Compimage, tblComputers.Computer, tblDiskPartition.StartingOffset, 
tblDiskPartition.StartingOffset/4096, tblDiskPartition.size , tblDiskPartition.DeviceID

Order By dbo.tblComputers.Computer, Count(dbo.tblDiskPartition.Computername) Desc 

Leave a Reply

Your email address will not be published. Required fields are marked *