If I purchase a 2TB external hard drive that has USB 3.0, will I be able to partition it so that 1TB is used for the PS5 and the other used for the Xbox, allowing me to store games from both consoles one the same physical drive?
I am not sure how the PS5 handles an external drive but when you connect it to the Xbox Series X, you will need to reformat the entire drive. It does not detect partitions. So even if the PS5 will allow you to install games to a partition, the Xbox will not. It will reformat the entire drive, erasing all partitions and will consume the entire disk for games.
There is a troubleshooting guide here there will answer some common questions around the use of an external hard drive with the Xbox Series X and S.