Sunday, September 20, 2015

Install Windows 10 on USB External Hard Disk on MAC/PC

As a matter of fact, Microsoft doesn't allow to install windows on USB external devices. If you try to install Windows on external disk drive, you'll get this error:

Windows cannot be installed to this disk. Setup does not support configuration of or installation to disks connected through a USB or IEEE 1394 port.
 But you can install Windows by creating and configuring custom UEFI/GPT-based partition scheme.

Note: In this tutorial, I'll teach you how to install Windows on UEFI/GPT-based hard drive partition because almost every PC and MACBOOK run on it. BIOS/MBR-based hard drive partition has become obsolete.

How to install Windows 10 Tutorial

Configuring Disk Partitions using Bootable Windows 10 USB

You have to create a Windows RE Tools partition, a system partition, an MSR partition, a Windows partition, and a recovery image partition. The following diagram shows this configuration:

Recommended UEFI/GPT drive partitions


After creating the partitions, you can apply the Windows image on the newly created partitions.

  1. Create a windows 10 USB bootable disk and boot from it.
  2. Once you're in the Setup program, select your language, time and currency format and input method, and click Next. Click the Install Now button. Enter/Skip your Windows key if prompted, and read and accept the software licence. In the next screen, press "SHIFT+F10" to open command prompt. Also connect your external hard disk.
  3. Now type diskpart and create the partition using the following script below:
list disk

select disk x (where x your disk number 0,1,2,3,... and so on)

clean (This will format the whole disk)

convert gpt

create partition primary size=350

format quick fs=ntfs label="Windows RE Tools"

assign letter="T"

set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"

gpt attributes=0x8000000000000001

create partition efi size=100
** NOTE: For Advanced Format 4Kn drives, change this value to size = 260 **

format quick fs=fat32 label="System"

assign letter="S"

create partition msr size=128

create partition primary size=256000
** NOTE: I've given 250GB Disk space to the drive where windows will be installed, change this value according to your disk size **

format quick fs=ntfs label="Windows"

assign letter="W"

create partition primary size=4096

format quick fs=ntfs label="Recovery Image"

assign letter="R"

set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"

gpt attributes=0x8000000000000001

**NOTE: I've a 500GB External hard disk and partitioned it accordingly. After this I get an unallocated disk space roughly say 245 GB which I can create a partition here using "create partition primary" or later after Windows installation using Disk Management. **

list volume

exit

Applying Windows, System, and Recovery Partitions by using Deployment Image Servicing and Management(DISM) Tool

Hope you didn't close the command prompt, if yes then again press SHIFT+F10 to open it.

Type C: and press enter.
Type Dir to check if it's your Windows 10 bootable pendrive. If not, use diskpart to verify your pendrive volume letter. list volume command in the above script shows the drive letter of your pendrive.
Now, type the following command in sequence:

md R:\RecoveryImage

copy C:\sources\install.wim R:\RecoveryImage\install.wim

cd X:\Windows\System32

dism /Apply-Image /ImageFile:R:\RecoveryImage\install.wim /Index:1 /ApplyDir:W:\

md T:\Recovery\WindowsRE

copy W:\Windows\System32\Recovery\winre.wim T:\Recovery\WindowsRE\winre.wim

bcdboot W:\Windows /s S: /f UEFI

W:\Windows\System32\reagentc /setosimage /path R:\RecoverImage /target W:\Windows /index 1

W:\Windows\System32\reagentc /setreimage /path T:\Recovery\WindowsRE /target W:\Windows

That's it! Exit the command prompt and close the Windows installation. Reboot and make sure external hard disk is your first priority on any Windows PC. If on Mac, reboot and keep pressing option/alt key until you get Boot Menu, select the EFI Boot and continue. It will reboot again so make sure to press option/alt key again as soon as the system starts and do the same.
And then after some more minutes you will be greeted to create your account!

Use BootCamp on Macintosh OS X to download drivers for Windows 10 which will be approximately 1.5 GB. Standalone/Offline driver download is not available as of now.  
Boot Camp Assistant
Boot Camp Assistant


That's all for today! If you stuck at any point, feel free to comment below! 

