Hi everyone.
There are a few different ways to go about it: I’ve done it this way that seems quick and simple to me, and it works.
I have a Raspberry Pi 400 and used a 64Gb pendrive for testing (but it is the same with an HD) and I state that I have always used Linux only, so I have no idea how to do with Windows (although I imagine it is similar)
1) Download from here:
https://www.batocera.org/download
the image of Batocera for Raspberry Pi 400.
2) Once done, connect the pendrive to the PC with a working linux distro (I tried with Linux Mint) and after installing Balena Etcher:
https://www.balena.io/etcher
copy the Batocera image on the Pendrive.
Note: if it gives you an error, unzip the downloaded Batocera image first and try again
3) On the pendrive there are two partitions now. Go to the “boot” partition and edit the “cmdline.txt” file with a text editor as follows:
dev = /dev/mmcblk0p1 to dev = /dev/sda1
(as correctly indicated above by JaviLP)
4) Insert the pendrive in the Raspberry Pi 400, disconnect the MicroSD and turn it on. If you have updated the Raspberry Pi bios to the latest version, not finding the microSD it will boot from the USB and the system starts. When the system is loaded and you get to the Batocera main screen, shutdown the system.
5) Remove the pendrive from the Raspberry Pi and put it back in the Linux PC. At this point, launch the “gparted” program (if not present in your distro install it), “unmount” the “share” partition you find in the pendrive now, then “check” and repair the partition. Now the whole “share” partition is available.
6) Close Gparted, extract the pendrive and then reinsert it in the PC with Linux, copy the bios you need into the “Bios” folder and the games you want in the “Rom” folder and it is ready (Note: under Linux it must be done as root).
Insert it in the Raspberry Pi and… have fun ;-)