I presume you want a persistent (full-installation) on this USB. It is possible to make a USB installation that can boot in both Legacy and UEFI modes, but it requires some effort:
First, you have to have an installation media that boots in both Legacy and UEFI. Tools such as Rufus or Ventoy can be used to create these. For example, if using Rufus, when making the installation medium, set the partition scheme to "MBR" and the target system to "BIOS or UEFI". If using Ventoy (which can be run under Linux as well as just Windows), it will support both Legacy and UEFI by default, just copy the Lubuntu ISO to the USB.
- Plug in your installation medium and boot from it through Legacy mode first. Select "Try Lubuntu" at the menu.
- Once at the desktop of your live system, plug in the USB you wish to use as the target (which Lubuntu will be installed onto).
- Connect to the internet if not already connected.
- Open a terminal and run
sudo apt install gparted. LXQt has KDE Partition Manager by default, however Gparted works better in cases like this.
- Launch Gparted. Change the dropdown in the top right-hand corner to your target USB device.
- Right click any existing mounted partitions and unmount/swapoff them.
- Select "Device" on the top bar, and select "Create partition table". Change the dropdown to "GPT" (note: this will erase all data on the disk, ensure data is backed up to your satisfaction first!).
- Create a new partition. The size should be 1MB and the file system should be unformatted.
- Create another partition. The size should be 100MB and the file system should be FAT32.
- Create another partition. The size should be around ~1GB and the file system should be swap.
- Create one last partition, which will be used as the root filesystem of your installation. The size should be however much space you have left on the disk. File system should be ext4.
- Apply the changes by clicking the tick button in Gparted.
- Right click the 1MB partition, select "Manage flags", and set the flags to
- Also set the flags of the 100MB partition to
- Close Gparted and proceed with the installation as you normally would, until you reach the partitioning step.
- Select "Manual partitioning" or "Advanced" at the partitioning step. You'll be asked to specify the partitions to use for installation.
- Set the 1MB unformatted partition to "Reserved BIOS boot area".
- Set the 1GB swap partition as swap.
- Set the ext4 partition as the root partition (mount point =
/). If it is shown, check the box to specify to format this partition.
- Don't forget to change the bootloader dropdown to your USB drive!
- Confirm that the partitions are correct and then continue.
- Wait for installation to finish, then power off your machine.
- Boot from your installation media again, this time in UEFI mode. Follow the same steps to get to the live system desktop.
- Plug in your target USB again.
- Connect to the internet.
- Open a terminal.
sudo fdisk -l. Take note of the
/dev/sdx label of your USB drive, it will probably be
/dev/sdc. In these next commands,
/dev/sdx will refer to your disk. Make sure you substitute the
x for the actual letter shown for your one!
sudo umount /dev/sdx4
sudo swapoff /dev/sdx3
sudo umount /dev/sdx2 (this one may not be mounted but its best to make sure they're all unmounted anyway)(
sdx1 is the BIOS boot partition so it will never be mounted).
sudo mount /dev/sdx4 /mnt
sudo mkdir -p /mnt/boot/efi
sudo mount /dev/sdx2 /mnt/boot/efi
sudo swapon /dev/sdx3
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount -t proc proc /mnt/proc
sudo mount -t sysfs sysfs /mnt/sys
sudo mount -t tmpfs tmpfs /mnt/run
sudo chroot /mnt.
apt install grub-efi-amd64 (EDIT: If on 32-bit instead of 64-bit, run
apt install grub-efi-i386 instead).
grub-install --efi-directory=/boot/efi --target=x86_64-efi --removable (this will install the UEFI bootloader. It will not conflict with your existing Legacy bootloader installation) (EDIT: If you experience problems at this stage,
mount /dev/sdx2 /boot/efi and then try again)(EDIT 2: It may also be possible to copy the EFI bootloader files from the live system instead of installing like this, but I felt it was more robust to do a clean install of the bootloader)(EDIT 3: Replace
--target=i386-efi if on a 32-bit system).
blkid | grep /dev/sdx2 (
x is still a placeholder here). From the output of this command, take note of the UUID number, which is in the format
echo "UUID=XXXX-XXXX /boot/efi vfat umask=0077 0 1" >> /etc/fstab (
XXXX-XXXX is still a placeholder, replace it with your partition's UUID).
exit your chroot.
- Power off your system (all currently mounted partitions will be unmounted automatically).
- Boot from your new installation in either Legacy or UEFI mode; both will work!
Enjoy your system. If any of this doesn't make sense I'll be happy to clarify it. I have personally tested this before myself (for Kubuntu not Lubuntu), and works fine.