# Disks show 0B free in diskpart



## masch1na

Hello,

Out of nowhere, my SSD where Windows was installed wouldn't work - showed 0GB of its size in BIOS (but was recognized though) and it wouldn't boot. I tried different slots on the motherboard, but it's not working.

I decided to create a fresh Windows install on my other SSD. I would love to keep the data that's already there, and simply create a 30GB partition of the free space it has (which is around 200GB) and install Windows there.

Regularly through the installation, it doesn't work. I got into the command prompt in advance and into the diskpart section where the list disk shows free 0 B on all of the disks. Therefore, I'm unable to proceed with the command create partition primary size=30000 where I get an error that there's no usable free extent found.

What should I do? The disk has enough free space for sure. I'd love to save my data on it and just part it, I'd hate to have to format and erase it.

I look forward to hearing from you. It's my first time reaching out to this forum after being a watcher for a long time 

Thanks in advance.


----------



## Stancestans

Hi, :welcome: to TSF!



> I decided to create a fresh Windows install on my other SSD. I would love to keep the data that's already there, and simply create a 30GB partition of the free space it has (which is around 200GB) and install my windows there.


You cannot create a partition in allocated space, even if that space is unoccupied. The ~200GB free space has been allocated to a partition or volume and is therefore not available for creation of the 30GB OS partition UNLESS you first SHRINK the volume to release (deallocate) some of that free space to make it available for partition creation. Run the following commands to create space for the system partition on which you'll install Windows.

*DISKPART

LIST DISK

SELECT DISK #*

where # is the disk number shown after running LIST DISK, e.g SELECT DISK 0. Make sure to select the right disk at this stage. Mistakes can be catastrophic!

*LIST PARTITION

SELECT PARTITION #*

where # is the number of the partition on the selected disk, where we want to release some of its free space, e.g SELECT PARTITION 1.

*SHRINK QUERYMAX*

This will show how much space can be released (dis-allocated) from the selected partition's free space. We want to make sure that the partition/volume we selected can be reduced by (at least) the size of the new system partition that you intend to create, otherwise the resize operation will fail. If the above command returns 30,720MB or more, proceed with the shrinking as follows:

*SHRINK DESIRED=30720*

If the operation is completed successfully, there should be 30GB unallocated space on it. You can confirm this by running LIST DISK.

*EXIT

EXIT*

Proceed with Windows setup. At the partition selection screen, you should see the 30GB unallocated space. Select it and click next. Windows will take care of creating the necessary partition(s) on the unallocated space and will proceed with installation. If you encounter an error, kindly stop and report back with details of the error and at which stage it occurred.


----------



## spunk.funk

> I decided to create a fresh Windows install on my other SSD.


 If you have installed Windows on a secondary SSD and you are trying to recover data on the Troubled SSD, then you don't need to create a partition on the Troubled SSD, Just boot off of the Windows SSD with the troubled SSD attached as a secondary drive. Then you can use data recovery tools like the Free Minitool Partition Wizard. Highlight the drive and on the Left panel choose *Partition Recovery*.
If this fails, you can try the free TestDisk program. I have had the best luck with GetDataBack.


----------



## masch1na

@Stancestans

Thank you for the welcome!

I've read through your post and I now understand why I wasn't able to proceed yesterday with what I had in mind. I will give this a shot as soon as I get home and report back. Great steps and explanation my dude.

@spunk.funk
I didn't even give this a thought, since the SSD showed 0.00GB in the BIOS, but that is definitely an extra mile suggestion I greatly appreciate and will try and report back with the results, of course, after I will hopefully be able to successfully install my Windows on an existing, working SSD thanks to our colleague's tips.

Thank you to both of you, looking forward to share the results with you shortly. Have a great day until then!


----------



## masch1na

@Stancestans

