I got me a used XA2 Ultra (model no. H3213) that already had SFOS installed - albeit an old version, 3.0.something, so I wanted to reflash.
On Linux, this requires fastboot, part of android-tools on ArchLinux,and a script (provided with the image download) to do all that over a USB connection.
However, I kept running into problems - either I’d get a variety of error messages like 'GetVar Variable Not Found', or it would reboot into SFOS after any fastboot command, or it would simply hang at flashing the first image. Seemingly random.
Hunting for solutions, listed here in order - the last one finally helped:
fastboot works, but the random symptoms persist.powertop as suggested here.Olf’s Installation Guide, a great collection of timely notes on installing SFOS
Jolla’s own Installation Instructions
And of course the great community-powered Sailfish OS Documentation.