How create new partition on an unallocated space using diskpart?

13

6

I want to install windows 7 on an unallocated space made by shrinking an extended partition. the problem is that windows setup can't create new partition on unallocated space. how I can create a partition there using diskpart while that space is not shown by "list partition" of diskpart?

Hadi

Posted 2014-10-11T22:16:23.343

Reputation: 155

Answers

20

I wouldn't suggest using diskpart if the hard drive already has some data on it, especially if you've installed the system on it. This is because if you don't know how to use it, then it's better to avoid using it to prevent you from data loss. You can use a third party tool to do that instead, which will give you the same results. Use EaseUS Partition Master (Free Edition), or visit the Best Free Partition Management Software page to have a look at other tools.

In case you still prefer to do it the long way, using diskpart, follow these steps :

  1. Open the Command Prompt as Administrator. Type diskpart and hit Enter.
  2. Once you enter to the diskpart screen type list disk and hit Enter.
  3. Now a list of the disks will be shown, type select disk x (the X is the disk number that has an unallocated space) and hit Enter.
  4. Now, type create partition primary size=x (The X is the number that you got from the Free column on the previous step) and hit Enter.
  5. After the creating is done, type select partition 2 and hit Enter.
  6. Now that you are in the new partition, you need to format it by typing format fs=ntfs quick and hit Enter.
  7. After that, type assign and hit Enter.
  8. Then, type active and hit Enter.
  9. Now, your new partition is ready to use.

P.S: Make sure that you select the correct disk that you want to create a new partition on it. Also, Disk 0 is the disk that has the current system installed on.

This is an example of how the above process works: Suppose that I have an 8GB flash drive that it has one partition with size 4GB, and an unallocated space of 3535MB (about 3.5GB). So I need to use the unallocated space and create a new partition to be used. enter image description here

iSR5

Posted 2014-10-11T22:16:23.343

Reputation: 1 633

Hi, I have a brand new ssd disk, for some reason when i do list disk, the disk have 0 free, i am wondering why? this (0 free) doesnt have any sense – user668027 – 2016-04-29T09:19:58.917

@user668027 if you mean that the "0" under Free column, don't worry about it, because it shows the total unpartitioned space on your SSD. – iSR5 – 2016-04-29T09:40:35.273

If you have a partition that occupies a part of the disk, you can select it, delete it and then create a partition. – Asu – 2017-07-27T23:19:27.903

0

You could try using Disk Management this will allow resizing partitions and creating new ones with great ease. Create a NTFS partition if you want to be able to boot Windows from it.

Hector Prado

Posted 2014-10-11T22:16:23.343

Reputation: 1

Thanks. but I have formatted windows partition and there is no other windows installed. windows setup gui can't create new partition, when I press apply nothing happens! Is it safe to use tools like Hiren's Boot CD? – Hadi – 2014-10-12T00:21:41.270

Yes that is one of the many uses of Hiren´s but I would recommend that unless you know it is one of the real copies to just dowload ubuntu and use the gparted command it will bring a easy to use gui. – Hector Prado – 2014-10-12T00:24:07.040

0

Problem solved. thanks. I used a boot tool from Acronis and problem solved. the main problem was error "Setup was unable to use the existing partition because it does not contain the required free space." when I wanted to select partition to install windows 7. that problem solved by deleting system partition (I think it's a small partition for boot data, etc).

Hadi

Posted 2014-10-11T22:16:23.343

Reputation: 155

Super thanks man for this great step by step explanation! Cool for when there are lazy ones among us, like me today :-D Thanks man! – Lawrence – 2016-06-21T16:57:57.910