I have successfully shrinked and released 30GB (30720, thank you for that so that I don't have an ugly 29.3 or something space) but at the screen, to select a drive to install Windows I see Drive 0 Unallocated Space 30GB with 30GB free, Type none.

After clicking on that, it comes up with an error saying Windows cannot be installed on this disk, selected disk has an MBR partition table. On EFI systems, Windows can only be installed to GPT disks.

The only option I'm able to click on is New when having the disk selected, where I choose all the size, click OK, windows comes up with message that to ensure all windows features work properly, Windows might create additional partitions for system files.

After clicking OK on that, nothing happens and I get back to the same, wrong disk type error.

edit; On list disk command, I now see free 30GB on disk 0.


----------



## spunk.funk

Is this a Desktop or a Laptop?
If you remove the Troubled SSD and attach it to a working computer with a USB-SATA adapter,* Dock *or *Enclosure*. You can use _Recovery Tools_ as outlined in post #3 .
Or if this is a desktop, and you have another SSD or HDD, you can attach _that_ drive. Install Windows to it, _then_ attach the Troubled SSD as a secondary drive and use the _Recovery tools _to try and recover your data. You will need another drive of the same size or larger to restore your files to.


----------



## masch1na

@ spunk.funk
This is a desktop. I have the SSD laying on my table and I'm typing to you from my laptop, but I currently don't have a working second desktop handy. 

It's a good idea to simply connect my second SSD to a computer, install Windows on it and simply boot my PC from it, but it could take a while for me to get USB-SATA and a free PC to work with.

Right now, the issue is that we somehow need to format, maybe also assign a drive letter to those free, unallocated 30GB (which in list disk are still part of disk0--my working SSD I want to save files on) to a type Windows would accept during an installation, through the command prompt available in Windows during the installation.

Hopefully this is possible.


----------



## masch1na

I apologize for double-posting, but I am troubleshooting right now and I wasn't able to edit my previous post since the 15 minutes have passed.

I think I have found a solution, but would like to confirm before proceeding, please.

I believe I should be able to accomplish my task to format and allocate those 30GB to be hopefully successfully used in a Windows installation by following commands;

select disk 0
create partition primary size =30720
select partition 2
format fs=ntfs label="Windows"
assign letter=C
active

It does look like this should work, but again, I'd be very glad to confirm this with you. I'm mostly unsure whether the ntfs type is correct, as well as with the commands in general.


----------



## masch1na

I decided to go for the commands. The partition now shows in the list of where I want to install Windows to, I'm able to format it now(which I didn't do) and such, but I still get the MBR error.

I tried going for diskpart again with disk 0 partition 2 selected and issue a "convert gpt" command, but I get back an error.

The specified disk is not convertible. CDROMs and DVDs are examples of disks that are not convertable.


----------



## Stancestans

masch1na said:


> I decided to go for the commands. The partition now shows in the list of where I want to install Windows to, I'm able to format it now(which I didn't do) and such, but I still get the MBR error.
> 
> I tried going for diskpart again with disk 0 partition 2 selected and issue a "convert gpt" command, but I get back an error.
> 
> The specified disk is not convertible. CDROMs and DVDs are examples of disks that are not convertable.


The error you're getting is because you're starting Windows setup in UEFI mode. That requires a GPT disk, but your disk is MBR, so you need to boot off the Windows installation media in legacy mode. To do this, enter BIOS setup and disable UEFI boot if it has that option. If that's not an option, then enable legacy boot support, sometimes labelled as "UEFI with CSM" or "compatibility" mode. If it doesn't allow you to turn off UEFI, but it let's you enable legacy boot, exit bios and save the changes, and then load the boot device selection menu. You will see boot entries for both UEFI and legacy. The ones for UEFI will be labelled to indicate so, for example UEFI DVD or UEFI JetFlash and so on. Their legacy boot options may not be labelled as such, but may just be labelled regularly, e.g. JetFlash. Select the legacy boot option of your Windows installation media (is it a DVD, USB flash disk, sd card?) and press Enter to boot from it.

The 30GB partition you created is ready for legacy boot (it has to be a primary partition, marked as active and formatted in NTFS).

