You need to partition and format the flash drive if you are going to install Ubuntu on it.
Make the same partitions you would on a hard disk
eg
esp partition 512Mb fat32
linux root filesystem partition ext4 all unused space
8Gb should be enough space, unless you want to write a lot of user data to the flash drive.
16Gb would be better, and you should use a usb3 flash drive and socket.
I think you’d better go with an external SSD or HDD at least.
Pendrives are not ideal for running an OS, as it involves a lot of writing.
The OS will run sloooow on a pendrive, and the pendrive is going to fail much sooner than with normal use.
Or at least try to use F2FS.
But I vote for external drive, not a pendrive…
I am not sure, I have not used f2fs.
I read that grub may not be able to find the files it needs in /boot.
Try it and see what happens… Linux is all about being able to experiment with things.
Interesting - F2FS looks ideal for things like RPi - but - Raspbian just defaults to ext4 for root “/” whether booting off external USB 3 or locally off SD-Card…
Note : I run 2 x Pi4 and 1 x Pi5 off external USB 3 SSD (the Pi5 is running Ubuntu 24.04 for arm64).
I have a pair of Pi Zero 2W and a Pi3B running on SD-Card…