Install Porteus or Any Windows/Linux to any medium (Boot Guarantee)
Posted: 04 Sep 2020, 14:56
Some of you are trying to install linux to usb drive and may get an error on etcher.
Others are trying to install Porteus or Tails to a non-usb hard drive.
Some of you might be trying to get a Windows 10 / Linux bootable USB drive from installed Linux or from Live Linux.
In this tutorial I will show you a bullet proof way to get it working.
You will find no better guide on the internet, but attention to detail is important.
So you've downloaded the iso you need.
Typically you will then create a bootable usb drive (stick or hard drive...flash cards don't work for this purpose).
However, what if you wanted to "install" Tails?
Then you could use the internal hard drive; this only becomes problematic with multi boot.
This tutorial won't cover multiboot, but I'm sure some one would appreciate such a follow up i.e., install Windows and then Tails to hard drive.
So decide which device you would like to use for bootable medium and know that all information on it will be destroyed.
Preamble: EFI requires MSDOS partition table (not GPT) and FAT32 File System, macs also require this.
Now you need to put these commands in the terminal.
These should work in Debian/Ubuntu, and may be slightly different in other distros.
A partition cannot end with a forward slash unlike a folder i.e.,
legal : sudo mount /dev/sdc1 /media/drive/
illegal: sudo mount /dev/sdc1/ /media/drive/
cd /media
sudo mkdir iso
sudo mount -o loop /path/to/iso /media/iso
(there's 2 paths in the previous command, failure to include one will produce an /etc/fstab error)
Now use gparted to destroy all partitions wherever you want to install (on that device)
On that same device, create an MS-DOS partition table.
Now Create a fat 32 partition, apply, and then set the flag to boot.
Take note the /dev/ name of that partition which for me is sdc1 in the next step.
Mount the device with your file manager or manually
cd /media
sudo mkdir drive
sudo mount /dev/sdc1 /media/drive/
sudo cp -a --no-preserve=mode,ownership /media/iso/. /media/drive/
(that no-presever=mode,ownership is especially useful for windows isos)
df -h (look for the last loop device which will be the /media/iso loop we created earlier)
(we must unmount this, probably loop7 on porteus live)
sudo umount /dev/loop0 (failure to do this step will yield device in use error in the next step)
sudo umount /media/drive/ (this will take a while but when complete the files are copied)
Last step, set your bios to support legacy boot. Turn secure boot off as well. When you boot up porteus choose EFI.
Normally EFI requires secure boot files, but many distros don't include them.
Using the aforementioned options makes it so that it doesn't require those secure boot files.
Otherwise if those options are not set you will get an error.
This will work on every distribution (Linux and Windows) which include boot files on ISO.
No more errors with Etcher, having to depend on Etcher, be free, with style and proud of using the terminal.
Tested on Windows 10 x64 1607 Enterprise 2016
Note; If you get an unable to find install medium error, it's probably because you are not using one of Microsoft's official ISO. One of the items "Lite Windows" often error on is trimming boot.wim If the exact source to create the "Lite Windows" is known, then the original can be downloaded, then you just extract the original boot.wim and replace the one on your bootable medium.
Others are trying to install Porteus or Tails to a non-usb hard drive.
Some of you might be trying to get a Windows 10 / Linux bootable USB drive from installed Linux or from Live Linux.
In this tutorial I will show you a bullet proof way to get it working.
You will find no better guide on the internet, but attention to detail is important.
So you've downloaded the iso you need.
Typically you will then create a bootable usb drive (stick or hard drive...flash cards don't work for this purpose).
However, what if you wanted to "install" Tails?
Then you could use the internal hard drive; this only becomes problematic with multi boot.
This tutorial won't cover multiboot, but I'm sure some one would appreciate such a follow up i.e., install Windows and then Tails to hard drive.
So decide which device you would like to use for bootable medium and know that all information on it will be destroyed.
Preamble: EFI requires MSDOS partition table (not GPT) and FAT32 File System, macs also require this.
Now you need to put these commands in the terminal.
These should work in Debian/Ubuntu, and may be slightly different in other distros.
A partition cannot end with a forward slash unlike a folder i.e.,
legal : sudo mount /dev/sdc1 /media/drive/
illegal: sudo mount /dev/sdc1/ /media/drive/
cd /media
sudo mkdir iso
sudo mount -o loop /path/to/iso /media/iso
(there's 2 paths in the previous command, failure to include one will produce an /etc/fstab error)
Now use gparted to destroy all partitions wherever you want to install (on that device)
On that same device, create an MS-DOS partition table.
Now Create a fat 32 partition, apply, and then set the flag to boot.
Take note the /dev/ name of that partition which for me is sdc1 in the next step.
Mount the device with your file manager or manually
cd /media
sudo mkdir drive
sudo mount /dev/sdc1 /media/drive/
sudo cp -a --no-preserve=mode,ownership /media/iso/. /media/drive/
(that no-presever=mode,ownership is especially useful for windows isos)
df -h (look for the last loop device which will be the /media/iso loop we created earlier)
(we must unmount this, probably loop7 on porteus live)
sudo umount /dev/loop0 (failure to do this step will yield device in use error in the next step)
sudo umount /media/drive/ (this will take a while but when complete the files are copied)
Last step, set your bios to support legacy boot. Turn secure boot off as well. When you boot up porteus choose EFI.
Normally EFI requires secure boot files, but many distros don't include them.
Using the aforementioned options makes it so that it doesn't require those secure boot files.
Otherwise if those options are not set you will get an error.
This will work on every distribution (Linux and Windows) which include boot files on ISO.
No more errors with Etcher, having to depend on Etcher, be free, with style and proud of using the terminal.
Tested on Windows 10 x64 1607 Enterprise 2016
Note; If you get an unable to find install medium error, it's probably because you are not using one of Microsoft's official ISO. One of the items "Lite Windows" often error on is trimming boot.wim If the exact source to create the "Lite Windows" is known, then the original can be downloaded, then you just extract the original boot.wim and replace the one on your bootable medium.