Definitely use quality surge protectors on expensive equipment connected to generators.
PSA: UPSes and GFCI/GFI extension cords won't work properly when connected to a stand-alone generator with a bonded neutral. I've tried using enterprise UPSes on such generators, but they absolutely won't work. In such scenarios, debond the generator's ground from neutral, apply a very large warning label to it being debonded, and drive a massive ground rod electrode into the ground as close to the generator as possible and ground the neutral there. This does work and is much safer because there's a stable voltage reference source. It's more of a hassle but can be necessary for some off grid and temporary scenarios.
GFCI works correctly either way. Their operating mode doesn't care at all about ground: Whether bonded, not bonded, or not even present (look, ma! only two wires!), they still perform the same way.
They respond to an imbalance in current flow betwixt line and neutral. What goes out must return; if it doesn't, then switch off.
> In such scenarios, debond the generator's ground from neutral
eeeeep. Please for the love of all that is holy, CONTACT AN ELECTRICIAN before messing around with that - or before creating a ground bond where none should be (i.e. TT grid [1]). You may end up endangering yourself if you do not exactly know what you are doing - in the case of TT, you get ground potential difference current from other parts of the grid flowing to ground via your generator's bond. Best case you're getting problems with electrochemical corrosion (including in your foundation), worst case enough current flows to turn your bond wire into a thermal fuse.
Also, take great care if your grounding is provided via municipal water service, or if your original grounding rod has dried out to the point it's ineffective.
Let me repeat: LET ELECTRICIANS DEAL WITH GROUNDING AND SURGE PROTECTION. Floating grounds and improper ground connections CAN BE LETHAL OR POSE A SERIOUS FIRE RISK.
AND YES THAT INCLUDES "ISLAND" SCENARIOS OR EMERGENCY POWER INPUTS (e.g. via CEE plugs and transfer switches).
I'm not sure I'd leave something like this to an electrician. Or if so at least make that electrician be experienced in this field. I think you'd want an electrical engineer to be involved with the plan to some degree.
Electrical engineers don’t know code requirements and wiring guidelines for household electrical wiring. They’re absolutely not the correct default. Electricians with specialization in generator setups, sure, but an electrician engineer on average is likely going to be more uninformed on code requirements than an electrician.
Electrical engineers know the theory but lack the practical knowledge which grid form is used at your specific address (yes, here in Germany we have a few towns where one half side of a street runs TT and the other one is already migrated to TN-C or TN-C-S).
An electrician specializing in lightning protection, uninterruptible power installation or in radio installations can sort out all of that far better than an engineer can.
That's an extreme edge-case and a strawman. Anyone operating temporary equipment on a generator during a severe storm will obviously unplug sensitive stuff to not take unnecessary chances regardless of safety precautions already in place.
Ground rods are required in certain situations according to the NEC.
Ground rods are for lightning protection, transient surges (over voltage), and induced surges; not for short protection, ground faults, or making ordinary extension cord use of bonded generators "safer".
Typically, they're required whenever it's a system that powers a building on its own, i.e., off-grid setup or with a floating neutral generator connected via a switched neutral transfer switch.
You can unplug everything and open all the switches, but a nearby lightning strike will still fry your generator through that unbounded ground rod. Lightning ground potential is very eager to take the shortcut to your other ground rods through a few millimeters of insulation and open switches on the path through your generator and house wiring, when the alternative might be tens of meters of dirt :)
I don't care what the NEC doesn't say, NFPA 780 says you have to bond all ground rods.
PSA: UPSes and GFCI/GFI extension cords won't work properly when connected to a stand-alone generator with a bonded neutral. I've tried using enterprise UPSes on such generators, but they absolutely won't work. In such scenarios, debond the generator's ground from neutral, apply a very large warning label to it being debonded, and drive a massive ground rod electrode into the ground as close to the generator as possible and ground the neutral there. This does work and is much safer because there's a stable voltage reference source. It's more of a hassle but can be necessary for some off grid and temporary scenarios.