[syslinux] Can USBstikA boot USBstkB ?!

Didier Spaier didier at slint.fr
Wed Jun 14 08:53:42 PDT 2017


[quoted lines from Ady Ady]:

> At this time, Syslinux by itself cannot boot files located on a 
> different filesystem volume.
> Using chain.c32, you can load a boot sector (MBR or VBR) located on 
> another device. Since the list of files located in your boot stick did 
> not include chain.c32, my assumption (and not only mine, if you 
> carefully read some of the prior replies) is that the relevant "old" 
> files (e.g. kernel, initrams, etc.) were also located in the same old 
> (stolen) boot stick (while your root partition might have been located 
> on a different device).
> 
> But, since you have not provided any relevant information (not even the 
> content of your old syslinux.cfg nor how exactly you were "editing" 
> your boot entries so as to boot some/one OS or another), the above 
> paragraphs are only assumptions. In a similar way, prior replies to you 
> were also theoretical and very generic.
> 
> For example, your old Slackware's kernel (+ initrd files) might had 
> been located in the same boot stick, and the boot command _might_ had 
> included some indication for the kernel (+ initrd) to find the "root" 
> partition (e.g. root=/dev/hdb5 or something else). But, as I tried to 
> explain before, this "hdb5" varies depending on the BIOS; in other 
> words, it is not always "portable" when changing connections or when 
> moving to another PC.

Maybe I can try to shed some light here.

The files listed in the "old" USB are probably written by this script:
http://ftp.slackware.com/pub/slackware/slackware-14.1/source/a/pkgtools/scripts/setup.80.make-bootdisk
or similar, which is intended to write a bootable USB stick to be used in
case of emergency, e.g. if for some reason the installed system can not
be booted by the regular bootloader.

Here is the content of the only partition on boot script after having run
the script:
---
root[/mnt]# tree
.
├── EFI
│   └── BOOT
│       ├── BOOTX64.EFI
│       ├── elilo.conf
│       └── message.txt
├── f1.txt
├── ldlinux.sys
├── message.txt
├── syslinux.cfg
└── vmlinuz
---
And:
---
root[/mnt]# cat syslinux.cfg 
default vmlinuz root=/dev/sdb2 vga=normal ro
prompt 1
timeout 6000
display message.txt
F1 f1.txt
F2 message.txt
#F3 f3.txt
#F4 f4.txt
#F5 f5.txt
#F6 f6.txt
#F7 f7.txt
label mount
  kernel vmlinuz
  append root=/dev/sdb2 vga=normal ro
---
And:
---
root[/mnt]# cat message.txt

Welcome to the Slackware Linux custom USB boot stick!

By default, this stick boots a root Linux partition on /dev/sdb2 when you
hit ENTER.  If you'd like to boot some other partition, use a command like
this on the prompt below:

    mount root=/dev/sda1 ro

Where "/dev/sda1" is the partition you want to boot, and "ro" specifies that
the partition should be initially mounted as read-only.  If you wish to mount
the partition read-write, use "rw" instead.  To set the video console mode,
use the vga= parameter (press F1 to see a table).  You may also add any other
kernel parameters you might need depending on your hardware, and which
drivers are included in your kernel.
---

So there is just a kernel to boot and indeed no chain.c32.

Please note that there is no "rootdelay" or "rootwait" kernel parameter
by default.

In some cases (e.g. USB connected hard disk) this can result in a not
ready root partition when it's needed in the boot sequence.

So the intended usage of the boot stick is:
_ plug in the stick and (re)boot
_ (this displays message.txt)
_ the user can then edit the command line...
_ then press [Enter]

So IMHO this *should* allow to boot a system whose root partition is on
an USB stick, provided that:
_ the kernel (vmlinuz) written on the USB stick include the neede
  drivers (I am not sure that it be the case for the version used by the
  OP), as the stick does not include an initramfs with the relevant
  modules,
_ the root partition's name be correct,
_ possibly a "rootdelay" or "rootwait" kernel parameter  be appended to
  the command line.

Didier

PS I see that the content of the USB stick and of message.txt posted by
the OP differ from what I posted. I don't know why, but I don't think
that changes the big picture.

To answer a question from the OP: yes, all Slackware installers ship
the lsblk command. This not too heavy ISO image also does, so you can
use it for that:
http://slint.fr/testing/fake_slackware64-14.2-2.iso
To check its integrity:
http://slint.fr/testing/fake_slackware64-14.2-2.iso.md5
Signatures:
http://slint.fr/testing/fake_slackware64-14.2-2.iso.asc
http://slint.fr/testing/fake_slackware64-14.2-2.iso.md5.asc
My public key is attached.

 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0x60C03EEA.asc
Type: application/pgp-keys
Size: 1718 bytes
Desc: not available
URL: <http://www.zytor.com/pipermail/syslinux/attachments/20170614/ff197b95/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://www.zytor.com/pipermail/syslinux/attachments/20170614/ff197b95/attachment.sig>


More information about the Syslinux mailing list