Installing just ESP/EFI to USB

When you run into problems installing MX Linux XFCE
Message
Author
User avatar
mxismythang
Posts: 40
Joined: Tue Nov 07, 2023 4:05 pm

Installing just ESP/EFI to USB

#1 Post by mxismythang »

I have a laptop (HP Elitebook 8xx G2) which supports M.2/NVMe, but not for booting, apparently: https://news.ycombinator.com/item?id=38106809. I am not confident in my ability to create a custom BIOS (https://winraid.level1techs.com/t/howto ... 30901/3292) to allow it, so I am looking at installing just the ESP/EFI partition to a USB drive.

Right now, I am just playing before I work with the real task of migrating the data from a spinning rust drive to the M.2/NVMe, which was purchased to squeeze more life from this laptop and save on heat and power use. (I used clonezilla first to move the data, before I found that the laptop simply refuses to boot from the new drive.)

However, with my novice skills, I have only succeeded in getting the system to boot when I also include `/boot` on the USB drive for some reason. I'm sure it's my naivete. When I tell the MX installer to create only the EFI partition on the USB drive with `/boot` & `/` on the nvme, I get an error that looks like the UUID of the drive isn't in FSTAB or is incorrect/mismatched.

What would be the most likely method to succeed here?

What I want:

Code: Select all

sda                                              7.5G  0 disk  
└─sda1                                           7.4G  0 part  /boot/efi
nvme0n1                                        467.9G  0 disk  
├─nvme0n1p1                                      499M  0 part  /boot
└─nvme0n1p2                                    467.4G  0 part  /
To get the QSI below, I copied the /boot partition from the M.2/NVMe to my USB, so you'll see that the M.2/NVMe has two partitions, as does the USB.

Code: Select all

System:
  Kernel: 6.1.0-17-amd64 [6.1.69-1] arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/vmlinuz-6.1.0-17-amd64 root=UUID=<filter> ro quiet splash
  Desktop: Xfce v: 4.18.1 tk: Gtk v: 3.24.36 info: xfce4-panel wm: xfwm v: 4.18.0 vt: 7
    dm: LightDM v: 1.26.0 Distro: MX-23.2_x64 Libretto January 21  2024 base: Debian GNU/Linux 12
    (bookworm)
Machine:
  Type: Laptop System: Hewlett-Packard product: HP EliteBook 840 G2 v: A3008D510B03
    serial: <superuser required> Chassis: type: 10 serial: <superuser required>
  Mobo: Hewlett-Packard model: 2216 v: KBC Version 96.5B serial: <superuser required>
    UEFI: Hewlett-Packard v: M71 Ver. 01.31 date: 02/24/2020
Battery:
  ID-1: BAT0 charge: 0.2 Wh (100.0%) condition: 0.2/0.2 Wh (100.0%) volts: 12.1 min: 11.4
    model: Hewlett-Packard Primary type: Li-ion serial: <filter> status: full
CPU:
  Info: model: Intel Core i5-5300U bits: 64 type: MT MCP arch: Broadwell gen: core 5 level: v3
    note: check built: 2015-18 process: Intel 14nm family: 6 model-id: 0x3D (61) stepping: 4
    microcode: 0x2F
  Topology: cpus: 1x cores: 2 tpc: 2 threads: 4 smt: enabled cache: L1: 128 KiB
    desc: d-2x32 KiB; i-2x32 KiB L2: 512 KiB desc: 2x256 KiB L3: 3 MiB desc: 1x3 MiB
  Speed (MHz): avg: 2750 high: 2888 min/max: 500/2900 scaling: driver: intel_cpufreq
    governor: ondemand cores: 1: 2724 2: 2888 3: 2695 4: 2695 bogomips: 18357
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: gather_data_sampling status: Not affected
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable
  Type: meltdown mitigation: PTI
  Type: mmio_stale_data status: Unknown: No mitigations
  Type: retbleed status: Not affected
  Type: spec_rstack_overflow status: Not affected
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, IBRS_FW, STIBP: conditional, RSB
    filling, PBRSB-eIBRS: Not affected
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort mitigation: Clear CPU buffers; SMT vulnerable
Graphics:
  Device-1: Intel HD Graphics 5500 vendor: Hewlett-Packard ZBook 15u G2 Mobile Workstation
    driver: i915 v: kernel arch: Gen-8 process: Intel 14nm built: 2014-15 ports: active: eDP-1
    empty: DP-1, DP-2, HDMI-A-1, HDMI-A-2 bus-ID: 00:02.0 chip-ID: 8086:1616 class-ID: 0300
  Device-2: Chicony HP HD Webcam type: USB driver: uvcvideo bus-ID: 2-7:6 chip-ID: 04f2:b477
    class-ID: 0e02 serial: <filter>
  Display: x11 server: X.Org v: 1.21.1.7 compositor: xfwm v: 4.18.0 driver: X:
    loaded: modesetting unloaded: fbdev,vesa dri: iris gpu: i915 display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 1366x768 s-dpi: 96 s-size: 361x203mm (14.21x7.99") s-diag: 414mm (16.31")
  Monitor-1: eDP-1 model: Samsung 0x4d42 built: 2014 res: 1366x768 hz: 60 dpi: 112 gamma: 1.2
    size: 309x174mm (12.17x6.85") diag: 355mm (14") ratio: 16:9 modes: 1366x768
  API: OpenGL v: 4.6 Mesa 22.3.6 renderer: Mesa Intel HD Graphics 5500 (BDW GT2)
    direct-render: Yes
