Created
October 12, 2019 17:55
-
-
Save andrequeiroz/6cb0a7c5540f5ebdba126c6a89057dc9 to your computer and use it in GitHub Desktop.
Windows 10 USB Flash Drive Install Media
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# usage: script usbdevice isoimage. e.g. script /dev/sde ~/Downloads/Win10_x32.iso | |
echo "Creating Windows 10 Bootable USB Flash Drive on Linux Terminal" | |
sleep 3s | |
echo -n "Formating USB Flash Drive..........................." | |
parted --script $1 \ | |
mklabel gpt \ | |
mkpart primary fat32 1MiB 100% | |
mkfs.vfat -F32 $11 > /dev/null | |
sleep 2s | |
echo "ok" | |
echo -n "Mounting USB Flash Drive and Windows' ISO on /tmp..." | |
mkdir -p /tmp/USB | |
mount $11 /tmp/USB | |
mkdir -p /tmp/WinISO | |
mount -o loop $2 /tmp/WinISO | |
sleep 2s | |
echo "ok" | |
echo -n "Copying files......................................." | |
cp -r /tmp/WinISO/* /tmp/USB | |
sync | |
echo "ok" | |
echo -n "Unmounting USB Flash Drive and Windows' ISO........." | |
umount /tmp/USB /tmp/WinISO | |
sleep 2s | |
echo "ok" | |
echo "Done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment