Misaligned disks but the disk is dynamic with 2 partitions.

  • I have a dynamic disk (4.5TB) in size which is SAN attached with 9 disks (RAID 5).

    It is being reported as misaligned.

    I would like to use diskpart to format it as in many examples but I have read it might not be wise to diskpart dynamic disks, and I’m concerned that all examples I have seen are based around systems with 1 partition, whereas I have 2 or 3 (depending on the view of wmic or diskpart).

    Also the partion offsets are more like 128MB not 1 MB.

    (reference: http://ss64.com/nt/diskpart.html)

    I am told to use dmddiag.exe -v with dynamic disks but this seems to not work well with 2008 in the download I found.

    I am concerned that I will make break something by formatting the dynamic disk, or make it worse.

    The disk I wish to align to work with is disk 6. It was Microsoft Baseline Analyzer that confirmed the misalignment.

    Here are the checks:

    This shows 2 partitions, not 3 as detailed by diskpart. Also the partitions offsets are really high,

    wmic partition get BlockSize, StartingOffset, Name, Index

    BlockSize Index Name StartingOffset

    512 0 Disk #0, Partition #0 32256

    512 1 Disk #0, Partition #1 91226112

    512 2 Disk #0, Partition #2 3312451584

    512 3 Disk #0, Partition #3 46262124544

    512 0 Disk #4, Partition #0 134283264

    512 0 Disk #5, Partition #0 134283264

    512 0 Disk #6, Partition #0 17408

    512 1 Disk #6, Partition #1 134235136

    512 0 Disk #3, Partition #0 1048576

    Offset of 134235136 = 131089k/ 128.0166015625 MB into the disk!

    Offset of 17408 = 17 k into the disk!

    DISKPART> list disk

    Disk ### Status Size Free Dyn Gpt

    -------- ------------- ------- ------- --- ---

    Disk 0 Online 136 GB 1024 KB

    Disk 1 Online 0 B 0 B

    Disk 2 Online 0 B 0 B

    Disk 3 Online 1073 GB 0 B

    Disk 4 Online 2147 GB 0 B *

    Disk 5 Online 2147 GB 0 B *

    Disk 6 Online 4294 GB 0 B * *

    DISKPART> select disk 6

    Disk 6 is now the selected disk.

    DISKPART> list partition

    Partition ### Type Size Offset

    ------------- ---------------- ------- -------

    Partition 3 Dynamic Reserved 1024 KB 17 KB

    Partition 1 Reserved 127 MB 1041 KB

    Partition 2 Dynamic Data 4294 GB 128 MB

    the command I am concerned about committing to is:

    list disk

    select disk 6

    create partition primary align=1024

    assign letter=i

    format fs=ntfs unit=64K label="new data" nowait

    would this destroy all partions and work with a dynamic disk?

    Advice from someone who has seen multiple partitions and dynamic disks much appreciated!

    Thanks,

    Rob

  • if you're going to wipe the partition and format it, change the disk from Dynamic to Basic before creating the new partition!

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Thanks Perry, I'll try that and see how it goes.

  • Do you have the diskpart commands to create the new partitions

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • No I don't, and to be honest I don't know why there are partitions, or their purpose, they aren't visible to the user.

  • Could you execute the following and return the results for disk6

    wmic partition get BlockSize, StartingOffset, Name, Index, type, primarypartition

    robster (8/31/2011)


    I have a dynamic disk (4.5TB) in size which is SAN attached with 9 disks (RAID 5).

    It is being reported as misaligned.

    With multiple partitions on one physical disk mis alignment can be quite common, unless you work out exactly the starting offsets for each partition. If you look at disk 6 in Windows disk management what are the partitions used for? (I.E. has someone set up a physical disk and created a C, D, E partiton or logical drive). Generally a physical disk will have one primary partition (you can have up to four), otherwise working out the offsets can be a nightmare and why would you want to share the physical disk anyway with other partitions\data?

    robster (8/31/2011)


    This shows 2 partitions, not 3 as detailed by diskpart.

    There will be some hidden partitions, these are system partitions and generally won't show up except in diskpart (they'll be fairly small in size too)

    robster (8/31/2011)


    list disk

    select disk 6

    create partition primary align=1024

    assign letter=i

    format fs=ntfs unit=64K label="new data" nowait

    This would create the new partition you require and format it. Howevr, You need to exit diskpart before running the format command!

    robster (8/31/2011)


    would this destroy all partions and work with a dynamic disk?

    No, remove all partitions on that disk first. You can use the "convert basic" and "delete partition" commands or delete the partitions and convert to basic via the GUI

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • thank you Perry you've been really helpful.

    Results for disk 6 are:

    wmic partition get BlockSize, StartingOffset, Name, Index, type, primarypartition

    512 0 Disk #6, Partition #0 TRUE 17408 GPT: Logical Disk Manager Metadata

    512 1 Disk #6, Partition #1 TRUE 134235136 GPT: Logical Disk Manager Data

  • OK, firstly why is the disk dynamic. Personally i think they should be outlawed 🙂

    They're only really useful if you have no hardware RAID system and wish to create a software mirror or RAID5, etc

    GPT disks do differ slightly to MBR based disks for alignment, this is highlighted in the SQL Server 2008 alignment best practices. The first thing you need to know is the stripe size of the RAID underneath physical disk 6, or is a local disk?

    The following calculation should result in an integer value

    StartingOffset / stripe Unit Size

    So for instance my GPT basic disk has a start offset of 34603008 and a stripe size of 256kb which in bytes is 262144, so

    34603008 / 262144 = 132

    Setting up this disk as MBR basic it has a start offset of 1048576 and a stripe size of 256kb which in bytes is 262144 so i get the following

    1048576 / 262144 = 4

    You definitely need to restructure the disk from dynamic to basic configuration. Whether you leave it as GPT or MBR is entirely up to you.

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Thanks for your help.

    Eventually it all went to plan! I kept it as a Standard disk in the end. Commands and method are below.

    diskpart

    Microsoft DiskPart version 6.1.7601

    Copyright (C) 1999-2008 Microsoft Corporation.

    On computer: <hidden>

    DISKPART> list disk

    Disk ### Status Size Free Dyn Gpt

    -------- ------------- ------- ------- --- ---

    Disk 0 Online 136 GB 1024 KB

    Disk 3 Online 1073 GB 0 B

    Disk 4 Online 2147 GB 0 B *

    Disk 5 Online 2147 GB 0 B *

    Disk 6 Online 4294 GB 4294 GB *

    DISKPART> select disk 6

    Disk 6 is now the selected disk.

    DISKPART> create partition primary align=1024

    DiskPart succeeded in creating the specified partition.

    DISKPART> assign letter=I

    DiskPart successfully assigned the drive letter or mount point.

    DISKPART> format fs=ntfs unit=64K label="New Data" nowait

    The format has been initiated successfully and is currently in progress.

    Please wait until format has completed before trying to access the volume.

    Unfortunately this is a Full format, not a quick format, and with 4TB that takes about 10 hours.

    then I checked the offsets:

    wmic partition get BlockSize, StartingOffset, Name, Index, primarypartition

    BlockSize Index Name PrimaryPartition StartingOffset

    512 0 Disk #0, Partition #0 TRUE 32256

    512 1 Disk #0, Partition #1 TRUE 91226112

    512 2 Disk #0, Partition #2 TRUE 3312451584

    512 3 Disk #0, Partition #3 FALSE 46262124544

    512 0 Disk #4, Partition #0 TRUE 134283264

    512 0 Disk #5, Partition #0 TRUE 134283264

    512 0 Disk #6, Partition #0 TRUE 135266304

    512 0 Disk #3, Partition #0 TRUE 1048576

    and they all looked OK. Verified this with the Baseline Security Analyzer.

    Then stopped all the sql services, and started the copy. For reference this is best done with xcopy or robocopy otherwise the file security won't be transferred as well. Here was my method:

    Note the Command Window used to start the robocopy must be opened with Run As Administrator.

    Command:

    echo started

    echo time/t

    robocopy H:\ I:\ *.* /eta /R:3 /E /S /COPYAll /W:60 /Log+:G:\dba_tools\robocopy\CopyProgress.txt /TEE /XD I:\$RECYCLE.BIN

    echo done

    title done

    echo time/t

    pause

    2TB took approx 3 hours.

    --the only faults with this robocopy script which I'd revise if re-run was to also exclude all subfolders of the \$RECYCLE.BIN\ as you get one for each SID as well, and also to exclude the \System Volume Information\tracking.log as that had Access Denied.

    Anyway once all the data had been copied over the drives letters were changed, old data set to z:\ and new volume set to the old volume label. Started the services and it all worked very well.

    Thanks

    Rob.

  • 😉

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply