Deployment Solution

 View Only

How to Perform Custom Partitioning with Deployment Solution for Dell Servers 

Dec 16, 2008 10:22 AM

Deployment Solution for Dell Servers allows IT technicians to easily configure Dell Hardware, firmware and deploy operating systems. Oftentimes however, there are situations where custom partitioning schemes are needed for OS's that are being deployed. This article will outline how to customize partitioning as part of the scripted OS install process for Linux and Windows operating systems.

Note: This article assumes you have a functioning copy of Deployment Solution for Dell Servers 3.1 SP1 or later (although these instructions may also work for earlier versions), and that you are familiar with how to set up OS Configurations, and generate deployment tasks using the Job Builder. If you are unfamiliar with these tasks, please read the documentation, and/or watch the demonstration videos available at: Deployment Solution for Dell Servers Demo Videos

Section I: Custom Partitioning While Deploying Windows 2000 and Server 2003

Windows 2000 and 2003 scripted OS installs can be performed using the Linux or WinPE preboot. By default, the install scripts for Linux and WinPE will create a 4000 Megabyte primary partition. Later when Windows Setup is running that partition will be expanded to fill the entire disk.

Step 1: Disable Automatic partition expanding.

The simplest way to do custom partitioning is to disable the automatic expanding of the primary partition by opening the Configuration Utility, and navigating to the OS Deployment Tab. Next, click the OS Configuration that you want to modify, then press "Answer File."

Locate "ExtendOEMPartition" in the Unattend section as follows:

[Unattended]
UnattendMode=FullUnattended
DriverSigningPolicy=Ignore
TargetPath=WINNT
FileSystem=ConvertNTFS
ExtendOemPartition=1

And change ExtendOEMPartition=1, to ExtendOEMPartition to 0. Save the file and close notepad.

Step 2: Modify the primary partition size.

Since we disabled automatic expanding of the primary partition, you probably want to specify the size yourself, and you probably want something larger than 4000 Megabytes. Locate the job in your Deployment Console and click on the "Distribute Disk Image" if you are working with a job for the Linux Preboot. If you are working with a job for the WinPE preboot, click the run script task with the description "Creates an OS partition and formats the partition."

Linux Preboot:

WinPE Preboot:

Next, modify the size of the primary partition. In this example I have changed the size from 4000 Megabytes to 10,000 Megabytes. For the WinPE preboot modify the user modification section, or in the imaging task if you are dealing with the Linux preboot.

Linux Preboot:

WinPE Preboot:

Step 3: Create a script that will create other partitions after the OS has installed.

Steps 1 and 2 allow you to configure your primary partition, next you can write a small script (or modify my example) to create the remaining partitions after the scripted OS install is complete.

To begin, create a new Runscript task that will run after the last task in the script.

Since this script will be running in Windows production, we can write it in batch. This script can be as simple or complex as you want. Theoretically it could detect an arbitrary number of disks and populate them with several partitions. For this example we'll just have a simple script that will create two partitions, and format them as NTFS.

Remember when partition hard disks, you need to remember that there is a maximum of four primary partitions. If you want more than four partitions, you must create an extended partition, and create logical partitions within that extended partition.

Here is an example script. It will write diskpart commands to a temporary file, then execute them with diskpart.

set TEMPFILE=%temp%\create_part.bat

echo SELECT DISK 0 > %TEMPFILE%
echo CREATE PARTITION PRIMARY SIZE=20000 >> %TEMPFILE%
echo ASSIGN LETTER=Y >> %TEMPFILE%
echo CREATE PARTITION PRIMARY >> %TEMPFILE%
echo ASSIGN LETTER=Z >> %TEMPFILE%
echo EXIT >> %TEMPFILE%

::Create the Partitions
diskpart /S %TEMPFILE%

::Format the partitions as NTFS
echo y | format Y: /FS:NTFS /X
echo y | format Z: /FS:NTFS /X

::Delete the temporary file
del /Q %TEMPFILE%

When this script is executed it will create two partitions, a Y drive that is 20 Gigabytes, and a Z drive that fills the rest of the available space on the disk.

Once you have entered this script into the run script task, press Next. Make sure that the script is associated with the "Production - Client Installed" environment, and that it will run on the client computer. You're Done! Run the job.

Section II: Custom Partitioning While Deploying Windows Server 2008

Windows Server 2008 uses the new Vista-style unattend.xml files instead of the old Win2003/2000 ini answer files. This new mechanism allows partitioning to be done straight in the unattend file. To view the unattend.xml file, open the Configuration Utility, and go to the OS Deployment Tab. Click the Windows Server 2008 OS Configuration and click "Answer File."

Within the answer file there is a <DISK> section and inside it there is a <CreatePartitions> section.

This is where the primary partition is created, and by default it is set to 10 Gigabytes. Initially it appears that the partition will not be extended to fill the entire disk because of the <Extend>false</Extend> entry. But if you look lower in the <ModifyPartitions> section, <Extend> is set to TRUE. This means that by default, the Windows Server 2008 install will have the same behavior as the Windows 2000 and 2003 install - that is, to create an initial partition, and then extend it to fill the disk.

