Diskpart archives - SQL Server with Mr. Denny

SQL Server with Mr. Denny:

Diskpart

Jul 13 2009   11:00AM GMT

Windows 2008 C Drive doesn’t always extend correctly



Posted by: mrdenny
Windows 2008, Diskpart, Virtualization

When using VMs and Windows 2008 you have the ability to easily grow the C drive on your servers. This makes it much easier to assign only the space needed to the C drive of your servers saving you a ton of space.

However I recently had a few machines say that the disk was extanded in Computer Manager and diskpart, but Windows Explorer (aka My Computer) showed the old amount. And growing the disk a second time doesn’t help. Shrink the partition (either in diskpart or Computer Management) then extend it again seamed to fix it for me.

Denny

Aug 19 2008   4:52PM GMT

Tuning SQL Server performance via disk arrays and disk partitioning



Posted by: mrdenny
Storage, Article, Disk Alignment, Diskpart

I’ve published another tips on SearchSQLServer.com called “Tuning SQL Server performance via disk arrays and disk partitioning“.  This is sort of a part one of a two part series of tips on tuning the database server at the hardware level.  In this tip I’m focusing on getting the disks setup just right.  I also show how to use diskpart.exe to see if the disks are correctly aligned.

Denny


Jun 23 2008   11:02AM GMT

How much performance are you loosing by not aligning your drives?



Posted by: mrdenny
Storage, SQL Server, Disk Alignment, Diskpart, Diskpar

Myself and many other people have been saying for quite a while now that you need to align your disks before putting data on them.  I know have some information on how you can figure out just how much potential performance you are loosing by not aligning.

 Before we can begin to figure this out we need to know what the average work load for the disk is going to be.  In the SQL Server world this is easy.  SQL Server does everything in 8k pages within 64k extents.  Each time it needs to read from the disk it reads the 64k extent from the disk and each time it writes to the disk it writes the 64k extent.  So our data size is 64k.

We take this number and divide by 64.  So in our case 64/64 = 1.  1 as a percentage is 100%, so 100% of our data reads and writes are requiring two physical reads or writes.

If you are in the exchange world everything is done in 8k reads and writes.  So in this case 8/64 = 0.125 or 12.5% of the reads and writes are requiring two physical reads or writes.

Now for SQL Server just because we are doubling the number of operations doesn’t mean that by fixing this you will double your disk speed.  What it means is that if your disks are running at 100% utilization you can probably reduce your disk load by 50%.  But if your disk utilization is 30% your disk activity won’t be any faster as your disks are not running at capacity.  Will you see a performance improvement, yes.  Will it be as high as if your disk was at 100%, no.  Should you still fix the alignment problem?  Yes.

To fix the problem isn’t easy.  You have to remove all the data from the disk, and delete the partition, then recreate the partition using the DISKPAR.EXE (Windows 2000) or DISKPART.EXE (Windows 2003/2008) with the ALIGN=64 setting.  To remove the data from the disk you will either need to migrate to a new disk within the server, or backup the database, fix the alignment then restore the database.

Denny