Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
1
votes
1
answers
1909
views
How to change grub boot menu on a (formerly) live linux system?
So I converted a usb live linux install (Tails) from USB to virtualbox using `VBoxManage convertfromraw`. For it to boot in virtualbox, I need to remove one thing from the boot commandline (`live-media=removable`). This option is not in the usual /etc/default/grub or grub.d locations. I did find it...
So I converted a usb live linux install (Tails) from USB to virtualbox using
VBoxManage convertfromraw
.
For it to boot in virtualbox, I need to remove one thing from the boot commandline (live-media=removable
).
This option is not in the usual /etc/default/grub or grub.d locations. I did find it in:
/lib/live/mount/medium/syslinux/live.cfg.
I'm not sure how that ends up in the grub commandline. In fact, there is nothing in /boot/grub except unicode.pf2, so I think there is some other mechanism going on here.
This is EFI, also. I'm reluctant to run update-grub
in case this command line is being put together in a different manner.
adapt-dev
(1369 rep)
May 22, 2016, 01:25 AM
• Last activity: Jul 24, 2025, 09:04 PM
1
votes
0
answers
22
views
How can we debug syslinux and initrd loading?
I use buildroot to compile a custom `sedutil`. I can compile and boot from a usb drive from all my computers except one, my Thinkpad T16 gen3. It gets stuck at: ``` Loading bzImage... ok Loading rootfs.cpio.xz... ok ``` ## `syslinux.cfg` ``` default DTA prompt 0 noescape 1 label DTA kernel bzImage a...
I use buildroot to compile a custom
sedutil
.
I can compile and boot from a usb drive from all my computers except one, my Thinkpad T16 gen3.
It gets stuck at:
Loading bzImage... ok
Loading rootfs.cpio.xz... ok
## syslinux.cfg
default DTA
prompt 0
noescape 1
label DTA
kernel bzImage
append debug loglevel=9 nosmp libata.allow_tpm=1 usbcore.autosuspend=-1 usbcore.old-scheme-first=1
initrd rootfs.cpio.xz
I already tried to add debug loglevel=9
but nothing, something seems wrong with the laptop. I know it isn't a problem of compilation since it works perfectly on the other computers. I'd like to get what's wrong, which material or what can affect the initrd
process.
I couldn't find anything. Since there is literally no other print, I believe the kernel doesn't boot.
無名前
(729 rep)
Jul 17, 2025, 01:29 AM
7
votes
1
answers
1288
views
Should isohybrid work on all iso media, for example Windows 7?
I have a an original Windows 7 Professional x86 iso file, straight from Microsoft. I want to make a bootable USB from this ISO. Some sources suggest that I simply dd the iso to the USB, but I don't see how that should work. The ISO's first 32768 bytes (reserved as System Area on ISO 9660 media, to b...
I have a an original Windows 7 Professional x86 iso file, straight from Microsoft. I want to make a bootable USB from this ISO. Some sources suggest that I simply dd the iso to the USB, but I don't see how that should work. The ISO's first 32768 bytes (reserved as System Area on ISO 9660 media, to be used fx for MBR) are all zeroes, so there is no MBR or anything for the BIOS to read.
So as far as I can understand, one way is to add a MBR in this System Area, so that the ISO can be both dd'ed to a USB or written to an optical media, and be bootable from both.
I think the tool isohybrid should do that trick. I don't know how it works, so I can't figure out if it should just work for all bootable (ie bootable if written to optical media) ISO 9660 files. Or does it only work for some specific/familiar iso files?
At least I can't make it work with my Windows 7 iso. I get the following error:
$ isohybrid win7.iso
isohybrid: win7.iso: unexpected boot catalogue parameters
Mads Skjern
(1005 rep)
May 12, 2018, 11:43 AM
• Last activity: Jun 4, 2025, 01:49 PM
4
votes
2
answers
8913
views
PXE Boot: "Failed to load ldlinux.c32"
I'm trying to create a PXE server on my raspberry pi, but if I try to boot, the client shows the Error "Failed to load ldlinux.c32". This is my folder structure of the tftp folder: [![folder structure][1]][1] Here is my pxelinux.cfg configuration: DEFAULT vesamenu.c32 PROMPT 0 TIMEOUT 300 MENU TITLE...
I'm trying to create a PXE server on my raspberry pi, but if I try to boot, the client shows the Error "Failed to load ldlinux.c32". This is my folder structure of the tftp folder:
Here is my pxelinux.cfg configuration:
DEFAULT vesamenu.c32
PROMPT 0
TIMEOUT 300
MENU TITLE PXE Network Boot Menu
LABEL local
MENU LABEL BOOT FROM LOCAL DISK
MENU DEFAULT
LOCALBOOT 0
LABEL memtest
MENU LABEL memtest86+ v4.20
KERNEL memtest
And this is my DHCP configuration:
subnet 10.0.0.0 netmask 255.255.252.0 {
option ntp-servers de.pool.ntp.org;
option domain-name ".pudding.net";
option domain-name-servers 10.0.0.5;
option broadcast-address 10.0.3.255;
option subnet-mask 255.255.252.0;
option routers 10.0.0.1;
allow client-updates;
allow unknown-clients;
max-lease-time 1814400;
default-lease-time 604800;
range 10.0.0.100 10.0.0.200;
filename "/pxelinux.0";
next-server 10.0.0.5;
}
I configured it like this tutorial: Tutorial
It doesn't worked for me, with the same error, because of this I copied the structure from a friend, it doesn't worked with the same error. But it works for him.
Has anyone an idea, how to fix this problem? I don't know very well about syslinux and I would be happy if anyone can help me!

Isti
(41 rep)
Jun 11, 2019, 06:33 PM
• Last activity: Aug 16, 2024, 07:24 PM
0
votes
0
answers
225
views
How to specify correct kernel/initrd for PXE boot using syslinux and dnsmasq?
I have a dnsmasq server for DNS, DHCP, and TFTP for pxeboot. The DNS/DHCP options are working correctly, but my client complains that some files are missing when pxe booting. I assume I have something in my pxelinux.cfg/default wrong, but I'm not sure what. My dnsmasq.conf: ``` no-resolv no-poll int...
I have a dnsmasq server for DNS, DHCP, and TFTP for pxeboot. The DNS/DHCP options are working correctly, but my client complains that some files are missing when pxe booting. I assume I have something in my pxelinux.cfg/default wrong, but I'm not sure what.
My dnsmasq.conf:
no-resolv
no-poll
interface=enp5s0
dhcp-range=enp5s0,10.0.0.2,10.0.0.254,72h
dhcp-boot=pxelinux.0
enable-tftp
tftp-root=/opt/lib/pxe
listen-address=10.0.0.1
listen-address=127.0.0.1
server=
My pxelinux.cfg/default file:
default
label gentoo (squashfs/http)
kernel /gentoo/kernel
initrd /gentoo/network.igz
append root=/dev/ram0 init=/linuxrc dokeymap looptype=squashfs loop=/image.squashfs cdroot net.ifnames=0
File structure of /opt/lib/pxe:
├── gentoo
│ ├── kernel
│ └── network.igz
├── ISOs
│ └── admincd-amd64-20240721T164902Z.iso
├── ldlinux.c32
├── pxelinux.0
└── pxelinux.cfg
└── default
Output of syslog:
Aug 3 23:50:31 yvonnel dnsmasq-tftp: error 0 TFTP Aborted received from 10.0.0.128
Aug 3 23:50:31 yvonnel dnsmasq-tftp: sent /opt/lib/pxe/pxelinux.0 to 10.0.0.128
Aug 3 23:50:31 yvonnel last message buffered 1 times
Aug 3 23:50:32 yvonnel dnsmasq-tftp: sent /opt/lib/pxe/ldlinux.c32 to 10.0.0.128
Aug 3 23:50:32 yvonnel dnsmasq-tftp: file /opt/lib/pxe/pxelinux.cfg/b84b89f6-9bab-48ea-a79c-0ca669694079 not found for 10.0.0.128
Aug 3 23:50:32 yvonnel dnsmasq-tftp: file /opt/lib/pxe/pxelinux.cfg/01-90-1b-0e-32-30-9a not found for 10.0.0.128
Aug 3 23:50:32 yvonnel dnsmasq-tftp: file /opt/lib/pxe/pxelinux.cfg/0A000080 not found for 10.0.0.128
Aug 3 23:50:32 yvonnel dnsmasq-tftp: file /opt/lib/pxe/pxelinux.cfg/0A00008 not found for 10.0.0.128
Aug 3 23:50:32 yvonnel dnsmasq-tftp: file /opt/lib/pxe/pxelinux.cfg/0A0000 not found for 10.0.0.128
Aug 3 23:50:32 yvonnel dnsmasq-tftp: file /opt/lib/pxe/pxelinux.cfg/0A000 not found for 10.0.0.128
Aug 3 23:50:32 yvonnel dnsmasq-tftp: file /opt/lib/pxe/pxelinux.cfg/0A00 not found for 10.0.0.128
Aug 3 23:50:32 yvonnel dnsmasq-tftp: file /opt/lib/pxe/pxelinux.cfg/0A0 not found for 10.0.0.128
Aug 3 23:50:32 yvonnel dnsmasq-tftp: file /opt/lib/pxe/pxelinux.cfg/0A not found for 10.0.0.128
Aug 3 23:50:32 yvonnel dnsmasq-tftp: file /opt/lib/pxe/pxelinux.cfg/0 not found for 10.0.0.128
Aug 3 23:50:32 yvonnel dnsmasq-tftp: sent /opt/lib/pxe/pxelinux.cfg/default to 10.0.0.128
Aug 3 23:50:32 yvonnel dnsmasq-tftp: file /opt/lib/pxe/.c32 not found for 10.0.0.128
Aug 3 23:50:32 yvonnel dnsmasq-tftp: file /opt/lib/pxe/.img not found for 10.0.0.128
Aug 3 23:50:32 yvonnel dnsmasq-tftp: file /opt/lib/pxe/.bss not found for 10.0.0.128
Aug 3 23:50:32 yvonnel dnsmasq-tftp: file /opt/lib/pxe/.bin not found for 10.0.0.128
Aug 3 23:50:32 yvonnel dnsmasq-tftp: file /opt/lib/pxe/.bs not found for 10.0.0.128
Aug 3 23:50:32 yvonnel dnsmasq-tftp: file /opt/lib/pxe/.0 not found for 10.0.0.128
Aug 3 23:50:32 yvonnel dnsmasq-tftp: unsupported request from 10.0.0.128
I'm setting up the server to boot clients into the admin gentoo live CD which I extracted into components (kernel, rootfs, initrd) using the instructions here under the "Diskless install using PXE from the LiveCD" option.
jnasworld223
(1 rep)
Aug 4, 2024, 07:08 AM
• Last activity: Aug 4, 2024, 11:33 AM
0
votes
1
answers
71
views
Are low resolutions possible in syslinux?
I am building an arcade machine with a 15KHz CRT and Batocera and I need to get syslinux to display in 320x240 because a CRT can only do up to 240p or 480i. Is it possible to do interlacing or 320x240 on syslinux? I have tried UI menu.c32 MENU RESOLUTION 320 240 ... and MENU RESOLUTION 320 240 UI me...
I am building an arcade machine with a 15KHz CRT and Batocera and I need to get syslinux to display in 320x240 because a CRT can only do up to 240p or 480i. Is it possible to do interlacing or 320x240 on syslinux?
I have tried
UI menu.c32
MENU RESOLUTION 320 240
...
and
MENU RESOLUTION 320 240
UI menu.c32
...
and with vesamenu.c32 too, but it doesn't update the resolution. It stays on the same resolution as the BIOS splash.
Aarón García
(1 rep)
May 9, 2024, 04:35 PM
• Last activity: May 9, 2024, 06:07 PM
0
votes
1
answers
119
views
syslinux creating unexpected partitions on disk image
I'm encountering some odd behavior while trying to install a bootloader on a disk image. Here's the process I followed: ```bash $ dd if=/dev/zero of=test.img status=progress bs=200M count=1 1+0 records in 1+0 records out 209715200 bytes (210 MB, 200 MiB) copied, 0.190117 s, 1.1 GB/s $ mkfs.ext2 test...
I'm encountering some odd behavior while trying to install a bootloader on a disk image. Here's the process I followed:
$ dd if=/dev/zero of=test.img status=progress bs=200M count=1
1+0 records in
1+0 records out
209715200 bytes (210 MB, 200 MiB) copied, 0.190117 s, 1.1 GB/s
$ mkfs.ext2 test.img
mke2fs 1.47.0 (5-Feb-2023)
Discarding device blocks: done
Creating filesystem with 204800 1k blocks and 51200 inodes
Filesystem UUID: f6442813-7b8c-4636-b69e-334696e0840b
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729
Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
$ sudo mount test.img mount-point/ -o loop
$ fdisk -l test.img
Disk test.img: 200 MiB, 209715200 bytes, 409600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
$ sudo extlinux -i mount-point/
mount-point/ is device /dev/loop0
Warning: unable to obtain device geometry (defaulting to 64 heads, 32 sectors)
(on hard disks, this is usually harmless.)
$ fdisk -l test.img
Disk test.img: 200 MiB, 209715200 bytes, 409600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x20ac7dda
Device Boot Start End Sectors Size Id Type
test.img1 3224498923 3657370039 432871117 206.4G 7 HPFS/NTFS/exFAT
test.img2 3272020941 5225480974 1953460034 931.5G 16 Hidden FAT16
test.img3 0 0 0 0B 6f unknown
test.img4 50200576 974536369 924335794 440.8G 0 Empty
Partition table entries are not in disk order.
I can't understand why the extlinux -i
command would create new partitions on the disk image. I suspect it might be modifying some filesystem metadata, but I'd appreciate some clarification on the details. Additionally, is it possible to install Syslinux on an unpartitioned disk image?
ReYuki
(33 rep)
Apr 21, 2024, 03:04 PM
• Last activity: Apr 21, 2024, 04:15 PM
3
votes
1
answers
539
views
syslinux UEFI boot: automatically select boot option based on HW identifier
I am booting from USB media, and I am using syslinux EFI boot. I am booting the same media on 2 different laptops, and I have 2 menu options in syslinux.cfg, one for each laptop. Currently, I have to manually select the right menu option for each laptop. Is there some way to automate this, and have...
I am booting from USB media, and I am using syslinux EFI boot.
I am booting the same media on 2 different laptops, and I have 2 menu options in syslinux.cfg, one for each laptop.
Currently, I have to manually select the right menu option for each laptop.
Is there some way to automate this, and have
syslinux
automatically recognize on which laptop it is booting? Perhaps based on some unique HW identifier?
How could I do this?
this is my EFI/BOOT/syslinux.cfg
:
DEFAULT menu.c32
PROMPT 0
MENU TITLE UEFI boot menu
MENU AUTOBOOT Booting AAA in # seconds
LABEL AAA
MENU LABEL AAA
KERNEL menu.c32
APPEND /AAA/menu
LABEL BBB
MENU LABEL BBB
KERNEL menu.c32
APPEND /BBB/menu
the files /AAA/menu
and /BBB/menu
then have the correct boot options for each laptop.
so basically, I would need on laptop A, to automatically boot /AAA/menu
, and on laptop B /BBB/menu
Martin Vegter
(586 rep)
Feb 10, 2024, 03:22 PM
• Last activity: Feb 16, 2024, 12:55 PM
2
votes
1
answers
2444
views
Multiple Linux Installation - managing shared ESP and Bootable options
I have installed Manjaro alongside BlackArch. BlackArch has its bootloader in /boot which is a separate partition. Manjaro has three partitions, one for root(/), one for /boot, and one for /boot/efi. Now, let's say I want to install Fedora. Will there be any problem if I point Fedora's /boot/efi to...
I have installed Manjaro alongside BlackArch. BlackArch has its bootloader in /boot which is a separate partition. Manjaro has three partitions, one for root(/), one for /boot, and one for /boot/efi. Now, let's say I want to install Fedora. Will there be any problem if I point Fedora's /boot/efi to Manjaro's /boot/efi partition? Also, I currently have only two OSes: BlackArch and Manjaro. However, in UEFI, there are 4 bootable options listed:
One "Linux Boot Manager" entry, one "Manjaro" entry and two "UEFI OS" entries. How should I get rid of the duplication?
Here is the pic of the UEFI bootable menu:
PS. I installed Kali Linux (which uses GRUB) just to see what exactly happens, and this is the efibootmgr results after Kali's installation:
BootCurrent: 0004
Timeout: 1 seconds
BootOrder: 0002,0004,0000,0001,0005
Boot0000* Linux Boot Manager HD(4,GPT,db98bb6f-7706-374e-80ce-09d0b0ee32c6,0x64096000,0xfa000)/File(\EFI\SYSTEMD\SYSTEMD-BOOTX64.EFI)
Boot0001* UEFI OS HD(4,GPT,db98bb6f-7706-374e-80ce-09d0b0ee32c6,0x64096000,0xfa000)/File(\EFI\BOOT\BOOTX64.EFI)..BO
Boot0002* kali HD(4,GPT,db98bb6f-7706-374e-80ce-09d0b0ee32c6,0x64096000,0xfa000)/File(\EFI\KALI\GRUBX64.EFI)
Boot0004* Manjaro HD(3,GPT,6881d199-30c9-4a84-ac40-084ff6bb472b,0x64000000,0x96000)/File(\EFI\MANJARO\GRUBX64.EFI)
Boot0005* UEFI OS HD(3,GPT,6881d199-30c9-4a84-ac40-084ff6bb472b,0x64000000,0x96000)/File(\EFI\BOOT\BOOTX64.EFI)..BO

Sabyasachi Mukherjee
(123 rep)
Jan 1, 2019, 08:54 PM
• Last activity: Feb 5, 2024, 05:35 PM
3
votes
3
answers
11342
views
What does it mean "Failed to load COM32 file"
I have the following pxelinux config: DEFAULT vesamenu.c32 PROMPT 0 MENU TITLE In The Moon Network LABEL install1404server MENU LABEL Install Ubuntu 14.04.1 Server AMD64 include ubuntu-installer/amd64/boot-screens/menu.cfg default ubuntu-installer/amd64/boot-screens/vesamenu.c32 All mentioned files...
I have the following pxelinux config:
DEFAULT vesamenu.c32
PROMPT 0
MENU TITLE In The Moon Network
LABEL install1404server
MENU LABEL Install Ubuntu 14.04.1 Server AMD64
include ubuntu-installer/amd64/boot-screens/menu.cfg
default ubuntu-installer/amd64/boot-screens/vesamenu.c32
All mentioned files are accessed by tftpd.
When I do network boot, my menu appears. When I select the (single) item, the following error message appears:
Failed to load COM32 file ubuntu-installer/amd64/boot-screens/vesamenu.c32
Loading is occurred on virtual machine.
What is happening which causes this error message?
Dims
(3425 rep)
Mar 27, 2016, 07:18 PM
• Last activity: Dec 2, 2023, 07:45 PM
0
votes
1
answers
25
views
Working system, blank screen
## Setup Partitions: ``` # fdisk -l /dev/sda ... Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 51199 49152 24M c W95 FAT32 (LBA) /dev/sda2 51200 204799 153600 75M 83 Linux ``` [Syslinux](https://wiki.archlinux.org/title/Syslinux) configuration: ```syslinux UI menu.c32 LABEL linux LINUX...
## Setup
Partitions:
# fdisk -l /dev/sda
...
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 51199 49152 24M c W95 FAT32 (LBA)
/dev/sda2 51200 204799 153600 75M 83 Linux
[Syslinux](https://wiki.archlinux.org/title/Syslinux) configuration:
UI menu.c32
LABEL linux
LINUX ../bzImage
INITRD ../initrd.img
APPEND rootfstype=tmpfs init=/init
/init
:
#!/bin/sh
mount -a
/bin/sh
poweroff -f
## Testing
Booting via QEMU works:
# qemu-system-x86_64 /dev/sda
...However, running on a laptop (same arch) results in a blank screen. I can type shell commands (reboot
, poweroff
, etc.), but no text appears onscreen.
GooseDeveloper
(37 rep)
Oct 15, 2023, 07:39 PM
• Last activity: Oct 15, 2023, 07:56 PM
0
votes
1
answers
1528
views
create a UEFI bootable CD with ISOLINUX
How can I create a UEFI bootable CD ? ISOLINUX has no mention of UEFI: https://wiki.syslinux.org/wiki/index.php?title=ISOLINUX while SYSLINUX does, but specific to syslinux: https://wiki.syslinux.org/wiki/index.php?title=Install#UEFI I have installed these packages: syslinux syslinux-common isolinux...
How can I create a UEFI bootable CD ?
ISOLINUX has no mention of UEFI:
https://wiki.syslinux.org/wiki/index.php?title=ISOLINUX
while SYSLINUX does, but specific to syslinux:
https://wiki.syslinux.org/wiki/index.php?title=Install#UEFI
I have installed these packages: syslinux syslinux-common isolinux syslinux-efi
I flowed the instructions to create legacy (non-UEFI) bootable CD with ISOLINUX, and this is the file structure:
CD_root/
CD_root/isolinux/
CD_root/isolinux/isolinux.bin
CD_root/isolinux/isolinux.cfg
CD_root/isolinux/ldlinux.c32
I assume, the files
isolinux.bin
and ldlinux.c32
are for legacy boot only.
While there is UEFI specific ldlinux.e64
, there is no isolinux.efi
in /usr/lib/ISOLINUX/ or anywhere else.
What exactly do I need to do differently, to create UEFI bootable CD ?
Martin Vegter
(586 rep)
Aug 11, 2023, 06:26 AM
• Last activity: Aug 20, 2023, 07:17 AM
0
votes
1
answers
264
views
The PC is stucked in bios with my extlinux setup
My disk has 2 OS, Alpine and Debian, and a /home in a separated partition. The bootloader is grub from Debian installed in the MBR (bios). I want to use Alpine and its extlinux bootloader so I can remove the other OS to save space. Alpine is on sda3 ``` sda 8:0 0 465.8G 0 disk ├─sda1 8:1 0 300M 0 pa...
My disk has 2 OS, Alpine and Debian, and a /home in a separated partition.
The bootloader is grub from Debian installed in the MBR (bios).
I want to use Alpine and its extlinux bootloader so I can remove the other OS to save space.
Alpine is on sda3
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 300M 0 part
├─sda2 8:2 0 47.5G 0 part /mnt
├─sda3 8:3 0 78.4G 0 part /
└─sda4 8:4 0 335.6G 0 part /home
I have syslinux installed in Alpine. The begining of the MBR is overwritten for the syslinux like so .
doas dd bs=440 count=1 conv=notrunc if=/usr/share/syslinux/mbr.bin of=/dev/sda
The /boot directory looks like that
System.map-lts extlinux.conf.old ldlinux.sys mboot.c32 vmlinuz-lts
config-lts initramfs-lts libcom32.c32 menu.c32
extlinux.conf ldlinux.c32 libutil.c32 vesamenu.c32
The extlinux.conf
DEFAULT menu.c32
PROMPT 0
MENU TITLE Alpine/Linux Boot Menu
MENU HIDDEN
MENU AUTOBOOT Alpine will be booted automatically in # seconds.
TIMEOUT 10
LABEL lts
MENU DEFAULT
MENU LABEL Linux lts
LINUX /boot/vmlinuz-lts
INITRD /boot/initramfs-lts
APPEND root=UUID=b0bd16c2-3546-4392-a7b2-fb8206933a47 modules=sd-mod,usb-storage,ext4 quiet rootfstype=ext4
MENU SEPARATOR
Then I ran
doas extlinux --install /boot
When I restart the PC "Intel boot agent" is not happy and brings me to the bios disk selection.
The Alpine live iso on an USB stick boots normally and it seems it uses extlinux. So I think the hardware is compatible.
Whats wrong in this setup please ?
Ploumploum
(121 rep)
Mar 4, 2023, 06:49 PM
• Last activity: Mar 5, 2023, 12:14 PM
1
votes
1
answers
574
views
syslinux bootloader unable to find the initrd.img for a custom bootable image made via Docker Containers
## Description As a side project, I am trying to use __Hashicorp Packer__ along with __Docker__ to create Bootable disk Images from Docker Containers. __Hashicorp Packer__ generally takes the responsibility of bringing the docker containers up and execute tasks within them and then create filesystem...
## Description
As a side project, I am trying to use __Hashicorp Packer__ along with __Docker__ to create Bootable disk Images from Docker Containers.
__Hashicorp Packer__ generally takes the responsibility of bringing the docker containers up and execute tasks within them and then create filesystem tarballs or use containers to create image files etc.
### How it works
1. I use an
The respective
ubuntu:focal
docker container
2. use this docker container and install a Kernel / Systemd On it:
apt-get update && apt-get install -y --no-install-recommends linux-image-virtual systemd-sysv
3. Create a tarball of the container which now contains the kernel, initrd and system from step 2
4. unpack the tarball on the host machine to be able to use it when creating an image file
5. Spin up another ubuntu
container with privileges and mount the working directory into it to create the bootable image file.
At this point I am relying on a bash script below to create an image for me:
set -e
echo "[Install APT dependencies]"
DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y extlinux fdisk qemu-utils
echo "[Create disk image of 1GB]"
dd if=/dev/zero of=/os/${DISTR}.img bs=$(expr 1024 \* 1024 \* 1024) count=1
blue "[Make partition]"
sfdisk /os/${DISTR}.img < /os/config/partition.txt
echo "\n[Format partition with ext4]"
losetup -D
LOOPDEVICE=$(losetup -f)
echo -e "\n[Using ${LOOPDEVICE} loop device]"
losetup -o $(expr 512 \* 2048) ${LOOPDEVICE} /os/${DISTR}.img
mkfs.ext4 ${LOOPDEVICE}
echo "[Copy ${DISTR} directory structure to partition]"
mkdir -p /os/mnt
mount -t auto ${LOOPDEVICE} /os/mnt/
cp -R /os/${DISTR}.dir/. /os/mnt/
echo "[Setup extlinux]"
extlinux --install /os/mnt/boot/
cp /os/config/syslinux.cfg /os/mnt/boot/syslinux.cfg
echo "[Unmount]"
umount /os/mnt
losetup -D
echo_blue "[Write syslinux MBR]"
dd if=/usr/lib/syslinux/mbr/mbr.bin of=/os/${DISTR}.img bs=440 count=1 conv=notrunc
The DISTR
in the above script is ubuntu
and the ubuntu.dir
is the unpacked tarball ball which is mounted into the container to be able to copy it to the mounted partition.
### Progress
Currently I have been successful in creating such images for ubuntu
. The repository created can be found here
However upon trying to boot the image using qemu-system-x86_64
:
sudo qemu-system-x86_64 -drive file=ubuntu.img,index=0,media=disk,format=raw
I get the following error:

syslinux.cfg
for the bootloader is:
DEFAULT linux
SAY Now booting the kernel from SYSLINUX...
LABEL linux
KERNEL /boot/vmlinuz
INITRD /boot/initrd.img-5.4.0-125-generic
APPEND ro root=/dev/sda1
## Additional Changes
I tried updating the syslinux.cfg
to
DEFAULT linux
SAY Now booting the kernel from SYSLINUX...
LABEL linux
KERNEL /boot/vmlinuz
APPEND ro root=/dev/sda1 initrd=/boot/initrd.img
however I get the same error, albeit /boot/initrd.img
is not found is the error message.
What am I currently missing from myside to make the initrd.img
discoverable for the bootloader.
I have tried using cp -dR /os/ubuntu.dir/. /os/mnt
in the bash script to make sure symbolic links are preserved while copying.
I have also made sure to see if the symlink initrd.img
file exists in the mounted partition /os/mnt/boot
which it exists and so does the source of the symlink file e.g. readlink -f /os/mnt/boot/initrd.img
## Sources
iximiuz blogpost on docker-to-bootable devices
PockerISO
Shan-Desai
(811 rep)
Sep 16, 2022, 09:03 AM
• Last activity: Sep 16, 2022, 12:09 PM
0
votes
1
answers
6296
views
Create bootable syslinux USB on UEFI
We use a Centos 8 machine to create syslinux bootable USB installers for our product. The created USB now supports only target machines with BIOS (or with CSM mode turned on) but we need to update it to support UEFI. The [instructions on syslinux.org][1] are pretty sparse and a few days of searching...
We use a Centos 8 machine to create syslinux bootable USB installers for our product. The created USB now supports only target machines with BIOS (or with CSM mode turned on) but we need to update it to support UEFI.
The instructions on syslinux.org are pretty sparse and a few days of
searching have not been successful.
Trying to boot on a HP EliteDesk always results in "BootDevice not found". USB boot is enabled in the machine's BIOS.
**What we're doing**
1) Partition USB
2) Copy syslinux files
3) Copy syslinux.cfg
4) Run
syslinux
command to install
Any hints on what I'm doing wrong or perhaps a pointer to a better set of instructions on how to do this?
**PARTITION**
(parted) mkpart
Partition name? []? EFI
File system type? [ext2]? fat32
Start? 512MB
End? 1024MB
(parted) set 1 esp
New state? [on]/off? on
(parted) mkpart
Partition name? []? Installer
File system type? [ext2]? fat32
Start? 1024MB End? 100%
(parted) p
Model: Generic Flash Disk (scsi)
Disk /dev/sdc: 8053MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt Disk Flags:
Number Start End Size File system Name Flags
1 512MB 1024MB 513MB fat32 EFI boot, esp
2 1024MB 8052MB 7028MB fat32 Installer
**COPY FILES**
After copying, the EFI partition contains:
# find /mnt/usb
/mnt/usb
/mnt/usb/efi
/mnt/usb/efi/boot
/mnt/usb/efi/boot/ldlinux.e64
/mnt/usb/efi/boot/syslinux.efi
/mnt/usb/efi/boot/libcom32.c32
/mnt/usb/efi/boot/vesamenu.c32
/mnt/usb/efi/boot/libutil.c32
/mnt/usb/efi/boot/menu.c32
**INSTALL SYSLINUX**
# umount /mnt/usb
# syslinux -d /efi/boot --install /dev/sdc1
**EDIT I**
I tried changing the file name based on the advice from telcoM but the bootloader did not start. (was tried on an HP EliteDesk 800 and an industrial motherboard).
The HP machine says "BootDevice not found" and the industrial motherboard goes directly into the BIOS.
For testing, we're just trying to get the bootloader to be recognized.
BIOS Config: CSM is off and the boot device set to "UEFI: KIOXIA 1".
parted /dev/sdb p
Model: KIOXIA TransMemory (scsi)
Disk /dev/sdb: 15.5GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 512MB 1024MB 513MB fat32 EFI boot, esp
The USB contains:
mount /dev/sdb1 /mnt/usb
[root@bluebox /]# cd /mnt/usb
[root@bluebox usb]# find .
.
./efi
./efi/boot
./efi/boot/bootx86.efi
./efi/boot/ldlinux.e64
./efi/boot/libcom32.c32
./efi/boot/libutil.c32
./efi/boot/menu.c32
./efi/boot/syslinux.cfg
./efi/boot/vesamenu.c32
[root@bluebox usb]# cd /
[root@bluebox /]# umount /mnt/usb
[root@bluebox /]# syslinux -d /efi/boot --install /dev/sdb1
[root@bluebox /]# echo $?
0
**EDIT II - SOLUTION**
The advice from telcoM was very close. After renaming the path to **capital letters** syslinux now loads.
Specifically, on the USB /efi/boot/bootx86.efi
must be /EFI/BOOT/BOOTx86.EFI
**Reference Links**
- Instructions on syslinux.org
- Rods Books
- Description of EFI System Partition at Wikipedia
- Article on using syslinux
for Slackware
- Making a bootable USB by Harkamal Dadwal
Danny
(653 rep)
May 26, 2022, 09:56 AM
• Last activity: May 30, 2022, 06:04 AM
1
votes
0
answers
1062
views
Issues running an automatic and unattended clonezilla restore drive
When I try to run an automated and unattended restore via Clonezilla it returns the following error: Now run "ocs_prerun": mount /dev/sdb2 /mnt... Mount: /mnt: special device /dev/sdb2 does not exist. Failed to run: mount /dev/sdb2 /mnt Press "Enter" to continue...... Then, after hitting Enter it sh...
When I try to run an automated and unattended restore via Clonezilla it returns the following error:
Now run "ocs_prerun": mount /dev/sdb2 /mnt...
Mount: /mnt: special device /dev/sdb2 does not exist.
Failed to run: mount /dev/sdb2 /mnt
Press "Enter" to continue......
Then, after hitting Enter it shows the following error:
The directory for this inputted image name does NOT exist: /home/partimag/Amentum_04_21_2022
Program Terminated!!!!
"ocs-sr -kl -e1 auto -e2 -batch -r -j2 -scr -p reboot restoredisk Amentum_04_21_2022 sda" finished with error!
Here is my syslinux.cfg entry for prerun:
label Amentum_04_21_2022
MENU DEFAULT
# MENU HIDE
MENU LABEL Amentum_04_21_2022
# MENU PASSWD
kernel /live/vmlinuz
append initrd=/live/initrd.img boot=live union=overlay username=user config components quiet noswap edd=on nomodeset noeject locales=en_US.UTF-8 keyboard-layouts=NONE ocs_prerun="mount /dev/sdb2 /mnt" ocs_prerun1="mount --bind /mnt /home/partimag" ocs_live_run="ocs-sr -k1 -e1 auto -e2 -batch -r -j2 -scr -p reboot restoredisk Amentum_04_21_2022 sda" ocs_live_extra_param="" ocs_live_batch="no" vga=791 ip= net.ifnames=0 splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1
TEXT HELP
VGA mode 1024x768. OK for most of VGA cards.
ENDTEXT
I'm not sure why this is happening because I've prepared these drives this way every other time and I feel like I'm missing something.
This is how they show up when viewing them in the file explorer in Windows. It's just two partitions on the same USB drive:
CZ(D:) would be sdb1 and images(E:) would be sdb2, right? This is what I've put in both the grub.cfg and the syslinux.cfg file and it's telling me sdb2 does not exist. Anyone have any ideas?
Thanks in advance!

newman
(21 rep)
Apr 27, 2022, 07:32 PM
0
votes
1
answers
3748
views
Load Memdisk with linux16 / initrd16 from Grub2 UEFI
I need to load the Memdisk kernel from Grub2 in UEFI mode. I don't know if this is possible, but I am getting an unexpected unidentified error. I would like to know if it is possible and if so how to do it. My menuentry/commands for Grub is as follows: menuentry 'Hirens Boot 15.2' { search --no-flop...
I need to load the Memdisk kernel from Grub2 in UEFI mode.
I don't know if this is possible, but I am getting an unexpected unidentified error.
I would like to know if it is possible and if so how to do it.
My menuentry/commands for Grub is as follows:
menuentry 'Hirens Boot 15.2' {
search --no-floppy --fs-uuid --set=root 3a02381a-2bf7-4730-8e13-6d7640f9c60e
set iso_path="/isos/Hirens.BootCD.15.2.iso"
loopback loop ($root)$iso_path
linux16 (loop)/HBCD/Boot/memdisk iso
initrd16 /isos/Hirens.BootCD.15.2.iso
}
The same menu entry is bootable without problems in BIOS mode.
n7rc
(3 rep)
Feb 13, 2022, 04:42 PM
• Last activity: Feb 14, 2022, 01:16 PM
1
votes
2
answers
1647
views
Custom Build - Unable to mount filesystem
So I'm building a custom Linux-based OS, and I chose to run it as a RAM disk (initramfs). Unfortunately, I keep getting a Kernel Panic during boot. ``` RAMDISK: gzip image found at block 0 using deprecated initrd support, will be removed in 2021. exFAT-fs (ram0): invalid boot record signature exFAT-...
So I'm building a custom Linux-based OS, and I chose to run it as a RAM disk (initramfs). Unfortunately, I keep getting a Kernel Panic during boot.
RAMDISK: gzip image found at block 0
using deprecated initrd support, will be removed in 2021.
exFAT-fs (ram0): invalid boot record signature
exFAT-fs (ram0): failed to read boot sector
exFAT-fs (ram0): failed to recognize exfat type
exFAT-fs (ram0): invalid boot record signature
exFAT-fs (ram0): failed to read boot sector
exFAT-fs (ram0): failed to recognize exfat type
List of all partitions:
0100 4096 ram0
(driver?)
0101 4096 ram1
(driver?)
0102 4096 ram2
(driver?)
0103 4096 ram3
(driver?)
0104 4096 ram4
(driver?)
0105 4096 ram5
(driver?)
0106 4096 ram6
(driver?)
0107 4096 ram7
(driver?)
0108 4096 ram8
(driver?)
0109 4096 ram9
(driver?)
010a 4096 ram10
(driver?)
010b 4096 ram11
(driver?)
010c 4096 ram12
(driver?)
010d 4096 ram13
(driver?)
010e 4096 ram14
(driver?)
010f 4096 ram15
(driver?)
No filesystem could mount root, tried:
vfat
msdos
exfat
ntfs
ntfs3
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
**Any chance this is something missing in my kernel build?**
Here's how I've designed the OS:
| Component | My Choice |
|------|-----------|
| Init Daemon | initrd |
| Commands | busybox 1.35.0 |
| Kernel | Linux 5.15.12|
| filesystem | **msdos, fat, exfat, ext2, ext3, or ext4** |
| Bootloader | **syslinux or extlinux** |
*NOTES: I tried each file system one at a time, and all provide the same response, which leads me to believe that it is not an issue with the filesystem itself. I also tried both syslinux and extlinux for testing purposes.*
Here's how I've structured my disk:
/media/vfloppy
└── [ 512 Jan 3 08:06] boot
├── [ 36896 Jan 3 08:06] initramfs.cpio.gz
├── [ 512 Jan 3 08:06] syslinux
│ ├── [ 283 Jan 3 08:06] boot.msg
│ ├── [ 120912 Jan 3 08:06] ldlinux.c32
│ ├── [ 60928 Jan 3 08:06] ldlinux.sys
│ └── [ 173 Jan 3 08:06] syslinux.cfg
└── [ 939968 Jan 3 08:06] vmlinux
Here is my syslinux.cfg
:
DISPLAY boot.msg
DEFAULT linux
label linux
KERNEL /boot/vmlinux
INITRD /boot/initramfs.cpio.gz
APPEND root=/dev/ram0 init=/init loglevel=3
PROMPT 1
TIMEOUT 10
F1 boot.msg
I've also enabled the following filesystem options in my kernel's .config
file:
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_FS_IOMAP=y
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
CONFIG_FS_MBCACHE=y
CONFIG_EXPORTFS_BLOCK_OPS=y
CONFIG_FAT_FS=y
CONFIG_MSDOS_FS=y
CONFIG_PROC_FS=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=4096
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_RD_GZIP=y
CONFIG_DECOMPRESS_GZIP=y
Robert Jamison
(136 rep)
Jan 3, 2022, 04:22 PM
• Last activity: Jan 6, 2022, 10:54 PM
1
votes
1
answers
297
views
syslinux output duplicated in QEMU serial console
Any idea why *syslinux* output is duplicated in QEMU serial console? SeaBIOS (version rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org) iPXE (http://ipxe.org) 00:03.0 CA00 PCI2.10 PnP PMM+3FF8F290+3FEEF290 CA00 Booting from Hard Disk... SYSLINUX 6.03 EDD 2014-10-06 Copyright (C) 1994-2014 H. Peter Anvin...
Any idea why *syslinux* output is duplicated in QEMU serial console?
SeaBIOS (version rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org)
iPXE (http://ipxe.org) 00:03.0 CA00 PCI2.10 PnP PMM+3FF8F290+3FEEF290 CA00
Booting from Hard Disk...
SYSLINUX 6.03 EDD 2014-10-06 Copyright (C) 1994-2014 H. Peter Anvin et al
SYSLINUX 6.03 2014-10-06 Copyright (C) 1994-2014 H. Peter Anvin et al
boot:boot:
Loading linux...Loading linux... ook
k
Loading initrd..Loading initrd....
QEMU was started this way:
qemu-system-x86_64 -m 1024 -smp 2 -drive format=raw,file=/dev/sdb -vga none \
-serial telnet:localhost:1234,server,wait -nographic
And...
telnet localhost 1234
I was modifying openSUSE boot media to work with serial console
diff -uNp /mnt/boot/x86_64/loader/syslinux.cfg{.orig,}
--- /mnt/boot/x86_64/loader/syslinux.cfg.orig 2021-03-19 01:05:00.000000000 +0100
+++ /mnt/boot/x86_64/loader/syslinux.cfg 2021-03-19 01:23:26.000000000 +0100
@@ -1,4 +1,6 @@
-default harddisk
+serial --unit=0 --speed=115200
+terminal --timeout=10 serial console
+default linux
# hard disk
label harddisk
@@ -7,7 +9,7 @@ label harddisk
# install
label linux
kernel linux
- append initrd=initrd splash=silent showopts
+ append initrd=initrd textmode=1 console=ttyS0,115200n81
# upgrade
label upgrade
@@ -42,7 +44,6 @@ label memtest
menu label ->x memtest
kernel memtest
-ui gfxboot bootlogo message
implicit 1
prompt 1
timeout 600
My quick & dirty notes https://gist.github.com/jirib/7970eed8431013983a8cf1c947041c2a
Jiri B
(559 rep)
Mar 19, 2021, 12:45 AM
• Last activity: Jan 3, 2022, 10:58 PM
0
votes
1
answers
109
views
Select alternate boot media from bootloader?
If I'm booting from USB, is it possible to edit SYSLINUX menus to select a distribution on an internal hd? I don't mean deferring to the internal boot partition, but selecting an internal partition distribution from a USB bootloader. GRUB? It wouldn't be mounted yet, so I couldn't assume a path to t...
If I'm booting from USB, is it possible to edit SYSLINUX menus to select a distribution on an internal hd? I don't mean deferring to the internal boot partition, but selecting an internal partition distribution from a USB bootloader. GRUB?
It wouldn't be mounted yet, so I couldn't assume a path to the internal drive.
Does the booted os have to be on the boot partition?
JAS
(1 rep)
May 16, 2021, 12:29 PM
• Last activity: Jan 3, 2022, 10:46 PM
Showing page 1 of 20 total questions