I am trying to install OpenWRT on a spare Unifi USG (not sure if it's a USG or a USG-3P, so I have tried both versions 25.12.4 and 24.10.5 - both have the same result), and running all the commands as the documentation provides yields a bootloop - a few errors about mounting root, a kernel panic, and then a reboot. (console logs in picture)
A few things that I found odd and different from the documentations (both of which I chalked up to my device not being the 3P, but I could be wrong):
The drive does not come with 2GB unallocated space as the docs mention, rather it is formatted into two 1.6 and 1.8GB partitions. The FAT32 partition is the same size (142 MB).
Upon using my eyeballs, I re-skimmed the docs and saw that they also had a 1.6GB and 1.8GB partition when using lsblk.
The drive is ever so slightly larger than the documentations (4009754624 bytes, 7831552 sectors rather than the docs' 3880452096 bytes, 7579008 sectors). I wouldn't expect this to be an issue, but I feel it's worth noting.
I have not used OpenWRT before, and I am confused on how the sysupgrade.tar and kernel.bin files are used, as well as why the documentations install the sysupgrade.tar over (what I assume is) the factory bootloader.
They're the same in this case. There's only one device that was called the USG / USG-3P (3P == 3 ports). There is a 4 port rack mount device called the USG-Pro, but it is called the Pro which disambiguates it (it seems to be sort-of supported).
Use 25.12. Don't bother with 24.10 because it will be EOL soon.
Meanwhile, I'd recommend that you start with a new flash drive (assuming you have one that will physically fit into the USG) in case the issue is actually with that stick. It sounds like sda2 partition isn't quite right for some reason -- either a bad block or maybe an issue with the dd command to write the root partition (squashfs) to the partition. Did dd throw any errors when you ran it?
dd didn't give any errors whenever I was writing squashfs during installation, but during testing I found that sda2 wasn't written at all (sudo hexdump -C -n 64 /dev/sda2 returned 00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|). Small writes would save to the disk, but not a root install.
I tried reflashing with a new USB 2.0 stick (never used, flashed factory firmware first, then openwrt 25.12.4), and sda2 still doesn't write (nothing under hexdump, partition doesn't show up in file manager).
Another thing I found odd (and forgot to mention) during the sudo fdisk /dev/sda: When creating sda2, I get an error Partition #2 contains an ext3 signature. This happened with both the new and original USB sticks. This doesn't show up in the documentation, and from my knowledge sda2 should be an ext4 filesystem? fdisk logs:
Everything was done the same as before, except this time when I sudo screen /dev/ttyUSB0 115200 into the console I get a blank screen, instead of the bootloop/error chain I got with the last USB.
The signature error in the above reply was the issue, and the original USB stick worked when I kept the signature instead of removing it. In hindsight that would've been a very simple thing to troubleshoot, but I got hung up at the fact that it mentioned ext3 and not ext4.