Skip to content

Instantly share code, notes, and snippets.

@lisenhatson
Last active October 28, 2024 00:56
Show Gist options
  • Select an option

  • Save lisenhatson/2545ba3218bb2066a3e437bcb175dd3f to your computer and use it in GitHub Desktop.

Select an option

Save lisenhatson/2545ba3218bb2066a3e437bcb175dd3f to your computer and use it in GitHub Desktop.
fix alpine mbr

WIP

Manually Installing Syslinux

  1. Install Syslinux:

    apk add syslinux
  2. Copy the Syslinux boot files: Create a directory for Syslinux in your boot partition (assuming it’s mounted at /mnt/boot):

    mkdir -p /mnt/boot/syslinux
    cp /usr/share/syslinux/* /mnt/boot/syslinux/
  3. Install the Syslinux bootloader: Use the syslinux command to install it directly to your disk:

    syslinux /dev/sdxY  # Replace /dev/sdxY with your boot partition, like sda1 or nvme0n1p1
  4. Create or edit the Syslinux configuration file: Create the syslinux.cfg file in /mnt/boot/syslinux:

    nano /mnt/boot/syslinux/syslinux.cfg

    Add an entry similar to this:

    DEFAULT linux
    LABEL linux
        KERNEL /vmlinuz-lts
        APPEND root=/dev/sdxY  # Replace with your actual root partition, like sda2 or nvme0n1p2
        INITRD /initramfs-lts
  5. Set the bootable flag: If you're using a partition table, make sure your boot partition is flagged as bootable. You can do this with fdisk:

    fdisk /dev/sdx  # Replace /dev/sdx with your disk, like sda or nvme0n1

    Then follow these steps:

    • Press a to toggle the bootable flag on the appropriate partition.
    • Press w to write changes and exit.
  6. Reboot your system:

    umount -R /mnt
    reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment