Booting from usb bootable partition

I have been trying to setup a bootable usb partition, and managed to burn the PureOS 8 ISO on a 4gb partition on my 124 gb per drive. I want to keep the remaining 120 gb for system backups.

When I restart my Librem 15v3, the usb appears on the boot menu but each time I select it it goes to the blue screen payload memory test. I am just unable to get it boot from the usb to test my PureOS live installation.

am I missing something?

[EDIT]
I get the boot device menu as shown on these screenshots, but not the subsequent boot menu.

[SOLVED]
Found a way to achieve this in my last post on this thread

How do you create a bootable USB drive?

I use GNOME disk,

  • created an ext4 partition (4GB)
  • edit partition and make it bootable
  • edit partition and select restore partition image (SO) and used PureOS 8.0 beta 1 download.

I tried instead to create a single partition on the entire disk, LUKS + ext4 bootable, and this time the Boot device menu seems to recognise the bootable USB, however it freezes as it did not ask me to enter my passphrase to unlock /read the encrypted partition, so I assume it gets stuck trying to read the files.

So instead I deleted all partitions, and tried the approach in the documentation to Restore the disc image instead.

It creates a 1.5 gb partition of type Hidden HPFS/NTFS (Bootable).

It is now able to boot into the live USB, however the live device mount is read only.

I tried to use the remaining free space on the usb to create an encrypted LUKS + ext4 partition, but no luck, I keep getting some error when trying to mount it.

Here is what I am trying to achieve:

I wish to use my 124gb pen drive as a backup and rescue device.

Librem is unable to boot from an encrypted usb bootable disk/partition.

I was hoping that I could create a non-encrypted usb bootable partition on the drive, along with an encrypted partition in the remaining space.

I could then backup my system on the encrypted partition, and boot from the bootable partition to restore my system in case of any issues.

Is this possible?

Unable to get any usb partitions to boot on Librem, tried with gpt disk format and that too get stuck at boot time.

Finally after much reading around and many many restarts, I followed the advice of an Ubuntu forum user to install linux on a usb drive from a live CD.

So created a bootable usb using PureOS and the default procedure (Restone disk image…), booted from that usb (a spare 8Gb usb pen drive I has lying around) and proceeded to install PureOS onto my 124Gb USB drive,

I now have a bootable encrypted PureOS pen drive. However it is not a live installation which I can install on my laptop SSD. So I copied the ISO image I used for the installation onto my USB drive too.

I am now configuring my backups (main laptop drive) to save on the USB stick.

In case of a major issue, I can boot from my USB, setup a live CD/USB from the saved ISO, reinstall my laptop and finally update to backed up date on the new installation.

I will do some more experiments on this and report back on a different thread.

Bottom line, making a bootable usb encrypted partition is possible but it needs to be installed rather than using the ‘Restore Partition Image’ facility from GNOME disk

Finally found an answer after some creative googling.

There are 2 important pieces of information one needs to understand about why this works. The first is about the boot process and how the initial power on self test (executed by the BIOS) looks for a boot record on the first boot sector of the devices attached. This is a small file which basically passes the boot execution process onto the boot loader/manager such as GRUB2 on newer linux installs. For more information on this, read this very informative post.

The 2nd piece of information is to understand that the ISO downloads for Linux OSes are designed to be installed on a disk (CD/DVD/USB) and not for a partition. These ISOs need to be modified using a small tool which can be found on the syslinux-utils package, called isohybrid. The ISO modification for installation on a partition is done with the --partok flag. I found this information from this post which describes the exact same issue.
I am not sure how the --partok magic works, I searched for some explanation but could not find any.

In summary, here is what I did to get my live PureOS install to boot from a usb partition,

  1. Partitioned my USB using GNOME disk, I initially formatted the disk using MBR/DOS. I created a 4GB partition (FAT32) followed by a an ext4 linux partition in the remaining space for my backups.
  2. Next I modified the ISO file I downloaded to make it bootable from the partition. To do this I had to install the syslinux-util from my repo sudo apt-get install syslinux-util in which the isohydrid tool resides. I then modified the ISO file, isohybrid --partok pureos.ISO
  3. I used dd to copy this ISO to the above partition. You can get the partition device from the GNOME disk details. dd if=pureos.ISO of=/dev/sdb1 bs=1M.
  4. from GNOME disk I edited the partiton and checked the Bootable option which installs the required book record.

I was now able to boot from the USB key into the live CD and use it as a recovery solution while storing my system backups on the other partition.

2 Likes

You can also install the system on the pendrive as if it were a hard drive, you will need a pendrive to use it as live-cd and the other one where you want to install the system.

Make in it all partitions, install grub, software…

I made this to install Debian Gnome and use it as portable system.

Hey @uzanto,
sure that’s what I use to do with with my small pen drives. Actually my ultimate goal is a Backup & Rescue solution that fits onto a 124 Gb pen-drive.

So my idea is a live cd on a small partition (4Gb) and a backup partiton (encrypted) on the remaining 120 Gb of space.

So this is the first step which I have to admit I struggled a wee bit to get it working.

Now I am experimenting various backup solutions… which I will share in a separate thread eventually.