You are not logged in.

#1 2019-04-06 18:39:32

Roken
Member
From: South Wales, UK
Registered: 2012-01-16
Posts: 1,251

[SOLVED] Dynamic USB install boot

I'm struggling with this.I have a 120Gb Sandisk USB stick, and want to get a full Arch install onto it, so that it's portable to any machine with a USB slot.

I've installed the system (to an extent - I have a booting desktop, no login etc.) installed using qemu, and it boots in the VM just fine.

However, booting in a live system is problematic. I tried GRUB first, and then syslinux, and both have the same problem (however I set them up).

After the kernel loads, neither can find rootfs. I can't use /dev/sdX, since this can change dynamically. UUID fails with not found, and on syslinux, even trying using the LABEL fails.

Is there a kernel hook or something that I need to have the USB thumb partitions recognised?

Last edited by Roken (2019-04-08 05:35:04)


Ryzen 5900X 12 core/24 thread - RTX 3090 FE 24 Gb, Asus Prime B450 Plus, 32Gb Corsair DDR4, Cooler Master N300 chassis, 5 HD (1 NvME PCI, 4SSD) + 1 x optical.
Linux user #545703

Offline

#2 2019-04-06 19:30:23

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: [SOLVED] Dynamic USB install boot

Hello again Roken, fancy meeting you here smile

I've just installed Arch on a USB stick (non-UEFI) and it booted fine with no changes to the mkinitramfs hooks.

Roken wrote:

After the kernel loads, neither can find rootfs

Which filesystem have you used on the USB stick?

Is this for a UEFI or non-UEFI installation? Or both?

Which commands did you use to install the bootloader?

You should probably post your configuration files as well.

Offline

#3 2019-04-06 23:28:47

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Dynamic USB install boot

Have you followed all of the relevant instructions...

https://wiki.archlinux.org/index.php/In … e_machines


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#4 2019-04-07 20:11:58

Roken
Member
From: South Wales, UK
Registered: 2012-01-16
Posts: 1,251

Re: [SOLVED] Dynamic USB install boot

The filesystem is ext4, with a 2GB swap partition.

@Slithery - it is a USB 3 drive. but the same problem occurs in a USB 2 port, so whilst I have set it up for USB 3 boot, that doesn't seem to be the problem. syslinux will load and presents the menu, but when I try to boot, I get the "Waiting for 10 seconds for disk....", and whether I use /dev/sdX, UUID or LABEL, it fails and dumps me to en emergency recovery (which is useless because my keyboard shuts down at this point).

At the moment, it's set up as BIOS boot only, since UEFI can boot legacy BIOS, though perhaps I should set it up for both and see if it helps. I've tested on my laptop (BIOS only) with the same result.


Ryzen 5900X 12 core/24 thread - RTX 3090 FE 24 Gb, Asus Prime B450 Plus, 32Gb Corsair DDR4, Cooler Master N300 chassis, 5 HD (1 NvME PCI, 4SSD) + 1 x optical.
Linux user #545703

Offline

#5 2019-04-07 20:27:13

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,466

Re: [SOLVED] Dynamic USB install boot

Are you booting the fallback initramfs?

Online

#6 2019-04-07 20:48:45

Roken
Member
From: South Wales, UK
Registered: 2012-01-16
Posts: 1,251

Re: [SOLVED] Dynamic USB install boot

Nope - the main install.

For info, syslinux.cfg

# Config file for Syslinux -
# /boot/syslinux/syslinux.cfg
#
# Comboot modules:
#   * menu.c32 - provides a text menu
#   * vesamenu.c32 - provides a graphical menu
#   * chain.c32 - chainload MBRs, partition boot sectors, Windows bootloaders
#   * hdt.c32 - hardware detection tool
#   * reboot.c32 - reboots the system
#
# To Use: Copy the respective files from /usr/lib/syslinux to /boot/syslinux.
# If /usr and /boot are on the same file system, symlink the files instead
# of copying them.
#
# If you do not use a menu, a 'boot:' prompt will be shown and the system
# will boot automatically after 5 seconds.
#
# Please review the wiki: https://wiki.archlinux.org/index.php/Syslinux
# The wiki provides further configuration examples

DEFAULT arch
PROMPT 1        # Set to 1 if you always want to display the boot: prompt
TIMEOUT 50
# You can create syslinux keymaps with the keytab-lilo tool
#KBDMAP de.ktl