Audio:
  Device-1: Intel Broadwell-U Audio vendor: Hewlett-Packard driver: snd_hda_intel v: kernel
    bus-ID: 00:03.0 chip-ID: 8086:160c class-ID: 0403
  Device-2: Intel Wildcat Point-LP High Definition Audio vendor: Hewlett-Packard
    driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:9ca0 class-ID: 0403
  API: ALSA v: k6.1.0-17-amd64 status: kernel-api tools: alsamixer,amixer
  Server-1: PipeWire v: 1.0.0 status: active with: 1: pipewire-pulse status: active
    2: wireplumber status: active 3: pipewire-alsa type: plugin 4: pw-jack type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Intel Ethernet I218-LM vendor: Hewlett-Packard driver: e1000e v: kernel port: 5060
    bus-ID: 00:19.0 chip-ID: 8086:15a2 class-ID: 0200
  IF: eth0 state: down mac: <filter>
  Device-2: Intel Wireless 7265 driver: iwlwifi v: kernel modules: wl pcie: gen: 1
    speed: 2.5 GT/s lanes: 1 bus-ID: 03:00.0 chip-ID: 8086:095a class-ID: 0280
  IF: wlan0 state: down mac: <filter>
Bluetooth:
  Device-1: Intel Bluetooth wireless interface type: USB driver: btusb v: 0.8 bus-ID: 2-4:4
    chip-ID: 8087:0a2a class-ID: e001
  Report: hciconfig ID: hci0 rfk-id: 1 state: up address: <filter> bt-v: 2.1 lmp-v: 4.0
    sub-v: 1000 hci-v: 4.0 rev: 1000
  Info: acl-mtu: 1021:5 sco-mtu: 96:6 link-policy: rswitch hold sniff
    link-mode: peripheral accept service-classes: rendering, capturing, object transfer, audio,
    telephony
