Right, assuming the flare is strong and long enough it is possible for UV and above to reach the surface.
Still you can take an x-ray of your HDD or SSD without data loss. There might be sweet spots of certain energies, that might cause data corruption.
The big guys, a barrage of protons and neutrons has much more potential to mess with the drives. Should whipe them out clean. But there are still a lot of molecules in the air, which will fend them off.
Against this throwing the hard drives into the swimming pool, would yield better protection.