$theTitle=wp_title(" - ", false); if($theTitle != "") { ?>
About Virtualization, VDI, SBC, Application Compatibility and anything else I feel like
After deploying Virtual Machines from a template and adding disks the next Task was to create and format the partitions.
In a VMWare environment it is very important to assure that the partitions are aligned. VMWare has a nice document that explains the details called Performance Best Practices for VMware vSphere 4.0.
Basically the recommendation is to align partition on a 64 KB boundary, not only for VMWare itsself but also for the guests.
Of course we could do this manually but I wanted to run this task of from my Deployment Server to automate the following:
Well enough talk let’s go the scripts! They are written as bat files that can be executed directly in Altiris as an embedded script but of course you don’t need Altiris to use them.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | @echo off rem Create and Format D partition rem We don't want to overwrite existing data! if exist D:\ goto HALT rem Create Diskpart Script echo select disk 1 >DiskPart.txt echo create partition primary align=64>>DiskPart.txt echo assign letter=D>>DiskPart.txt rem Create Partition DiskPart /s DiskPart.txt rem Format Partition format d: /FS:NTFS /V:Data /q /A:32K /y goto EXIT :HALT rem Return ACCESS DENIED set ERRORLEVEL=5 :EXIT |
And the second script:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | @echo off rem Create and Format E Partition rem We don't want to overwrite existing data! if exist E:\ goto halt rem Create Diskpart Script echo select disk 2 >DiskPart.txt echo create partition primary align=64>>DiskPart.txt echo assign letter=E>>DiskPart.txt rem Create Partition DiskPart /s DiskPart.txt rem Format format e: /FS:NTFS /V:Profiles /q /A:32K /y goto EXIT :HALT rem Return ACCESS DENIED set ERRORLEVEL=5 :EXIT |
One Response for "Programmatically Create Aligned Partitions"
[…] we can launch DiskPart and create the partition (see here for a scripted […]
Leave a reply