Drives:
  Local Storage: total: 486.28 GiB used: 6.47 GiB (1.3%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung model: MZAL4512HBLU-00BL2 size: 476.94 GiB
    block-size: physical: 512 B logical: 512 B speed: 63.2 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: 7L1QHXC7 temp: 43.9 C scheme: MBR
  ID-2: /dev/sda maj-min: 8:0 type: USB model: USB DISK 2.0 size: 7.46 GiB block-size:
    physical: 512 B logical: 512 B type: N/A serial: <filter> rev: PMAP scheme: MBR
  SMART Message: Unknown USB bridge. Flash drive/Unsupported enclosure?
  ID-3: /dev/sdb maj-min: 8:16 type: USB vendor: Generic model: Flash Disk size: 1.88 GiB
    block-size: physical: 512 B logical: 512 B type: SSD serial: <filter> rev: 1.68 scheme: MBR
  SMART Message: Unknown USB bridge. Flash drive/Unsupported enclosure?
Partition:
  ID-1: / raw-size: 475.94 GiB size: 467.4 GiB (98.21%) used: 6.36 GiB (1.4%) fs: ext4
    dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-2: /boot raw-size: 1.49 GiB size: 1.45 GiB (97.18%) used: 109.4 MiB (7.4%) fs: ext4
    dev: /dev/sdb2 maj-min: 8:18
  ID-3: /boot/efi raw-size: 395 MiB size: 394.2 MiB (99.79%) used: 304 KiB (0.1%) fs: vfat
    dev: /dev/sdb1 maj-min: 8:17
Swap:
  Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: zram size: 256 MiB used: 0 KiB (0.0%) priority: 100 dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 44.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Repos:
  Packages: pm: dpkg pkgs: 2047 libs: 1045 tools: apt,apt-get,aptitude,nala,synaptic pm: rpm
    pkgs: 0
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list
    1: deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/debian.list
    1: deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
    2: deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/mx.list
    1: deb http://mirror.cedia.org.ec/mx-workspace/mx/repo/ bookworm main non-free
Info:
  Processes: 215 Uptime: 0m wakeups: 2 Memory: 15.03 GiB used: 1.19 GiB (7.9%) Init: SysVinit
  v: 3.06 runlevel: 5 default: graphical tool: systemctl Compilers: gcc: 12.2.0 alt: 12
  Client: shell wrapper v: 5.2.15-release inxi: 3.3.26
Boot Mode: UEFI

User avatar
fehlix
Developer
Posts: 12625
Joined: Wed Apr 11, 2018 5:09 pm

Re: Installing just ESP/EFI to USB

#2 Post by fehlix »

Maybe use the internal rotating drive for an ESP.
Alternatively, install normally on M.2/nvme and use external thump-drive with rEFInd usb image installed.
rEFInd comes/is available in the repos, but it may be easier, to grab the prepbuild rEFInd usb-image
from refind's homepage.
rEFInd will search of all efi loader and present a GUI to select, kind of a replacement of the internal UEFI boot menu.

User avatar
mxismythang
Posts: 40
Joined: Tue Nov 07, 2023 4:05 pm

Re: Installing just ESP/EFI to USB

#3 Post by mxismythang »

Will research this. TY for the tips.

User avatar
fehlix
Developer
Posts: 12625
Joined: Wed Apr 11, 2018 5:09 pm

Re: Installing just ESP/EFI to USB

#4 Post by fehlix »

mxismythang wrote: Fri Jul 12, 2024 1:33 pm Will research this. TY for the tips.
Nothing really to research.
Get latest rEFInd cd-iso or usb-image from rEFInd's sourceforge site

Code: Select all

https://sourceforge.net/projects/refind/files/0.14.2/
whith the usb-image: refind-flashdrive-0.14.2.zip/
and dump the usb-image to the usb-stick,
If you have an Ventoy-stick you can just copy the iso
found within refind-cd-0.14.2.zip to ventoy,
and boot with rEFInd with ventoy, so you can check whether rEFInd
recognizes the efi-grub loader on the nvme, which is probably the case.
PS:
In case the pc has a sd-card reader, you may try to dump the usb-image
onto an sd-card, the usb-image is just 7 MiB.
FWIW, my favorite iso/image -dumper tool is @BitJam's
command line dd-live-usb tool, pre-installed in MX Linux:
you can run it within the same directory the zip was extracted
and the image is located like:

Code: Select all

sudo dd-live-usb -f refind-flashdrive-0.14.2.img
and will offer you to select the detected usb-device to write the image onto.

User avatar
mxismythang
Posts: 40
Joined: Tue Nov 07, 2023 4:05 pm

Re: Installing just ESP/EFI to USB

#5 Post by mxismythang »

Thx for the suggestion, but rEFInd was unable to help. Said nothing bootable was found.

Back to my question, is it not possible to install MX linux in the way I am seeking to? I apologize for not grasping the technical landscape that includes the hurdle I am met with. If I can install the EFI partition on a HDD, I don't see why I can't do the same on a USB drive and then automatically continue booting from the nvme from there.

TIA!

User avatar
fehlix
Developer
Posts: 12625
Joined: Wed Apr 11, 2018 5:09 pm

Re: Installing just ESP/EFI to USB

#6 Post by fehlix »

mxismythang wrote: Sun Jul 14, 2024 11:09 am Thx for the suggestion, but rEFInd was unable to help. Said nothing bootable was found.
Sure, with no valid ESP on the M2/nvme, rEFInd won't find any efi-boot loader, to boot from.
mxismythang wrote: Sun Jul 14, 2024 11:09 am Back to my question, is it not possible to install MX linux in the way I am seeking to? I apologize for not grasping the technical landscape that includes the hurdle I am met with. If I can install the EFI partition on a HDD, I don't see why I can't do the same on a USB drive and then automatically continue booting from the nvme from there.
You can have an ESP on another drive, even in a USB-device. But it has to be an ESP not a cloned boot partition.
But before this, I would try whether the m.2/nvme drive is present to the boot facilities:
So, as already suggested, install e.g. entire drive.
Next, 1st simple test, reboot into LiveUSB and at the LiveBoot menu do select Boot Rescue -> search for efi-booloader,
if that works rEFInd should also work.
So try also
2nd again the same with rEFInd usb-stick.
And if both test shown you nvme drive is seen by efi and the ESP on the nvme can be used, you can also choose to use another ESP and re-install the efi-boot loader to any ESP on a thumbdrive.

User avatar
mxismythang
Posts: 40
Joined: Tue Nov 07, 2023 4:05 pm

Re: Installing just ESP/EFI to USB

#7 Post by mxismythang »

TY for the reply, and apologies for the delay in mine. I am traveling presently.
So, as already suggested, install e.g. entire drive.
Next, 1st simple test, reboot into LiveUSB and at the LiveBoot menu do select Boot Rescue -> search for efi-booloader
This test was not successful. It only located the LiveUSB.

Perhaps there's another route that can arrive at effectively the same result. The main reason/purpose for buying this NVMe was to help my GF with her identical laptop that has a 5400RPM HDD in it from 2015 or earlier. Her boot process takes >1min to arrive at login screen.

Is there a reliable method to move the majority of her data to the NVMe, including root and home, and just boot from the spinning rust? She performed her install with the "use entire disk" option on the HDD. Is there a way we can get her reading the HDD just for the bare essentials, and the rest of boot and data from the NVMe?

User avatar
fehlix
Developer
Posts: 12625
Joined: Wed Apr 11, 2018 5:09 pm

Re: Installing just ESP/EFI to USB

#8 Post by fehlix »

mxismythang wrote: Thu Jul 25, 2024 2:55 pm TY for the reply, and apologies for the delay in mine. I am traveling presently.
So, as already suggested, install e.g. entire drive.
Next, 1st simple test, reboot into LiveUSB and at the LiveBoot menu do select Boot Rescue -> search for efi-booloader
This test was not successful. It only located the LiveUSB.
Please be more specific, what the actual test was. You have not toldl us whether you actually installed entire drive on the NVME or somthing else
mxismythang wrote: Thu Jul 25, 2024 2:55 pm Perhaps there's another route that can arrive at effectively the same result. The main reason/purpose for buying this NVMe was to help my GF with her identical laptop that has a 5400RPM HDD in it from 2015 or earlier. Her boot process takes >1min to arrive at login screen.

Is there a reliable method to move the majority of her data to the NVMe, including root and home, and just boot from the spinning rust? She performed her install with the "use entire disk" option on the HDD. Is there a way we can get her reading the HDD just for the bare essentials, and the rest of boot and data from the NVMe?
This was already mentioned or at least partially:
Convert the HDD in a GPT or wipe an d recreate drive as GPT
(this will wipe the HDD drive when creating a new partition table)
and create with Gparted one ESP on the HDD, fat32 size 512Mib, mark as "esp,boot"
Now install again but select with the installer the ESP on the HDD.
In case EFI loader on the HDD, still can't find the NVME,
You can do the next step,
and create in addition to the ESP also a boot partition on the HDD,
min size about 1GiB , format ext4.
Now install again but select both ESP and boot on the HDD
root, and home on the NVME.
Note: Do this, and please report what you actually have done, not just only kind of "Did not work".
Thanks

User avatar
FullScale4Me
Posts: 1033
Joined: Fri Jan 08, 2021 11:30 pm

Re: Installing just ESP/EFI to USB

#9 Post by FullScale4Me »

I have been looking at your PC's manual - HP EliteBook 840 G2 Notebook PC - Maintenance and Service Guide 6 MB PDF

Of note is the "Computer Setup (BIOS), MultiBoot, and HP PC Hardware Diagnostics (UEFI)" specifically the "Using MultiBoot" section on page 125.

Further down on page 125 in the section "Setting a new boot order in Computer Setup" ensure that "Advanced > Boot Options > UEFI Boot Order > UEFI Native Boot mode" is chosen and saved ( click the Save icon in the lower-left corner of the screen) as the normal setting.
Michael O'Toole
MX Linux facebook group moderator
Dell OptiPlex 7050 i7-7700, MX Linux 23 Xfce & Win 11 Pro
HP Pavilion P2-1394 i3-2120T, MX Linux 23 Xfce & Win 10 Home
Dell Inspiron N7010 Intel Core i5 M 460, MX Linux 23 Xfce & KDE, Win 10

Post Reply

Return to “Installation”