[HOWTO] Booting Porteus from USB tricks and tips

Post tutorials, HOWTO's and other useful resources here.
User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[HOWTO] Booting Porteus from USB tricks and tips

Post#1 by Rava » 16 Sep 2022, 10:40

Hi y'all,

this should be a collection of posts, the initial one (aka this one) shall be sort of an index that links to one specific follow up post in this thread.

What I can think of for now are these topics:
Formatting and mkfs using fdisk and mkfs.*
Formatting and mkfs using gparted
Caveats when using a SD-Card
Tips for USB thumbdrives
Tips for external USB harddrives

The standard way of installinp Porteus on a USB device is to extract the files and folders from the ISO (some Compression utilities on Windows can open ISO files for copying - e.g. 7z, WInzip, WinRAR)
Cave! Keep the hierarchy and folders as they are in the ISO

Example: I mounted the Porteus-XFCE-v5.0-x86_64.iso ISO using mloop of porteus.
Then it is available in /mnt/loop:

Code: Select all

guest@porteus:/mnt/loop$ ls -o --time-style=long-iso
total 8
drwxr-xr-x 3 root 2048 2020-05-04 21:12 EFI
-r--r--r-- 1 root 1512 2019-11-17 03:32 USB_INSTALLATION.txt
dr-xr-xr-x 4 root 2048 2021-06-02 05:57 boot
dr-xr-xr-x 6 root 2048 2021-07-03 08:50 porteus
Just copy everything into your empty root directory of your USB drive (or partition if your external USB device has more than one partition)

What you execute to make it bootable is in here:

Code: Select all

guest@porteus:/mnt/loop$ ls -o --time-style=long-iso boot/
total 570
-r-xr-xr-x 1 root 384374 2022-05-09 10:52 Porteus-installer-for-Linux.com
-r-xr-xr-x 1 root 192745 2022-05-08 07:49 Porteus-installer-for-Windows.exe
dr-xr-xr-x 2 root   2048 2021-06-14 10:27 docs
dr-xr-xr-x 2 root   4096 2022-07-02 14:41 syslinux
DO NOT EXECUTE Porteus-installer-for-* from the mounted ISO iself, that would fail.
Go to wherever your USB drive is mounted and go into the boot/ folder there and execute
Porteus-installer-for-Windows.exe when you currently run Windows
or execute
Porteus-installer-for-Linux.com when you currently run any kind of Linux.

Make sure you select the correct device, e.g. you mounted your USB thumbdrive in /mnt/sdb1 - then go to /mnt/sdb1/boot/ and execute the appropriate Porteus-installer-for-*

When boot fails, first check if the md5sum of the downloaded iso is correct, aka check the md5sum of your local file with the md5sum of the file that holds that info on the server.
If there is a mismatch in md5sums, download the ISO again and try again copying all the files.
In such a case you not need to partition and mkfs the USB drive anew, just delete all files and folders of your previous attempt and copy all files and folders of your new download.

Only if you fail doing so (e.g. one file is locked and cannot be removed) you have to partition and mkfs anew.

__________________________________

When addons or improvements are proposed to one of the booting from USB methods in a follow up post, the initial post as linked in this index post should be updated. If you cannot update it yourself (e.g. because the post is too old by then) ask one of the forum moderators to do so:
francois - Ed_P - and yours truly [= Rava] (e.g. by sending a PM)
Cheers!
Yours Rava

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[HOWTO] Booting Porteus from USB tricks and tips

Post#2 by Rava » 16 Sep 2022, 10:40

Formatting and mkfs using fdisk and mkfs.*
Caveats when using a SD-Card


I had a 2 GB SD card (obviously not a SDHC card) that I had no real use for (too small for a digital camera), so I decided to use it as my main Porteus external USB boot drive.

Some issues here to consider

The internal SD-card-reader is not only slooooow (it is usually internally connected as USB1.1) but is also unable to boot from, so trying to use that internal SD-card-reader will fail.

