0

I've installed Manjaro on a USB stick to carry with me. However, I can boot from it only on the machine I used to install. On other PCs, the BIOS or UEFI does not recognize the drive as bootable.

The device /dev/sda has a single partition /dev/sda1 formatted as ext4. There is a /boot/ directory there, with /boot/initramfs-6.5-x86_64.img and other files there. The partition has the boot flag.


$ mount displays the following:

proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=8158880k,nr_inodes=2039720,mode=755,inode64)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755,inode64)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
/dev/sda1 on / type ext4 (rw,noatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=36,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=14490)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,nosuid,nodev,relatime,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,size=8175772k,nr_inodes=1048576,inode64)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1635152k,nr_inodes=408788,mode=700,uid=1000,gid=1001,inode64)
portal on /run/user/1000/doc type fuse.portal (rw,nosuid,nodev,relatime,user_id=1000,group_id=1001)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1001)

$ df -Th shows

Filesystem     Type      Size  Used Avail Use% Mounted on
dev            devtmpfs  7.8G     0  7.8G   0% /dev
run            tmpfs     7.8G  1.5M  7.8G   1% /run
/dev/sda1      ext4      458G  103G  332G  24% /
tmpfs          tmpfs     7.8G     0  7.8G   0% /dev/shm
tmpfs          tmpfs     7.8G   96K  7.8G   1% /tmp
tmpfs          tmpfs     1.6G  132K  1.6G   1% /run/user/1000

# blkid (with elevated privileges) returns

/dev/sda1: UUID="419d4f22-7fd6-42ea-a273-4e54028197ce" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="b1e4001d-01"

# fdisk -l /dev/sda reports

Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: SSD 870 EVO 500G
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33553920 bytes
Disklabel type: dos
Disk identifier: 0xb1e4001d

Device     Boot Start       End   Sectors   Size Id Type
/dev/sda1  *     2048 976773119 976771072 465.8G 83 Linux

Finally, if it's even relevant, # gdisk -l /dev/sda writes

GPT fdisk (gdisk) version 1.0.9.1

Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: not present


***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. 
***************************************************************

Disk /dev/sda: 976773168 sectors, 465.8 GiB
Model: SSD 870 EVO 500G
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): DC55B4BD-D878-4752-9414-E4CE82C33258
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2029 sectors (1014.5 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048       976773119   465.8 GiB   8300  Linux filesystem

Now, how do I make the USB stick more portable? Does it worth converting MBR to GPT, as described here? I'd prefer not to re-install the OS.


Edit: As I'm using the USB stick right now, I can't test any propositions right away. I'll do my best to try them within 24 hours.

2
  • Do the other PCs have "BIOS compatibility" / "CSM" mode enabled or not? There could be several whys but that's the major one. Commented Feb 7 at 9:52
  • @u1686_grawity, thanks, I'll take a look. I haven't noticed such a line in the interface. As a side note, as I'm using the USB stick right now, I can't test the propositions right away. I'll mark that in the question.
    – StSav012
    Commented Feb 7 at 9:57

2 Answers 2

2

Most likely your other PCs have UEFI without the BIOS-compatibility feature (either because it was disabled out-of-the-box, or because it's outright no longer supported with certain modern systems).

The "working" PC was booting the USB stick in BIOS mode (UEFI-style firmwares call it "legacy mode" or "CSM mode") because that's the only mode that your drive currently contains boot code for. That works because BIOS boot never looks into any filesystems at all; it loads the bootloader from specific sectors directly.

UEFI will never recognize that drive as natively bootable, because the drive does not have any partitions with a compatible filesystem that could stand in for the EFI System Partition.

For native UEFI boot, the drive doesn't necessarily need to be GPT-partitioned, but it does need to have a FAT32 partition from which the firmware could load a BootX64.efi file which is your bootloader. (Some PCs can also read NTFS or exFAT, but the standard UEFI filesystem – and the only guaranteed to work filesystem – is FAT32.)

This serves a roughly similar purpose to having a separate /boot partition (when the real root filesystem is too complex for the bootloader); indeed it often is mounted at /boot, or sometimes at /efi.

So your steps would be:

  1. Repartition it to have a small FAT32 partition (at least 2x the current total size of your /boot files) alongside the existing one. During a fresh install it traditionally goes at the beginning, but it can as well be placed at the end.

    • If you keep MBR partitioning, the partition's type in fdisk should be set to EF.

    • If you decide to use gdisk to convert to GPT partitioning, the type in gdisk should be EF00 (gdisk's abbreviation for the actual EFI GUID).

  2. Move all files from your current /boot to the new partition, and configure it to be mounted at /boot via /etc/fstab.

  3. Install an UEFI-compatible bootloader at EFI\BOOT\bootx64.efi in the new partition (that is, /boot/EFI/boot/bootx64.efi from Linux point of view).

    For example, with GRUB, specify --target=x86_64-efi as well as --removable to place the .efi file where UEFI will expect it. With systemd-boot, both are already the default.

2

UEFI cannot boot from an ext4 filesystem.

Your USB stick needs to have an EFI System Partition formatted with a FAT filesystem.

The systems that boot ext4 successfully are either Legacy BIOS-based or have CSM enabled.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .