Saturday, 31 January 2015

Create a Partition From Command Prompt

Create a Partition From Command Prompt

First of all you have to type diskpart to access the program called Diskpart.
Command Prompt
After you've launched diskpart it's time to establish which hard-disk will be used to create a new partition. You need to select the hard disk using the select command. To view available disks and select the desired one you will use the commands list and select, as you can see below. First type list disk. This lists the available hard disks. To select the disk you desire, type select disk followed by the number of the hard disk you want to use.
Command Prompt
To create a new partition you need to use the create partition command followed by partition type and size.
The list command used previously also displays the available free space on each hard disk. Your partition must be of a size equal or less to the amount of available free space.
In order to make a new primary partition with the size of 5000 MB, let's say, we will type create partition primary size=5000. Use the same command and change the size according to your needs and the available free space on your hard disk.
Note: More info about partition types can be found in the article What Is A Partition?.
Command Prompt
Now you have the possibility to assign a letter to the newly created drive by using the assign command. We will assign the R letter by typing assign letter = R.
Command Prompt
Finally you have to format the newly created partition, in order to use it. Type the command format fs=ntfs quick. Use help format to find out more information about this command.
Command Prompt
When you are done working with diskpart, type the exit command to close the program.
Command Prompt

Delete a Partition From Command Prompt

When you need to delete a drive from your computer, the procedure is quite simple. First, open the diskpart application. Then, select the partition you want to delete and type the delete partition command. A sample of how the delete operation works in Command Prompt is provided below. It is a matter of selecting the disk where the partition is found, then selecting the volume to be deleted and running the deletion command.
Command Prompt

Check the State of a Disk

To check a disk for errors you have to use the chkdsk command. Just type chkdsk followed by the drive letter. I recommend that you always use this command in combination with the /f parameter. This enables the tool to automatically fix any errors it finds.
As an example, we will scan the h: drive for errors by typing chkdsk /f h: and pressing Enter. The scan process will start.
Command Prompt
After the scan is finished you will see a report similar to the one from the picture below.
Command Prompt

No comments:

Post a Comment