There are cheap USB-plug-in SD-card readers but these are often unreliable as hell, I cannot recommend any of the no-brand cheap ones. I use one of my several Delock ones, and they might be more expensive, none of these ever failed me. Choose whatever brand USB-plug-in SD-card reader your local trusted PC store sells, mine just happens to sell Delock.

I formatted the 2 GB into ext2 to keep the read/writing on it to a minimum (because of the lack of journaling), even when my system crashed and I was unable to use REISUB - ( Magic SysRq key on wikipedia ) - aka the drive was not umounted safely the missing journaling never created any issue.

I just used first fdisk to create the partition and then mkfs.ext2 to format the drive.

This is what fdisk -l /dev/DEVICE tells me:

Code: Select all

Disk /dev/sdc: 1.84 GiB, 1977614336 bytes, 3862528 sectors
Disk model: STORAGE DEVICE  
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x7790a0a0

Device     Boot Start     End Sectors  Size Id Type
/dev/sdc1  *      135 3862527 3862393  1.8G 83 Linux
Know that "Disk model: STORAGE DEVICE " is not really the name of the drive, it is the generic vague name the Delock USB SD-card-reader reports to the system.

When you press the whatever key is needed for your PC to select the drive to boot from, initially better not have any other USB drives plugged in as well (like an external USB hardrive, or a regular USB thumbdrive) so that you see what your drive is called - and compare that to later booting when you have other USB media present and remember what you SD card in USB SD-card-reader is called at your boot media selection screen at boot time.
Cheers!
Yours Rava

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[HOWTO] Booting Porteus from USB tricks and tips

Post#3 by Rava » 16 Sep 2022, 10:45

Tips for USB thumbdrives

Since USB thumbdrives have limited write cycles, it is usually recommended to not use journaling on them.

As you can see in my post above, I use ext2 on a SD card (same limited write cycle as they use the same data storage technique) and never ran into issues even once, even when the system crashed and I could not do a safe reboot via REISUB - ( Magic SysRq key on wikipedia ).
The use of ext2 is usually reserved for PCs that use BIOS and will not work for ones using UEFI.

Also, this info by nanZoris from another thread is neat:
nanZor wrote:
20 Sep 2022, 07:03
If one is using SD cards for Porteus, and you have Windows / Mac handy, you can make sure it is formatted properly by those who wrote the specs for oem's. At least once in it's lifetime. And unlike *anything* else, these guys have the ability to rewrite the firmware inside your SD card's actual controller in case it is corrupt - which gparted, windows, mac and others can't touch:

https://www.sdcard.org/downloads/formatter/

Sometimes I'll use this to make sure the SD card controller's internal firmware is programmed properly and THEN use gparted or other utils for special formatting. This was very important when I was running SBC or single-board computers using SDcards - the sdcard.org formatter is the only one that knows how to gain access to rewrite the internal firmware for best performance / corruption fixes before I installed the OS on it. But use a real sdcard port - I'm not sure a usb<>sdcard dongle will do this correctly.
Cheers!
Yours Rava

User avatar
Ed_P
Contributor
Contributor
Posts: 8361
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

[HOWTO] Booting Porteus from USB tricks and tips

Post#4 by Ed_P » 17 Sep 2022, 03:10

Rava wrote:
16 Sep 2022, 10:40
I formatted the 2 GB into ext2
Does your 2 GB SD ext2 card boot on UEFI systems?
Ed

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[HOWTO] Booting Porteus from USB tricks and tips

Post#5 by Rava » 17 Sep 2022, 06:48

Ed_P wrote:
17 Sep 2022, 03:13
Does your 2 GB SD ext2 card boot on UEFI systems?
I have no UEFI system, so I cannot tell.

But is is mounted as any old regular external USB device - so why shouldn't it?
When some random USB-thumbdrive formatted as ext2 boots on your UEFI system, then a 2 GB SD ext2 card via a USB card reader will also boot on your system.

