{"id":1828,"date":"2018-01-28T05:35:27","date_gmt":"2018-01-28T05:35:27","guid":{"rendered":"http:\/\/cdblog.cdstealer.com\/?p=1828"},"modified":"2019-01-12T06:09:50","modified_gmt":"2019-01-12T06:09:50","slug":"create-bootable-windows-installation-usb","status":"publish","type":"post","link":"https:\/\/cdblog.cdstealer.com\/?p=1828","title":{"rendered":"Create Bootable Windows Installation USB"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-1829\" src=\"http:\/\/cdblog.cdstealer.com\/wp-content\/uploads\/2018\/01\/windows_logo-1024x219.png\" alt=\"\" width=\"474\" height=\"101\" srcset=\"https:\/\/cdblog.cdstealer.com\/wp-content\/uploads\/2018\/01\/windows_logo-1024x219.png 1024w, https:\/\/cdblog.cdstealer.com\/wp-content\/uploads\/2018\/01\/windows_logo-300x64.png 300w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/p>\n<p>So, a situation may arise where you are required to install Windows where the only media you have is a USB drive. Now if you're already running Windows, you can do this with the <a href=\"https:\/\/www.microsoft.com\/en-gb\/software-download\/windows10\" target=\"_blank\" rel=\"noopener\">media creation tool<\/a>.<br \/>\nYou can download a Windows 10 image direct from M$ <a href=\"https:\/\/www.microsoft.com\/en-gb\/software-download\/windows10ISO\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n<p>Obviously, we're running Linux ;) So download the ISO image and let's get cracking ;)<\/p>\n<h3>USB Prepare<\/h3>\n<p>You will need a drive &gt;4Gb (I used a 2Gb :\\)<\/p>\n<p>Insert your USB and execute (where 'X' is the drive eg \/dev\/sda):<\/p>\n<pre>fdisk \/dev\/sdX<\/pre>\n<p>I'm assuming there are no partitions defined. So we'll start from scratch.<\/p>\n<pre># fdisk \/dev\/sdj\n\nWelcome to fdisk (util-linux 2.30.2).\nChanges will remain in memory only, until you decide to write them.\nBe careful before using the write command.\n\n\nCommand (m for help): p\nDisk \/dev\/sdj: 1.9 GiB, 2058354688 bytes, 4020224 sectors\nUnits: sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 512 bytes\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\nDisklabel type: dos\nDisk identifier: 0x0003dd8d\n-------------------------------------------------------------------------------\nCommand (m for help): n\nPartition type\n   p   primary (0 primary, 0 extended, 4 free)\n   e   extended (container for logical partitions)\nSelect (default p): p\nPartition number (1-4, default 1): \nFirst sector (2048-4020223, default 2048): \nLast sector, +sectors or +size{K,M,G,T,P} (2048-4020223, default 4020223): \n\nCreated a new partition 1 of type 'Linux' and of size 1.9 GiB.\n-------------------------------------------------------------------------------\nCommand (m for help): t\nSelected partition 1\nHex code (type L to list all codes): 7\nChanged type of partition 'Linux' to 'HPFS\/NTFS\/exFAT'.\n-------------------------------------------------------------------------------\nCommand (m for help): a\nSelected partition 1\nThe bootable flag on partition 1 is enabled now.\n-------------------------------------------------------------------------------\nCommand (m for help): p\nDisk \/dev\/sdj: 1.9 GiB, 2058354688 bytes, 4020224 sectors\nUnits: sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 512 bytes\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\nDisklabel type: dos\nDisk identifier: 0x0003dd8d\n\nDevice     Boot Start     End Sectors  Size Id Type\n\/dev\/sdj1  *     2048 4020223 4018176  1.9G  7 HPFS\/NTFS\/exFAT\n-------------------------------------------------------------------------------\nCommand (m for help): w\nThe partition table has been altered.\nCalling ioctl() to re-read partition table.\nSyncing disks.<\/pre>\n<p>Make sure you have sys-fs\/ntfs3g installed.<\/p>\n<p>Execute<\/p>\n<pre>mkntfs -Q \/dev\/sdj1<\/pre>\n<pre># mkntfs -Q \/dev\/sdj1\nCluster size has been automatically set to 4096 bytes.\nCreating NTFS volume structures.\nmkntfs completed successfully. Have a nice day.<\/pre>\n<h5>Install boot sector<\/h5>\n<p>Make sure you have ms-sys installed.<\/p>\n<p>Execute ms-sys -n \/dev\/sdj1<\/p>\n<pre># ms-sys -n \/dev\/sdj1\nNTFS Windows 7 boot record successfully written to \/dev\/sdj1<\/pre>\n<p>Now for the installation files.<\/p>\n<p>Mount the downloaded ISO and the USB drive.<\/p>\n<pre>mount -o loop \/$HOME\/Downloads\/Win10_1709_English_x64.iso \/mnt\/THIS\nmount \/dev\/sdj1 \/mnt\/THIS<\/pre>\n<p>Now copy the files.<\/p>\n<pre>cp -Rv \/mnt\/THIS\/* \/run\/media\/\/\/<\/pre>\n<p>And that's it. Unmount the ISO\/USB and go install.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, a situation may arise where you are required to install Windows where the only media you have is a USB drive. Now if you're already running Windows, you can do this with the media creation tool. You can download a Windows 10 image direct from M$ here. Obviously, we're running Linux ;) So download &hellip; <a href=\"https:\/\/cdblog.cdstealer.com\/?p=1828\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Create Bootable Windows Installation USB<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[10,8,300],"class_list":["post-1828","post","type-post","status-publish","format-standard","hentry","category-gentoo","tag-install","tag-usb","tag-windows"],"_links":{"self":[{"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/posts\/1828","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1828"}],"version-history":[{"count":5,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/posts\/1828\/revisions"}],"predecessor-version":[{"id":1928,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/posts\/1828\/revisions\/1928"}],"wp:attachment":[{"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1828"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1828"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1828"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}