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 x a 2 w y sdparm --command=sync /dev/sdb 4. mount /dev/sdb1 /mnt/sdb1 cd /mnt/sdb1 extlinux -i /mnt/sdb1/boot umount /mnt/sdb1 sync;sync;sync sdparm --command=sync /dev/sdb cat gptmbr.bin >/dev/sdb1 sync;sync;sync sdparm --command=sync /dev/sdb 5./mnt/sdb1/boot/extlinux.conf 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! boot: 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 >
About point "0", no answer(?). If you perform the commands to install the bootloader on sdb(1) and _then_ you overwrite the files/blocks when you copy from sda(1), you are effectively cancelling the installation of the bootloader.> 1. ext4 > mke2fs -b 4096 -m 5 -t ext4 -O^uninit_bg -r 1 -v /dev/sdb1 > sdparm --command=sync /dev/sdbI asked you for the version of mkfs too, and there is a reason. See: www.syslinux.org/wiki/index.php/Filesystem#ext> 2. 150G > 3. gdisk /dev/sdb > x > a > 2 > w > y > sdparm --command=sync /dev/sdbBy any chance, is this new HDD a "4k-only" (or similar) device (i.e. strictly 4096 bytes per sector)? Or, instead, is it capable of showing/working as a 512-bytes per sector device?> 4. mount /dev/sdb1 /mnt/sdb1 > cd /mnt/sdb1 > extlinux -i /mnt/sdb1/bootYou haven't posted the command that creates the "boot" directory under "sdb1". Was this directory actually created? You seem to be using "/mnt/sdb1/" as working directory when you execute the installer, and you unmount it while in such status. Additionally, I would suggest, again, to read the official wiki, where the suggested directory to installing EXTLINUX (SYSLINUX), especially for troubleshooting, is not (just) "boot". Have you attempted creating a directory such as "/mnt/sdb1/boot/extlinux/"? Have you tried installing the bootloader on such directory (instead of "boot")? See: www.syslinux.org/wiki/index.php/Install> umount /mnt/sdb1 > sync;sync;sync > sdparm --command=sync /dev/sdb > cat gptmbr.bin >/dev/sdb1Using CAT is not the best method when troubleshooting. Unmount everything under "sdb" and/or" "sdb1" and use "dd". See: www.syslinux.org/wiki/index.php/Mbr#Write (remember to use the correct "*mbr*.bin" file)> sync;sync;sync > sdparm --command=sync /dev/sdb > 5./mnt/sdb1/boot/extlinux.conf > setup up a hard link too > cd /mnt/sdb1/boot;ln extlinux.conf syslinux.confFor troubleshooting purposes, I would suggest avoiding the use of (hard/soft/whatever) links, if they are not essential at this stage. Once all works as expected, you can add complexities. Additionally, I remind you, again, that "syslinux.conf" is not the correct name (there should be no letter "o" there).> 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).You keep saying that you install "from sda to sdb", but according to the steps you posted you don't seem to be working specifically from "sda"; only _you_ might perhaps know where the "extlinux" command is executed from.> > 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! > boot:"ERROR: No configuration file found" "hints" (with a caveat, keep reading) that the directory to which EXTLINUX is initially booting in/to (i.e. the working directory at boot time) does not really contain "extlinux.conf" nor "syslinux.cfg". OTOH, this "hint" is particularly relevant when using the "recommended" installation directories, and not so much when using other installation directories.> > 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 imageSyslinux has no way to understand that you are typing a directory, or a file name, or whatever. I don't know what you are trying to achieve with such action(s).> > 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.Perhaps you should copy "ls.c32", "pwd.c32", "rosh.c32", and even all the c32 modules, to the same location where you are installing the bootloader. When you see "ERROR: No configuration file found", you could try typing: boot: ls.c32 [enter] boot: pwd.c32 [enter] boot: linux.c32 /absolute/path/to/your/kernel There is a chance that such investigations could provide some clues. At any rate, the prior suggestions (e.g. using a recommended directory, and correct file names, reading the wiki...) should probably be the first changes in your procedure(s). For troubleshooting, I would also suggest putting your kernel under the same directory in which the bootloader is being installed (and modify the configuration file accordingly). Once things work as expected, you can perform additional changes. If you need more help, please post the results of the suggestions I mentioned above, and the content of your extlinux.conf file. Regards, Ady. PS: If you would be so kind, please avoid top-posting when writing to the mailing list. TY.
> cat gptmbr.bin >/dev/sdb1I just realized that I was not _that_ explicit as I should had been in my prior reply regarding this part of your steps. Not only that CAT is not the best method for troubleshooting, but that "*mbr*.bin" is not supposed to be transferred (in any way, with any method) to sdb1 (emphasis in the partition number, "1" in this case). The *mbr*.bin files are supposed to be transferred to "sdb" (or "sda", or "sdc" or...). As I mentioned in my first reply, mixing sdb with sdb1, syslinux.cfg with syslinux.cOnf and similar things are a symptom of either writing in a hurry, or not reading / following the adequate documentation. Regards, Ady.
Fine, I will do it all again and use some tool like 'script' to log every single byte, but it'll be a few days before I can email that to you since it takes overnight to zero out the drive to ensure no old data will interfere, and copying the data from the old drive to the new one is also rather slow. For the record, I did RTFM. It has no complete examples for _ANY_ use case, and you know it. The man page has no examples at all, and 'extlinux.txt' only has tiny, out-of-context snippets which assume the hard disk you want to install upon is either hda or sda, and you know that too. For a poster who insists on absolute perfection, I'm shocked you find that paltry level of documentation adequate. On 11/13/18, Ady Ady via Syslinux <syslinux at zytor.com> wrote:> >> cat gptmbr.bin >/dev/sdb1 > > I just realized that I was not _that_ explicit as I should had been in > my prior reply regarding this part of your steps. > > Not only that CAT is not the best method for troubleshooting, but that > "*mbr*.bin" is not supposed to be transferred (in any way, with any > method) to sdb1 (emphasis in the partition number, "1" in this case). > The *mbr*.bin files are supposed to be transferred to "sdb" (or "sda", > or "sdc" or...). > > As I mentioned in my first reply, mixing sdb with sdb1, syslinux.cfg > with syslinux.cOnf and similar things are a symptom of either writing > in a hurry, or not reading / following the adequate documentation. > > Regards, > Ady. > > _______________________________________________ > Syslinux mailing list > Submissions to Syslinux at zytor.com > Unsubscribe or set options at: > http://www.zytor.com/mailman/listinfo/syslinux >