51 comments:

  1. I can't find the file "install.win" in sources but I find install.ESD in the CD of windows 10

    ReplyDelete
    Replies
    1. You have to convert it from .ESD to .WIM. google how to do it.

      Delete
    2. so I have done everything you told us to do, and right now my laptop getting ready.

      Delete
    3. AND.......................... IT WORKS!!!!!!!

      I CAN'T THANK YOU ENOUGH!!

      Delete
    4. Any help at all great people I am on the dism.exe apply image I'm typing it in exactly as I see it and it says the parameters are incorrect can anyone please help

      Delete
  2. Worked for me. I had to extract the install.wim file and put it on a separate external drive because the windows installer actually HIDES the install.wim file from its boot. I don't remember why exactly but I also had to use Windows 10 version 1803. I think its because the latest Windows 10 installer (1809) doesn't have a install.wim file at all.
    There is also a typo: As of 20190326, you misspelled the "RecoveryImage" folder in the 2nd to last command line in the last black border box.
    Overall, extremely useful. Thank you for your help.

    ReplyDelete
  3. Wanted also to mention that my "winre.wim" file was 367,240,179 bytes which meant it wouldn't fit on a formatted size of 350MB.. so I made the T partition 368MB instead to have it fit.

    ReplyDelete
  4. Perfect Steps. I am so grateful. It worked like charms for both Normal PCs and Windows on Mac.

    God bless you.

    ReplyDelete
  5. When i get to "copy C:\sources\install.wim R:\RecoveryImage\install.wim" it tells me that "the volume does not contain a recognised file system. Please make sure that all the required file system drivers are loaded and that the volume is not corrupted." Help please.

    ReplyDelete
  6. Wooow it worked! I had to change the partition sizes but amazing I still can't believe it

    ReplyDelete
  7. when i get to “ copy C:\sources\install.wim R:\RecoveryImage\install.wim” it says “ the system cannot find the path specified”. help?

    ReplyDelete
    Replies
    1. the C: is just an example, make sure to put the correct letter from the list volume command

      Delete
    2. make sure you drill down into the /x64/sources or x86/sources before copying install.wim

      this will depend on whether your cpu supports x64 (dual core) or 32 bit (x86)

      if you type "dir" you should see a list that includes these directories

      then tyep cd X:\x64\sources

      then type dir again and you should be able to see the install.wim

      then simply type 'copy install.wim R:\RecoveryImage\install.wim'

      Delete
  8. Big hug for you bro, worked like a Charm :*)
    Notes:
    1. install.esd works fine by itself, no need to convert it to wim
    2. Also needed to extend T: size to fit winre.wim
    3. Typo in path of second last command, its supposed to be RecoveryImage not RecoverImage ;)

    ReplyDelete
  9. Im having error "REAGENTC.EXE: The index of the recovery image (WIM) file must be specified."

    When doing /setosimage. Any idea?

    ReplyDelete
  10. When I type in D:\sources\install.wim R:\RecoveryImage\install.wim

    It says there is not enough space.

    How do I fix it??

    ReplyDelete
  11. We have to create the above partition in our external hard drive Or in laptop hardrive

    ReplyDelete
  12. I get an error during dism it stops at 80% error:433
    A device which does not exist was specified. Any ideas?

    ReplyDelete
  13. Error 87

    The apply-image/imagefile option is unknown.

    Please help..

    ReplyDelete
    Replies
    1. /apply-image Is a command. /Imagefile is another command. Just insert a space !!!

      Delete
    2. Mate I got the same problem even with the space, is there anything else I am missing?

      Delete
  14. Can anyone help me get past the "Reagent.exe is not compatible with the version of Windows you're running" message? I'm installing 64-bit Win 10 on a USB hard drive and currently have no operating system so finding/copying/moving files has to be done in the command prompt. I have just enough tech knowledge to be feared by tech experts far and wide, so any assistance would be greatly appreciated.

    ReplyDelete
  15. How do I know whether mine is an Advanced Format 4Kn drive?

    ReplyDelete
  16. On the line "W:\Windows\System32\reagentc /setosimage /path R:\RecoverImage /target W:\Windows /index 1" there's a typo, and needs to read "W:\Windows\System32\reagentc /setosimage /path R:\RecoveryImage /target W:\Windows /index 1

    Very minor; but, wanted to let you know.

    ReplyDelete
    Replies
    1. Basically just missing the 'y' in Recovery

      Delete
    2. Also, since Windows 10 is so big these days, I recommend bumping up the file sizes.

      Delete
  17. Please am using the latest win 10 pro how do i get install.wim
    Please help I really need this help

    ReplyDelete
  18. Great! I just installed windows 11 on an iMac 2017 external ssd
    T must be 500 and R 4800, maybe little less
    It even skipped the hardware limitations block

    ReplyDelete
    Replies
    1. Only glitch is, if the external SSD is connected, always boots from it, even after selecting an other partition with Option key

      Delete
  19. This comment has been removed by the author.

    ReplyDelete
  20. How can I add Windows 11 as well side by side with the same way on the external hard disk? Thanks in advance

    ReplyDelete
  21. Error: 87
    The apply-image/imagefile option is unkown,
    For more information,refer to the help by running DISM.exe/?.
    The DISM log file can be found at X:\windows\logs\DISM\dism.log


    Please help

    ReplyDelete
  22. I had a FAT32 formatted Windows bootable drive and my install.wim was split into install.swm and install2.swm:

    Had to adjust the commands for file copying and image application according to that:

    copy C:\sources\install.wim R:\RecoveryImage\install.wim

    copy C:\sources\install2.wim R:\RecoveryImage\install2.wim

    .
    .
    .

    dism /Apply-Image /ImageFile:R:\RecoveryImage\install.swm /SWMFile:R:\RecoveryImage\install*.swm /Index:1 /ApplyDir:W:\

    Also needed to adjust T: and R:'s sizes.


    Otherwise I can say that it is crucial to follow step 2 exactly (fucked up once because of this). My further installation experience: I hadn't entered a license key and after rebooting I was stuck on "Just a moment..." for quite long before it rebooted again and got me into repair mode, which works without internet connection gladly.

    In the end it worked! Yay! Kisses to you!

    ReplyDelete
  23. As you can read before, I installed in augoust, but shortly later the boot porcess broke, and it was impossible to repair without formatting everytihng!
    Then I doscovered the On the go installation of Rufus. It's really stable and solid, but can only be installed on a USB key.
    I did it then copied on SSD with clonezilla.
    You're not limited to one PC, you could go on the go to other ones, but the autmatic install of new drivers may break the install, so I use the good one of the 2 to clone into the bad
    Higly recommended

    ReplyDelete
  24. When I type copy E:\sources\install.esd I get an error saying “there is not enough space on the disk. 0 files copied”

    ReplyDelete
  25. Works great. Only problem was the T partition needs to be bigger. I set mine to 370 and still was not enough. Also no need to convert install.esd to .with.

    ReplyDelete
  26. Thank you, man!! It worked like a charm. For disk, Just do install.esd when you don’t find the file, especially for latest windows!

    ReplyDelete
    Replies
    1. When starting after the process is done a got a error says "The computer restarted unexpectedly or encountered an unexpected error.Windows installation cannot proceed ..
      When creation the partions a had to resize :T a :R because they were to small for voting all files, what could be the problem I'm using the lastest Windows 10 iso from Microsoft page.thankyou

      Delete
  27. When starting after the process is done a got a error says "The computer restarted unexpectedly or encountered an unexpected error.Windows installation cannot proceed ..
    When creation the partions a had to resize :T a :R because they were to small for voting all files, what could be the problem I'm using the lastest Windows 10 iso from Microsoft page.thankyou

    ReplyDelete
    Replies
    1. This happen when I restart the computer to complete the installation,also I had selected EFI Boot

      Delete
    2. Nevermind I had to download an old win 10 iso in order to successfully install..
      Thanks a lot you rock!! Now I have win 10 on my external HDD

      Delete
  28. when I do the first dism apply-image command it says unspecified error: 0x80004005

    ReplyDelete
  29. Can't boot from the usb SSD drive after completing the process sadly. And when booting from windows installation usb drive same message appears (cannot be installed on usb or IEEE1394 port)

    ReplyDelete
  30. md R:\RecoveryImage

    copy C:\sources\install.wim R:\RecoveryImage\install.wim

    cd X:\Windows\System32

    What is this last line? My flash drive is d not c if that helps

    ReplyDelete
  31. This post is obsolete!
    just use Rufus, with proper setting it can install Win11 also on an external SSD.
    I did on a Mac and you should use MBR instaed of UEFI

    ReplyDelete
    Replies
    1. Why don't you post a video or a neat write up on this?

      Delete
  32. I am trying to follow these instructions and I am getting error "The operation is not supported on removable media" on the format quick fs=fat32 step. I think I should try Windows to go in order for this to work.
    Also, I realized that my SD card is not recognized without drivers. So in Windows installer I have to browse and load my SD card reader driver before it becomes visible. And this makes me think, even if I succeed with the installation itself, the boot process will fail, because I can't load driver before Windows boot starts, but the card is not visible before the driver loads. Any ideas?

    ReplyDelete
  33. You did a fantastic job sharing this important information. We should always keep sharing this kind of information because about download microsoft office for windows it is significant and meaningful for us to learn more.

    ReplyDelete
  34. Thanks it worked!!!! But windows can't find any drivers any idea why or how I can fix it?

    ReplyDelete

Give opinion & ask your queries here!