[syslinux] extlinux troubles....

Somchai Smythe buraphalinuxserver at gmail.com
Sun Nov 11 22:23:37 PST 2018

1. ext4
mke2fs -b 4096 -m 5 -t ext4 -O^uninit_bg -r 1 -v /dev/sdb1
sdparm --command=sync /dev/sdb
2. 150G
3. gdisk /dev/sdb
sdparm --command=sync /dev/sdb
4. mount /dev/sdb1 /mnt/sdb1
cd /mnt/sdb1
extlinux -i /mnt/sdb1/boot
umount /mnt/sdb1
sdparm --command=sync /dev/sdb
cat gptmbr.bin >/dev/sdb1
sdparm --command=sync /dev/sdb
   setup up a hard link too
   cd /mnt/sdb1/boot;ln extlinux.conf syslinux.conf
6. Yes, this machine is ancient and has never been booted in EFI mode.

I checked the documentation, which does not cover my use case (install
from sda to sdb, then boot that sdb as sda later).

And before you ask, the messages from the system as it is now are
(this is all in text mode):

SYSLINUX 4.07 EDD 2013-07-25 Copyright (C) 1994-2013 H. Peter Anvin et al
ERROR: No configuration file found
No DEFAULT or UI configuration directive found!

If I type in a directory name like boot or bin, it says
Invalid or corrupt kernel image

If I type in a file name, it says
Could not find kernel image

The kernel really is at /boot/vmlinuz-4.19, and I re-mounted /dev/sdb1
from a boot off of /dev/sda to check this.

I am trying to verify either that it is impossible to install extlinux
to /dev/sdb from /dev/sda and then later boot that /dev/sdb as
/dev/sda using extlinux, or get working instructions to do it.

On 11/9/18, Ady Ady via Syslinux <syslinux at zytor.com> wrote:
>> Hello List Members,
>> I have a machine that has used extlinux to boot for many years, but
>> the hard disk needs to be replaced.  I got a new hard disk and
>> installed it in my system.  The old disk is /dev/sda, and the new one
>> is /dev/sdb.  I'm using GPT partitioning, and I did (after a day)
>> finally get the legacy bootable flag set on /dev/sdb for the boot
>> partition /dev/sda1.  I then formatted out the /dev/sdb partitions and
>> copied all the data from /dev/sda to /dev/sdb.  So far, so good.
>> It appears, however, to be impossible (for me) to install extlinux
>> from /dev/sda to /dev/sdb and then remove the old disk and boot the
>> new one as /dev/sda.
>> Surely it must be possible, but it comes up with a message telling me
>> it cannot find the config file and that DEFAULT and UI are not set.
>> If I try typing in stuff at the 'boot:' prompt, nothing really works.
>> It shows a version banner once before the error about the config file,
>> but says SYSLINUX instead of EXTLINUX, it's in text mode, and
>> basically it cannot access the /boot partition where everything is.  I
>> tried every combination of path to the kernel I could think of (it's
>> really in /boot/vmlinuz-4.19) without success.  I tried both
>> extlinux.conf and syslinux.conf names but it just doesn't find them.
>> If I put the old disk back in, reboot the machine from the old disk,
>> mount the new disk, everything is there.  I tried mounting directly
>> and installing extinux, and also mounting through a loopback device
>> and installing extlinux, but it always says /dev/sdb in the message
>> when I run the extlinux utility, and I wonder if the poor software
>> somehow just doesn't "adapt" to being /dev/sda once the old /dev/sda
>> is removed.  It seems like it's hard-coded itself to only work if it
>> is /dev/sdb, and it won't be that when it's the only hard disk.
>> Clearly I'm doing it wrong.  I tried for days hunting with search
>> engines but couldn't find anything.  Everybody was booting on USB or
>> DVD and installing extlinux on a drive that was /dev/sda (or /dev/hda
>> for some old posts).  Do I really have to build and burn a bootable
>> DVD just to install extlinux (by ensuring the new drive really is
>> /dev/sda at the time I run extlinux)?
>> My old boot system does not use an initrd, and since I copied
>> everything from that disk, I believe the kernel, modules, firmware,
>> etc. should all be fine.
>> I hope somebody on this list has done this before and can tell me what
>> I need to do to get this working.  It is syslinux version 4.07 if that
>> matters.
> From your description, several minor (yet, important) details are probably
> slightly
> wrong. They are either typos in your description, or you just wrote "in a
> rush" (without
> paying so much attention to some of the details you were writing about), or
> you are
> actually mixing up things (e.g. "sda" vs. "sda1", or "syslinux.cfg" vs.
> "extlinux.conf").
> So, here are some questions for you...
> 0_ You mentioned that you copied from one HDD to the other. Was this action
> performed
> after you installed the bootloader in your new HDD, or was it performed
> before it? Which
> kind of transfer did you perform, from the "whole sda to sdb", or from "file
> to file", or
> from one filesystem volume to another (e.g. sda1 to sdb1)?
> 1_ Which filesystem did you use to format "sdb1"? Which specific version of
> the relevant
> "mkfs" command have you used? Could you post the exact complete command?
> 2_ Would you please provide the size of sdb1?
> 3_ When you say that you set the boot flag, would you please post the exact
> command /
> steps you used in order to achieve it?
> 4_ Which _exact_ commands did you use in order to install the bootloader?
> What about the
> command for gpt.bin?
> 5_ Would you please double-check the _exact_ name of your configuration
> file, and its
> exact location (i.e. partition and complete path)? Would you please also
> provide the
> exact location and name of your kernel(s)? To be clear, I am not asking
> about the paths
> you might be using when mounting filesystems within your current OS, but the
> paths in
> relation to the root of the volume where you are attempting to install the
> bootloader and
> in which you should put your kernel(s).
> 6_ You mentioned GPT. Are you sure you are booting in BIOS mode?
> Finally, you say you have read about other scenarios. Have you actually
> checked the
> official Syslinux wiki? The "Install" page comes to mind as a relevant
> target, among
> others.
> Regards,
> Ady.
> _______________________________________________
> Syslinux mailing list
> Submissions to Syslinux at zytor.com
> Unsubscribe or set options at:
> http://www.zytor.com/mailman/listinfo/syslinux

More information about the Syslinux mailing list