Windows - Create partition using command line

Z Wiki Pavel
Skočit na navigaci Skočit na vyhledávání

To create a partition or logical drive

• Using the Windows interface

• Using a command line



Using the Windows interface

1. Open Computer Management (Local).


2. In the console tree, click Computer Management (Local), click Storage, and then click Disk Management.


3. Right-click an unallocated region of a basic disk, and then click New Partition, or right-click free space in an extended partition, and then click New Logical Drive.


4. In the New Partition wizard, click Next, click Primary partition, Extended partition, or Logical drive, and then follow the instructions on your screen.


Notes

• To perform this procedure on a local computer, you must be a member of the Backup Operators group or Administrators group on the local computer, or you must have been delegated the appropriate authority. To perform this procedure remotely, you must be a member of the Backup Operators group or Administrators group on the remote computer. If the computer is joined to a domain, members of the Domain Admins group might be able to perform this procedure. As a security best practice, consider using Run as to perform this procedure. For more information, see Default local groups, Default groups, and Using Run as.


• To open Computer Management, click Start, click Control Panel, double-click Administrative Tools, and then double-click Computer Management.


• You can create primary partitions, extended partitions, and logical drives only on basic disks. You should create basic volumes instead of dynamic volumes if this computer also runs MS-DOS, Windows 95, Windows 98, Windows Millennium Edition, Windows NT 4.0, or Windows XP Home Edition.


• On a master boot record (MBR) disk, you can create up to four primary partitions, or three primary partitions, one extended partition, and unlimited logical drives.


• On a GUID partition table (GPT) disk, you can create up to 128 primary partitions.


Using a command line

1. Open Command Prompt.


2. Type:

diskpart


3. At the DISKPART prompt, type:

list disk

Make note of the disk number of the disk on which you want to create a primary or extended partition.


4. At the DISKPART prompt, type:

select diskn

Select the disk n where you want to create the primary or extended partition.


5. At the DISKPART prompt, type one of the following:

create partition primary [size=n] [offset=n] [ID=byte | GUID] [noerr]

or

create partition extended [size=n] [offset=n] [noerr]

or

create partition logical [size=n] [offset=n] [noerr]


6. At the DISKPART prompt, type:

assign letter=D