Linux related notes

Installing Linux with custom USB stick on UEFI system

Debian has bootable images which would do it if you write them on a USB stick. Unfortunately, they will not match your USB stick size or will overwrite the content of the USB stick.

Usually I use procedure described for Plop linux installation on a USB stick and modify it. However, UEFI systems (the one without old BIOS) do not use MBR to do so. The best hints how to make an USB bootable stick for UEFI system are located at Installing Debian Jessie on a pure UEFI system.

First, put the grub UEFI aware boot loader on a stick. Let's say it is /dev/sdb1.

[[!format txt """ pmount sdb1 sudo grub-install --target x86_64-efi --efi-directory /media/sdb1/ --removable --boot-directory=/media/sdb1/boot """]] Then copy relevant linux kernel and intitrd files (use HD media type for Debian).

Finally, create grub config (/media/sdb1/boot/grub/grub.cfg) which points to proper entries for linux and initrd

[[!format txt """ menuentry "Debian Installer" { insmod part_msdos insmod ext2 insmod part_gpt insmod fat insmod gzio echo 'Loading Linux kernel' linux /EFI/debian/vmlinuz --- nomodeset echo 'Loading InitRD' initrd /EFI/debian/initrd.gz } """]] Do not forget to put iso image file with Debian to that stick.