Creating Partitions

 < Day Day Up > 



How you create partitions on basic disks depends on the partition style of the disk. Because you create different types of partitions with MBR disks than you do with GPT disks, there are separate discussions about creating partitions for MBR and GPT disks.

Creating Partitions for MBR Disks

With MBR disks, you can use DiskPart to create primary and extended partitions. A primary partition can fill an entire disk, or you can size it as appropriate for the computer you’re configuring. Each physical drive can have one extended partition. This extended partition can contain one or more logical drives, which are simply sections of the partition with their own file system. Although you can size the logical drive any way you want, you might want to consider how you’ll use logical drives on the current workstation or server. Generally, you use logical drives to divide a large physical drive into manageable sections. With this in mind, you might want to apportion a 60-gigabyte (GB) extended partition into three logical drives of 20 GB each.

Creating Primary Partitions

Before you add a primary partition to a disk, you should assess the amount of free space on the disk and also check the current partition configuration. Follow these steps to perform these tasks:

  1. Invoke DiskPart by typing diskpart at the command prompt.

  2. List the disks on the computer by typing list disk and check the free space:

    Disk ###     Status       Size        Free        Dyn     Gpt
    -------- ---------- ------- ------- --- ---
    Disk 0 Online 56 GB 0 B
    Disk 1 Online 29 GB 0 B
    Disk 2 Online 37 GB 37 GB

  3. In this example, disk 2 has 37 GB of free space for partitioning and no currently assigned partitions because the size of the disk is also 37 GB. If the disk size and free space aren’t the same, however, some space has been assigned to partitions. If you wanted to work with disk 2, you would select the disk and then check the partitions on the disk by typing select disk 2, and then typing list partition.

Once you select a disk to work with and give the disk focus, you can create the primary partition using the command

create partition primary size=N 

where N is the size of the space to allocate in megabytes. If no size is given, the partition is created to fill the unallocated space on the disk.

Note

Here, the partition is created at the beginning of the first free space on the disk. DiskPart accomplishes this by automatically setting the offset parameter to the appropriate value. An important note is that the offset is rounded to the closest cylinder boundary. The value is therefore rounded up or down as appropriate to coincide with the closest cylinder boundary, which can change the final size of the partition or logical drive.

After you create the partition, it will automatically have focus, meaning it will be selected. The partition will not yet have a drive letter or mount point. You must use the ASSIGN command to do this. To finalize the partition, you must also format it using FORMAT, which is a standard Windows external command, not a DiskPart subcommand. For more information, see the sections titled “Assigning Drive Letters and Mount Points” and “Formatting Partitions,” later in this chapter.

Creating Extended Partitions with Logical Drives

Each disk drive can have one extended partition. As with primary partitions, you should assess the amount of free space on the disk and also check the current partition configuration before creating an extended partition. After you do this, you can create the extended partition in the unallocated space on the disk you’ve selected (meaning that you have given that disk focus).

You create an extended partition using the command

create partition extended size=N 

where N is the size of the space to allocate in megabytes. If no size is given, the partition is created to fill the unallocated space on the disk.

After you create the extended partition, it will automatically have focus, meaning that it will be selected. Unlike primary partitions, you don’t assign drive letters or format extended partitions directly. Instead, you create one or more logical drives within the extended partition space and these drives are the ones to which you assign drive letters and then format.

You can create a logical drive within an extended partition using the command

create partition logical size=N 

where N is the size of the space to allocate in megabytes. If no size is given, the logical drive will use all the available space in the extended partition. When you specify the size of logical drives, remember the size of all logical drives within the partition must be less than the size of the extended partition. That’s why, in Chapter 8, “Configuring and Maintaining Hard Disk Drives,” we created an extended partition of 4096 megabytes (MB) and logical drives within the partition of 2048 MB and 2047 MB, respectively.

After you create a logical drive, it will automatically have focus, but will not yet have a drive letter or mount point. You must use the ASSIGN command to assign the drive letter or mount point you want to use and then finalize the logical drive by formatting it using the FORMAT command.

Creating Partitions for GPT Disks

With GPT disks, you can use DiskPart to create the EFI system partition as well as MSR and data partitions. You can’t arbitrarily create EFI and MSR partitions. On GPT disks that are used to start 64-bit Microsoft Windows XP or 64-bit Windows Server 2003 systems, the EFI system partition must be the first partition on the disk and the MSR partition must be the second partition on the disk. Because GPT disks that are not used for startup don’t contain EFI system partitions, the MSR partition must be the first partition on the disk. Further, keep in mind that Windows doesn’t mount MSR partitions and you cannot store data on them or delete them.

As with MBR disks, before you add partitions to GPT disks, you should assess the amount of free space on the disk and also check the current partition configuration. Once you select a disk to work with and give the disk focus, you can create the partition as follows:

Create an EFI system partition using the command:

create partition efi size=N 

Create an MSR partition using the command:

create partition msr size=N 

Create a basic data partition using the command:

create partition primary size=N 

where N is the size of the space to allocate in megabytes. As with MBR disks, DiskPart automatically sets the offset parameter as appropriate; you shouldn’t set the byte offset manually in most cases.

As discussed previously, the partition you create will automatically have focus, meaning that it will be selected. The partition will not yet have a drive letter or mount point, which is needed for EFI and data partitions. To finalize an EFI or data partition, you must also format it using the FORMAT command, which is a standard Windows external command, not a subcommand of DiskPart.



 < Day Day Up > 



Microsoft Windows Command-Line Administrator's Pocket Consultant
MicrosoftВ® WindowsВ® Command-Line Administrators Pocket Consultant
ISBN: 0735620385
EAN: 2147483647
Year: 2004
Pages: 114

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net