2

I want installed a complete Ubuntu 20.04.2.0 on a USB Flash Drive, according to this guide, using 64GB USB Flash Drive

I wonder is it enough space or should I use larger USB?

And how many space allocate to each partiton?

FAT32 partition, EXT4 partition, Swap partition.

Is the allocation order matters?

  1. FAT32 partition

  2. EXT4 partition

  3. Swap partition

(I did not understand the purpose of each of them).

In the meantime, ZOOM and VSCode is required, I do not need a lot of memory but I want it to be enough.

SPM OR
  • 21

2 Answers2

1

Is the computer a modern one using Secure Boot (UEFI)? If so, you might need to create a GPT partition table (instead of an MDOS one) on the USB device. You can use GParted to do that — beware! doing this will instantly erase all data on the drive, so be very sure that you've chosen your USB and not your computer's drive. But if your computer doesn't use Secure Boot, don't worry about this.

I don't know the purpose of the 4Gb FAT partition in the tutorial. Maybe it's spare space to be able to port files to a different computer.

So, I suggest the following.

  1. If your computer uses Secure Boot, you'll need a small FAT32 partition. Size 500Mb is about right. Tell the installer to use this for its EFI System Partition. (If your computer doesn't use Secure Boot, skip this partition altogether.)

  2. If you need Windows to access some files, create a partition for transferring the files. Instead of FAT32, I suggest NTFS. Make it only as large as you'll need for transferring files; it doesn't have to be 4Gb if you don't need that. Tell the installer not to use this partition. (If you don't need to share with Windows, skip this partition altogether.)

  3. For the Linux system, use all of the remaining space and format it to ext4. Tell the installer to use this as the root partition.

  4. Don't create a swap partition. Ubuntu 20.04 uses a swap file by default, though you probably want to avoid using swap on a USB stick — it will slow your system to a crawl.

EDIT: The tutorial doesn't mention that you must change the target bootloader installation (compare steps 6 and 7 (Phase 2) at the bottom of each image). Please remember to do this, otherwise your USB won't boot on a different machine, and you could have problems on your machine when the USB isn't plugged in.

EDIT: To change the target bootloader.

  • In the guide, scroll down to Phase 2, step 6. Look at the bottom of the image, where it says, "Device for boot loader installation". Notice that it shows /dev/sda.
  • Compare that to the image in Phase 2, step 7. There, it shows /dev/sdb. This should have been mentioned in the guide, but wasn't.
  • You must set this to whatever your USB device is, otherwise it'll overwrite the bootloader on your internal disk — you don't want that to happen!
  • Be aware that this is the device (e.g. /dev/sdb) and not a partition (e.g. /dev/sdb2).
Paddy Landau
  • 4,658
1

Full Install USB that boots Legacy or UEFI

As Paddy indicates, that link will produce a USB that only boots in Legacy mode, it will not boot on modern computers.

The easiest way to create a Full install USB that boots both BIOS and UEFI modes is to just Flash a pre-built image file to USB. See: Easy Full Install USB that Boots both BIOS and UEFI

The image fits on a 16GB USB but can be expanded and modified as desired using GParted.

After using the USB for a while and are ready to build one from scratch see: How to Create a Full Install of Ubuntu 20.04 to USB Device Step by Step

C.S.Cameron
  • 20,530
  • 12
  • 78
  • 125