In GNU/Linux, you can create a bootable USB flash drive using an ISO disc image of another distribution, by using the command-line. The command that is used to create that is called ‘dd’.
By default, almost all USB flash drives use a common partition layout (which of course can be changed) that consists of a single, primary partition occupying the whole space. However, when you use ‘dd’ on an USB flash drive, it will destroy this layout and will create a new partition layout.
It will create a partition that is big enough to hold the data of that ISO file, followed by another special partition called ‘EFI System Partition’ that stores files related to booting etc and finally, the remaining space (if any) of the USB flash drive will be hold in, as an ‘Unallocated area’.
The thing is, other operating systems like Windows 8 will only recognize the ‘EFI System Partition’ (which is usually around 2-3MB) and the rest of the ‘free space’ will be unusable!. Even other advanced tools like the ‘disk manager’ in Windows, though it properly recognizes the partition layout, won’t let you create a partition on the remaining ‘free space’ and use that space either.
Not only in Windows, but some tools in GNU/Linux have also failed while letting me create a partition on this ‘unallocated area’ as well.
I personally don’t like this approach used by ‘dd’ (though it might have some advantageous), as it creates unnecessary complications, because you can still create a bootable USB flash drive, without having to repartition it this way, thus you will be able use it as usual (reformat, delete or add files etc).
Nevertheless, if you did not know this at the time you used ‘dd’ and looking for a way to get rid of it using Windows 8, then please follow the below steps. Not only by ‘dd’, you can use these instructions for getting rid of ‘EFI’ partitions created by other tools too.
Note: Before proceeding, please be aware that, this will destroy all the data on the drive!.
Step 1:
Press the ‘Windows key’ on your Keyboard and then simply type the below command.
cmd
Step 2:
Then Windows 8 will locate the ‘cmd’ application. Now, as shown below, right click on its icon and then from the options that will be listed at the bottom of the screen, select ‘Run as Administrator’.
When asked, click ‘Yes’ to the next message.
Step 3:
This will open ‘cmd’ with administrative privileges. Once it is opened, type the below command on its window (make sure the USB drive is attached).
diskpart
Then wait for few seconds, until the command prompt changes into ‘DISKPART>’.
Step 4:
Now enter the below command.
list disk
This command, as shown below, will give you a list of all the disk drives that are currently attached to your computer (USB, IDE, SATA etc).
Now have a careful look at its output and make a note of the disk drive number of the USB flash disk that we need to restore to its original partition layout (in this instance it is ‘Disk 1’).
Step 5:
Once you know the disk number, simply replace the ‘Disk 1’ (unlike GNU/Linux, Windows is not case-sensitive, so you should be able to use ‘disk 1’ as well) part of the below command with your disk’s given name and execute it.
select Disk 1
When you issue this command, it will give you an output saying that, that particular disk is now selected (shown below).
Step 6:
Now to delete the partition layout of this disk, enter the below command (this will erase the entire disk!, so make sure the entered disk name is correct!).
clean
If you get an error saying that somehow ‘diskpart’ was unable to do it (it happens sometimes), then try the ‘clean’ command again. If everything goes accordingly, then you should see the message ‘DiskPart’ succeed in cleaning the disk’.
Step 7:
Now all we have to do is to create the standard partition layout that is used in USB flash drives (a single, primary partition, occupying the whole space). For that, enter the below command.
create partition primary
If it was successfully created, you should see a message saying ‘DiskPart succeeded in creating the specified partition’.
Step 8:
Now open ‘My Computer’, double click on the USB flash drive’s icon, and Windows 8 will ask whether you’d like to format the drive or not.
Then make your selections from the ‘format disk’ window that you get next (when unsure, use the default settings), once done, click on the ‘Format’ button.
That’s it, now you should have restored your USB flash drive to its original partition layout and can start using it as usual. Good luck.
Credits: Some information via ‘Winability.com’.
It seems that I have an entirely new beastie on my hands… a USB stick with only one partition, but somehow a virtualized CD drive is installed on it!
Trust me, I have attacked this thing six ways to Sunday. There is only one FAT partition, diskpart sees only one drive, and yet even after clearing it out with diskpart, linux partitioners, Mac partitioners and even doing zero-fill wipes with boot utilities, this drive still has a virtual CD-ROM on it.
I have to take my hat off to those who designed this drive… because I have in my hand a USB drive that has got a virtual CD-ROM, but without that virtual CD-ROM appearing anywhere on the drive itself!
Hmm, you’ve got a situation here :).
I did a quick Google search and I don’t know if you’ve already tried this, but this CD drive could be controlled, through, and by, the USB drive’s firmware. So have you tried the ‘solution’ provided in the below link ? (use it at your own risk René, as it says the tool has the potential of messing things up more!).
http://superuser.com/questions/92675/how-to-remove-a-partition-on-a-usb-drive
Thanks! This saves my life!
You’re welcome Jian.
What a brilliant article I’ve ever had learnt…. Thank you so much!!!! This one saved my life… Thanks a lot! 10 stars for you!
:).
If windows built-in disk management can not remove efi or other partitions in usd drive.
Maybe you can try windows partition manager. Then can remove partitions on matter in basic hard disk or usb drive.
have a try!
http://www.partition-tool.com/resource/GPT-disk-partition-manager/remove-gpt-disk-partition.htm
cool , its helps me …
You’re welcome Suresh.
You made it look easy, it was! Thanks
You’re welcome 🙂 .
Thanks for this information. It worked very well. I had partitions the usb drive for a mac and when I finished my work with it, I wanted to convert it back to a ntfs partition. I had no difficulty in following the instructions.
You’re welcome William.
Thanks! worked great. I had a USB stick that had been previously used to boot a linux distro and windows only recognized a small portion of its capacity. Followed this how to and now the USB stick is restored to its full capacity.
You’re welcome Jake.
Thanks, I don’t know how it managed to get partitioned, but this completely and easily restored by USB to it original state. Thank you so much
You’re welcome Micki!.
Thank you.
I had this problem – found your post – your steps were clear, concise and exact.
Thank you again. Problem solved, and I learned something today.
You’re welcome 🙂 .
Dude! Life Saver Man!!!!!
I know! 😛 .
Exactly what i was looking for! thanks! 🙂
You’re welcome Prasad 🙂 .
Thanks Gayan, spot on 🙂
You’re welcome 🙂 .
Four Thumbs Uo, yeah..finally i can use my flashdrive again..Thank
You seem quite relieved. You’re welcome 😉 .
very helpful!!! thanks a lot!!
You’re welcome.
It’s fantastic that the shown steps worked for me. Thank you very much.
You’re welcome.
Awesome… what a brilliant cmd trick… thank you
You’re welcome.
Good trick. Thank you
You’re welcome.
THANK U SO MUCH. I was stuck. u r awesome.
You’re welcome.
it’s work, thank you..
You’re welcome.
thanks this save my life
You’re welcome.
Thank you a lot gayan, woks great
You’re welcome.
Thank you sir its worked
You’re welcome.
Thank you for your tutorial 🙂
You’re welcome 🙂 .
AW that was an awesome help. Got rid of the second redundant partition. Thanks
You’re welcome.
Thank you, this was very helpful and self explanatory! It solved the problem.
You’re welcome.
Thank you sir. Finaly recoveried my usb
You’re welcome.
Hi
I have microSD HC card.
When I try to make format this card Win7 showing that “Win7 couldn’t finish format drive” In settings of card i can’t do nothing :/
What to do ? Can U help ?
Thank you so much! It worked. I couldn’t use GParted, so this helped me a lot!
My pleasure 🙂 .
Thanks a million!
Worked!!!
You’re welcome.
Thanks sir. I have searched for a way long time and finally you have told me how to do the same..
You’re welcome.
Amazing way of explaining how to solve this issue. It worked great and it works for Windows 7, Windows 8, and Windows 10.
You’re welcome Jaime.
Amazingly simple and coherent.
Thank you Gayan
You’re welcome Nick.