Slackware64 UEFI USB boot stick for installation
The steps to making a UEFI USB boot stick are as follows:
1. Backup everything on the USB stick. All data on it will be deleted by following this procedure.
2. Using gdisk, delete all existing partitions.
3. Still in gdisk, create a partition 100 to 300 Mb in size.
4. Partition the rest of the space as you desire. (I'd probably make it all one partition).
5. Set the partition type of the first partition to "EFI System partition." (code EF00)
6. Set the partition types of the rest as you like. "Linux data" is code 8300.
7. Write the changes to the partition table and exit gdisk.
8. Format the first partition: mkfs.vfat /dev/sd?1
9. Format the second partition: mkfs.ext4 /dev/sd?2
The stick is now ready. All you have to do is copy the stuff onto it. Fortunately, everything you need is in the Slackware file tree.
My preference is to use the boot image & root filesystem from the "usb-and-pxe-installers" directory. To do this:
1. mount -o loop /path/to/slackware64-current/usb-and-pxe-installers/usbboot.img /mnt/loop
2. Copy everything from your mountpoint (/mnt/loop in my example) exactly as it is to the EFI system partition on our boot stick
3. Now, provided that you have a file called /path/to/media/usbstick/EFI/BOOT/BOOTX64.EFI on the stick, it'll boot.
The final step is to copy the Slackware tree onto the second partition of the USB stick. The installer will look for it, and can find it on an ext4 partition on the same USB stick.
The trick with EFI booting is making sure that you have an EFI System partition with EFI/BOOT/BOOTX64.EFI in it.
The hard part will be working out how to make a boot menu appear on your machine. Once you know how to do this, the USB stick should automatically appear on it.
On an older machine, I had to enter the UEFI setup and change the setting "Enable F10 boot menu," which was disabled by default. Then, pressing F10 a few times early in the boot stage would bring up a boot menu, which would give me the option to boot from the USB stick. I also had to disable "Secure Boot."
1. Backup everything on the USB stick. All data on it will be deleted by following this procedure.
2. Using gdisk, delete all existing partitions.
3. Still in gdisk, create a partition 100 to 300 Mb in size.
4. Partition the rest of the space as you desire. (I'd probably make it all one partition).
5. Set the partition type of the first partition to "EFI System partition." (code EF00)
6. Set the partition types of the rest as you like. "Linux data" is code 8300.
7. Write the changes to the partition table and exit gdisk.
8. Format the first partition: mkfs.vfat /dev/sd?1
9. Format the second partition: mkfs.ext4 /dev/sd?2
The stick is now ready. All you have to do is copy the stuff onto it. Fortunately, everything you need is in the Slackware file tree.
My preference is to use the boot image & root filesystem from the "usb-and-pxe-installers" directory. To do this:
1. mount -o loop /path/to/slackware64-current/usb-and-pxe-installers/usbboot.img /mnt/loop
2. Copy everything from your mountpoint (/mnt/loop in my example) exactly as it is to the EFI system partition on our boot stick
3. Now, provided that you have a file called /path/to/media/usbstick/EFI/BOOT/BOOTX64.EFI on the stick, it'll boot.
The final step is to copy the Slackware tree onto the second partition of the USB stick. The installer will look for it, and can find it on an ext4 partition on the same USB stick.
The trick with EFI booting is making sure that you have an EFI System partition with EFI/BOOT/BOOTX64.EFI in it.
The hard part will be working out how to make a boot menu appear on your machine. Once you know how to do this, the USB stick should automatically appear on it.
On an older machine, I had to enter the UEFI setup and change the setting "Enable F10 boot menu," which was disabled by default. Then, pressing F10 a few times early in the boot stage would bring up a boot menu, which would give me the option to boot from the USB stick. I also had to disable "Secure Boot."
Total Comments 2
Comments
-
Hello 🤗
I think you have a typo, 8200 is for swap, 8300 is for Linux.Posted 09-25-2023 at 09:36 AM by rizitis -
Yes, you're right! Many thanks.
Posted 09-29-2023 at 02:28 AM by rkelsen