# Menu Configuration
# Either menu.c32 or vesamenu32.c32 must be copied to /boot/syslinux
UI menu.c32
#UI vesamenu.c32

# Refer to http://syslinux.zytor.com/wiki/index.php/Doc/menu
MENU TITLE Arch Linux
#MENU BACKGROUND splash.png
MENU COLOR border       30;44   #40ffffff #a0000000 std
MENU COLOR title        1;36;44 #9033ccff #a0000000 std
MENU COLOR sel          7;37;40 #e0ffffff #20ffffff all
MENU COLOR unsel        37;44   #50ffffff #a0000000 std
MENU COLOR help         37;40   #c0ffffff #a0000000 std
MENU COLOR timeout_msg  37;40   #80ffffff #00000000 std
MENU COLOR timeout      1;37;40 #c0ffffff #00000000 std
MENU COLOR msg07        37;40   #90ffffff #a0000000 std
MENU COLOR tabmsg       31;40   #30ffffff #00000000 std

# boot sections follow
#
# TIP: If you want a 1024x768 framebuffer, add "vga=773" to your kernel line.
#
#-*

LABEL arch
    MENU LABEL Arch Linux
    LINUX ../vmlinuz-linux
    APPEND root=LABEL=ARCHSTICK rw earlymodules=xhci_hcd modules-load=xhci_hcd
    INITRD ../initramfs-linux.img

LABEL archfallback
    MENU LABEL Arch Linux Fallback
    LINUX ../vmlinuz-linux
    APPEND root=LABEL=ARCHSTICK rw
    INITRD ../initramfs-linux-fallback.img

#LABEL windows
#        MENU LABEL Windows
#        COM32 chain.c32
#        APPEND hd0 1

LABEL hdt
        MENU LABEL HDT (Hardware Detection Tool)
        COM32 hdt.c32

LABEL reboot
        MENU LABEL Reboot
        COM32 reboot.c32

LABEL poweroff
        MENU LABEL Poweroff
        COM32 poweroff.c32

Which is pretty much default, except I have LABEL used here and added the USB xhci.


Ryzen 5900X 12 core/24 thread - RTX 3090 FE 24 Gb, Asus Prime B450 Plus, 32Gb Corsair DDR4, Cooler Master N300 chassis, 5 HD (1 NvME PCI, 4SSD) + 1 x optical.
Linux user #545703

Offline

#7 2019-04-07 20:49:37

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,466

Re: [SOLVED] Dynamic USB install boot

That could very easily be your problem, then. The autodetect hook makes it so the initramfs isn't portable.

Online

#8 2019-04-07 21:59:05

Roken
Member
From: South Wales, UK
Registered: 2012-01-16
Posts: 1,251

Re: [SOLVED] Dynamic USB install boot

You mean the xhci? I've tried with and without. no change.


Ryzen 5900X 12 core/24 thread - RTX 3090 FE 24 Gb, Asus Prime B450 Plus, 32Gb Corsair DDR4, Cooler Master N300 chassis, 5 HD (1 NvME PCI, 4SSD) + 1 x optical.
Linux user #545703

Offline

#9 2019-04-08 00:18:37

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,466

Re: [SOLVED] Dynamic USB install boot

No, that has nothing to do with what I said. I'm talking about the initramfs.

Online

#10 2019-04-08 01:56:20

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,452
Website

Re: [SOLVED] Dynamic USB install boot

What is in your mkinitcpio.conf?  If you followed the directions Slithery linked you to, the autodetect hook would not result in this problem.  But if you did follow them, your keyboard would also work - so I suspect you didn't actually follow Slithery's link at all.

On a bit of a tangential note, a swap partition of a flash drive sounds like a bad idea to me.  If you are using machines that will need swap, you may be best having that as an additional small flash drive so you can toss it out and replace it as needed.

Last edited by Trilby (2019-04-08 01:57:54)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#11 2019-04-08 05:34:43

Roken
Member
From: South Wales, UK
Registered: 2012-01-16
Posts: 1,251

Re: [SOLVED] Dynamic USB install boot

There are none so blind as those who will not see.

Thanks, guys. I missed the bit about the hooks. Now fixed and working.


Ryzen 5900X 12 core/24 thread - RTX 3090 FE 24 Gb, Asus Prime B450 Plus, 32Gb Corsair DDR4, Cooler Master N300 chassis, 5 HD (1 NvME PCI, 4SSD) + 1 x optical.
Linux user #545703

Offline

Board footer

Powered by FluxBB