Also, the 2 GB SD ext2 card is mainly used for one specific system as it only loads the initrd and kernel (since my kernel issue loading from the internal hard disk is still unresolved) and loads all other modules from the internal drives as its default boot.
There also exists the option of loading everything from the 2 GB SD ext2 card … but usually all of my most-recently-updated modules are outdated on it since my automated creating and updating scripts only work for the internal solution. (I mean my 991-usr_local_bin_RECENT.xzm and 992-rootcopy_5.0-RECENT.xzm modules via my make-991-usr_local_bin.sh and make-992-rootcopy.sh module creation and updating via base/ script [*])

_____________
[*] indeed "script" is correct since it is one script and a symlink to to, and the script determines what to do based on the name it was executed as:

Code: Select all

root@porteus:/# file /usr/local/bin/make-992-rootcopy.sh
/usr/local/bin/make-992-rootcopy.sh: symbolic link to make-991-usr_local_bin.sh
Cheers!
Yours Rava

itrukrakso
Black ninja
Black ninja
Posts: 62
Joined: 23 Jul 2022, 07:42
Distribution: Porteus 5.01_x86_64 Xfce

[HOWTO] Booting Porteus from USB tricks and tips

Post#6 by itrukrakso » 17 Sep 2022, 19:30

Hi,
Rava wrote:But is is mounted as any old regular external USB device - so why shouldn't it?
When some random USB-thumbdrive formatted as ext2 boots on your UEFI system, then a 2 GB SD ext2 card via a USB card reader will also boot on your system.
It's not that simple.
Basically there are at least 2 different bios systems, legacy bios and UEFI bios (with or without security boot).
If something is formatted with ext* it can only be booted with legacy bios.
UEFI needs a fat as 1st partition, otherwise it will not boot at all.
Rava wrote:Also, the 2 GB SD ext2 card is mainly used for one specific system as it only loads the initrd and kernel (since my kernel issue loading from the internal hard disk is still unresolved) and loads all other modules from the internal drives as its default boot.
There also exists the option of loading everything from the 2 GB SD ext2 card … but usually all of my most-recently-updated modules are outdated on it since my automated creating and updating scripts only work for the internal solution. (I mean my 991-usr_local_bin_RECENT.xzm and 992-rootcopy_5.0-RECENT.xzm modules via my make-991-usr_local_bin.sh and make-992-rootcopy.sh module creation and updating via base/ script [*])
Sorry, but who cares, who should understand what happens in your system.
I think a howto should solve a general problem and not have a specific configuration on the subject.

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[HOWTO] Booting Porteus from USB tricks and tips

Post#7 by Rava » 17 Sep 2022, 19:36

itrukrakso wrote:
17 Sep 2022, 19:30
I think a howto should solve a general problem and not have a specific configuration on the subject.
Then provide the info. I provide what I use, others can provide what they use.

Added in 4 hours 55 minutes 44 seconds:
itrukrakso wrote:
17 Sep 2022, 19:30
Sorry, but who cares, who should understand what happens in your system.
Anyone can use the same method for his or her system as long as it's a BIOS system. Therefore my tip maybe not for you, but still it is for many people using BIOS systems, and why should I care if that not helps you anymore since you obnly use UEFI systems.
If you have no BIOS based system anymore, who cares. Why should I buy a UEFI system to experiment how it must be done for booting to fit your needs. I give advice for people with older systems, and that is fine for me. If you are unable to write a follow-up-post describing details on what to do and how to do it for an UEFI system: not my issue, and not the issue of anyone wanting to boot Porteus on a BIOS system.
This thread is meant as a collaboration, I can give advice as long as my own hardware is able to support that advice, I cannot speculate on something that I myself do not have. That's where people like you come in explaining details about specifics when using an UEFI system.
itrukrakso wrote:
17 Sep 2022, 19:30
If something is formatted with ext* it can only be booted with legacy bios.
UEFI needs a fat as 1st partition, otherwise it will not boot at all.
UEFI cannot boot anything that uses NTFS as 1st partition? Who would have guessed? I thought NTFS is the main way Windows sets up its partitions by default on a harddisk (including its 1st boot partition), now you tell me nowadays that is going back to using VFAT instead ?
Cheers!
Yours Rava

Post Reply