Kindly Post the make and model of your system (or motherboard if it's custom built) so we can refer to its documentation and assist you better.


----------



## masch1na

@Stancestans

My MB is MSI Z270 GAMING PRO CARBON (MS-7A63).

I have found the option to select Boot mode which has 2 options; 
1. UEFI
2. LEGACY+UEFI

For the installation, I'm using USB. I have used software Rufus to help me create a bootable USB where I chose partition scheme to be GBT partition scheme for UEFI. 

In boot selection I have the USB in both UEFI mode and Legacy, after choosing the Legacy option, I get an error:
An operating system wasn't found. Try disconnecting any drives that don't contain an operating system. Press CTRLALTDEL to restart.

I'm thinking the issue could be with how I have created the Windows bootable USB. Rufus, for partition scheme and target system type gives me 3 options to choose from:
1. MBR partition for BIOS or UEFI
2. MBR partition for UEFI
3. GPT partition scheme for UEFI.

I have no problem recreating the USB with the proper option selected, if that is the issue. If so, I'm unsure which one is correct.

Thank you Stance.


----------



## Stancestans

masch1na said:


> @Stancestans
> 
> My MB is MSI Z270 GAMING PRO CARBON (MS-7A63).
> 
> I have found the option to select Boot mode which has 2 options;
> 1. UEFI
> 2. LEGACY+UEFI
> 
> For the installation, I'm using USB. I have used software Rufus to help me create a bootable USB where I chose partition scheme to be GBT partition scheme for UEFI.
> 
> In boot selection I have the USB in both UEFI mode and Legacy, after choosing the Legacy option, I get an error:
> An operating system wasn't found. Try disconnecting any drives that don't contain an operating system. Press CTRLALTDEL to restart.
> 
> I'm thinking the issue could be with how I have created the Windows bootable USB. Rufus, for partition scheme and target system type gives me 3 options to choose from:
> 1. MBR partition for BIOS or UEFI
> 2. MBR partition for UEFI
> 3. GPT partition scheme for UEFI.
> 
> I have no problem recreating the USB with the proper option selected, if that is the issue. If so, I'm unsure which one is correct.
> 
> Thank you Stance.


You're right. It's how you created the usb. Select the first option (mbr partition for bios or uefi), then you'll be able to boot off it in legacy mode and install Windows.


----------



## spunk.funk

You don't need a second Desktop _or_ a USB Adapter.
Put the _Good_ SSD into your Desktop and attach it to the Motherboard in the_ First_ SATA port. No other drives should be attached.
Change the Settings under the *Security* tab under the Bios for *Legacy UEFI*. Put your Windows USB Flash drive in and restart the computer pressing *F12* and choosing the Flash Drive as first boot device. Once you boot off the USB Drive, choose your _Language_, then *Custom Install*. Select the Good SSD Drive. If there are partitions on it, *Delete* them so the whole drive is *Unallocated Space*, then go *Next*. Windows will create partitions and format them during the Windows install. 
Once Windows is installed Put the Troubled SSD into the Desktop and attach it to the motherboard in the *Second *SATA port. Now you can use Recovery tools on the Troubled SSD from within Windows on the Good SSD to recover data on the Troubled SSD..


----------



## Stancestans

spunk.funk said:


> You don't need a second Desktop _or_ a USB Adapter.
> Put the _Good_ SSD into your Desktop and attach it to the Motherboard in the_ First_ SATA port. No other drives should be attached.
> Change the Settings under the *Security* tab under the Bios for *Legacy UEFI*. Put your Windows USB Flash drive in and restart the computer pressing *F12* and choosing the Flash Drive as first boot device. Once you boot off the USB Drive, choose your _Language_, then *Custom Install*. Select the Good SSD Drive. If there are partitions on it, *Delete* them so the whole drive is *Unallocated Space*, then go *Next*. Windows will create partitions and format them during the Windows install.
> Once Windows is installed Put the Troubled SSD into the Desktop and attach it to the motherboard in the *Second *SATA port. Now you can use Recovery tools on the Troubled SSD from within Windows on the Good SSD to recover data on the Troubled SSD..


The good SSD has data on it, hence the reason for shrinking the existing volume to free (dis-allocate) some of its unoccupied space for an additional 30GB volume on which Windows will be installed. If OP deletes ALL the existing partitions on the good SSD :nono: they'll *lose* the data present on it.


----------



## masch1na

@Stancestans

:dance:
Dude it works. I have Windows installing right now to the 30GB partition we have created. That's amazing. I knew there was a way to get this to work with simply cmd prompt. 

Thank you so much for your help, I have learned a lot and I will definitely stick around the forums more. What a way to welcome someone :smile:

Is there a way to support the forums, the TSF Hardware Team you are a part of or both? I'd love to give back and show my appreciation this way as well.

Thank you again to both of you!!


----------

