Install Porteus or Any Windows/Linux to any medium (Boot Guarantee)

Post tutorials, HOWTO's and other useful resources here.
Post Reply
neonred
White ninja
White ninja
Posts: 5
Joined: 04 Sep 2020, 14:20
Distribution: Runtu, Porteus, Q4OS

Install Porteus or Any Windows/Linux to any medium (Boot Guarantee)

Post#1 by neonred » 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.
Last edited by neonred on 01 Oct 2020, 18:12, edited 3 times in total.

User avatar
Ed_P
Contributor
Contributor
Posts: 5798
Joined: 06 Feb 2013, 22:12
Distribution: 4.0 & 5.0rc2 Cinnamon 64 ISOs
Location: Western NY, USA

Install Porteus or Any Linux to any medium (Boot Garantee)

Post#2 by Ed_P » 05 Sep 2020, 18:42

On EFI systems one must disable the Secure Boot option.
Ed

neonred
White ninja
White ninja
Posts: 5
Joined: 04 Sep 2020, 14:20
Distribution: Runtu, Porteus, Q4OS

Install Porteus or Any Windows/Linux to any medium (Boot Guarantee)

Post#3 by neonred » 26 Sep 2020, 02:43

Thx Ed, instructions revised.

User avatar
Ed_P
Contributor
Contributor
Posts: 5798
Joined: 06 Feb 2013, 22:12
Distribution: 4.0 & 5.0rc2 Cinnamon 64 ISOs
Location: Western NY, USA

Install Porteus or Any Windows/Linux to any medium (Boot Guarantee)

Post#4 by Ed_P » 26 Sep 2020, 14:38

Referencing GPT you might find this thread interesting neonred.
Uefi and porteus 3.0
Ed

neonred
White ninja
White ninja
Posts: 5
Joined: 04 Sep 2020, 14:20
Distribution: Runtu, Porteus, Q4OS

Install Porteus or Any Windows/Linux to any medium (Boot Guarantee)

Post#5 by neonred » 21 Nov 2020, 11:58

Can't edit post, so here's a slight update in case you get an error when you mount the image

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)
If the image extension is "img" or if you otherwise get this error:
wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.

Then you are going to multiply the sector size by the start sector (i.e., sector size is 512, sector start is 2048) = 1048576
To view this information for your image you need to use this command:
sudo fdisk -l -u=sectors /home/username/Downloads/tails-amd64-4.13.iso
sudo mount -o loop,offset=1048576 /home/username/Downloads/tails-amd64-4.13.img /media/iso

neonred
White ninja
White ninja
Posts: 5
Joined: 04 Sep 2020, 14:20
Distribution: Runtu, Porteus, Q4OS

Install Porteus or Any Windows/Linux to any medium (Boot Guarantee)

Post#6 by neonred » 21 Nov 2020, 13:05

Now if you went ahead and tried to copy Tails to your emmc,
You will get bountiful error that can be resolved by 3 things:
1. Enable Legacy Boot in Bios
2. Enable Virtualization in Bios
3. When you get to the Tails boot menu press e or tab to edit and remove "live-media=removable" from the boot sequence, and press F10 to continue.

Tolkem
White ninja
White ninja
Posts: 19
Joined: 10 Aug 2019, 05:53
Distribution: Porteus 4.0 KDE

Install Porteus or Any Windows/Linux to any medium (Boot Guarantee)

Post#7 by Tolkem » 02 Dec 2020, 17:45

Nice tutorial. However, I do wonder what's the advantage of doing this and doing

Code: Select all

sudo mount -o loop /path/to/distro.iso /mnt
then open a file manager, navigate to /mnt, select everything and copy/paste it to /media/whatever within the file manager? I've done that and it works with both Windows and Linux.

Post Reply