To create a custom partitioning scheme you can edit this XML file to have additional <CreatePartitions> sections. For help in doing this you may refer to the WAIK documentation, or simply do a google search on how to construct unattend.xml files.

Alternatively, if you don't want to make a lot of modifications to the unattend.xml, you may use a technique similar to what we did in Section I. Modify the answer file to not extend the partition, then use a post-install script to create additional partitions using diskpart. To do this, simply change <Extend>true</Extend> to <Extend>false</Extend> within the <ModifyPartitions> section. Then append a run script task to the end of your scripted OS install job similar to the one found in Section I.

Section III: Custom partitioning for Redhat Enterprise Linux

When deploying Redhat Enterprise Linux, the hard drive is partitioned according to the scheme found in the answer/kickstart file. To edit the answer file, open the Configuration Utility, and click the OS Deployment Tab. Click your Redhat Linux OS configuration, then click "Answer File."

If you scroll down a few paragraphs, you'll find this section:

# ==========================================================
# The following is a standard partition configuration. It
# assumes you have no existing partitions or at the most a
# Dell Utility Partition.
# Note that if you uncomment "clearpart --all" and thus clear
# all partitions, it will remove the Dell Utility Partition
# if it exists.
# clearpart --linux will remove any existing Linux partitions, 
# leaving the Dell Utility partition. This is so the install
# partition is removed.
# ----------
#clearpart --all --initlabel
#clearpart --linux --initlabel
part /boot --size=100 --fstype ext3 --ondisk=sda
part swap --recommended --ondisk=sda
part / --size=3072 --grow --fstype ext3 --ondisk=sda
#autopart
zerombr yes

The three uncomment lines each define a partition tha will be created. These lines are of the form: part <mntpt> --size <size in megs> [--grow] [--maxsize <size in megs>]

As you can see the root partition "/" is set to grow, meaning it will fill all available space. If you wanted to modify this partition scheme to have a the /var directory in a separate partition that is 5000 Megabytes, you would add a line like this:

part /tmp -size 5000

You can also specify a range for the size of the partition. For instance, if you want your /tmp partition to be at least 5000 Megabytes, and grow up to 8,000 Megabytes, you could add this line instead:

part /tmp -size 5000 -grow -maxsize 8000

As you can see changing the linux partitioning scheme is easy, and doesn't require modification or creation of any scripts like we have to do in Windows 2000/2003.

When you're done editing the kickstart file, save it then run your job.

Section IV: Custom Partitioning for Suse Enterprise Linux

When deploying Suse Enterprise Linux, partitioning is done via the answer/kickstart file similar to the Redhat installation. Suse however lays out their kickstart file in XML format. To view the Suse kickstart file, open the Configuration Utility, click the OS Deployment tab. Click the Suse OS Configuration and click "Answer File."

Find the following section:

 <partitioning config:type="list">
  <drive>
   <device>/dev/sda</device>
   <partitions config:type="list">
    <partition>
     <filesystem config:type="symbol">reiser</filesystem>
     <filesystem_id config:type="integer">131</filesystem_id>
     <format config:type="boolean">true</format>
     <label>boot</label>
     <loop_fs config:type="boolean">false</loop_fs>
     <mount>/boot</mount>
     <mountby config:type="symbol">label</mountby>
     <partition_id config:type="integer">131</partition_id>
     <partition_type>primary</partition_type>
     <size>300M</size>
    </partition>
    <partition>
     <filesystem config:type="symbol">swap</filesystem>
     <filesystem_id config:type="integer">130</filesystem_id>
     <format config:type="boolean">true</format>
     <label>swap</label>
     <loop_fs config:type="boolean">false</loop_fs>
     <mount>swap</mount>
     <mountby config:type="symbol">label</mountby>
     <partition_id config:type="integer">130</partition_id>
     <partition_type>primary</partition_type>
     <size>auto</size>
    </partition>
    <partition>
     <filesystem config:type="symbol">reiser</filesystem>
     <filesystem_id config:type="integer">131</filesystem_id>
     <format config:type="boolean">true</format>
     <label>root</label>
     <loop_fs config:type="boolean">false</loop_fs>
     <mount>/</mount>
     <mountby config:type="symbol">label</mountby>
     <noauto config:type="boolean">false</noauto>
     <partition_id config:type="integer">131</partition_id>
     <size>max</size>
    </partition>
   </partitions>
   <type config:type="symbol">CT_DISK</type>
   <use>linux</use>
  </drive>
 </partitioning>

As you can see, the partitioning scheme is first broken out into drives, devices, then partitions. You can create additional partitions by copying a partition section, then filling out the mountpoint and size entries.

When you're done editing the kickstart file, save it then run your job.

Statistics
0 Favorited
0 Views
2 Files
0 Shares
0 Downloads
Attachment(s)
jpg file
6597.jpg   3 KB   1 version
Uploaded - Feb 25, 2020
zip file
Partitioning.zip   142 KB   1 version
Uploaded - Feb 25, 2020

Tags and Keywords

Related Entries and Links

No Related Resource entered.