1. Disconnect the negative battery cable.
2. Remove the headliner.
3. Disconnect the connector.
4. Remove the screws, and then remove the sunroof motor.

Sunroof unit disassembly/assembly
Sunroof motor installationMazda 6 Service Manual: Operational Range
The system operates only when the driver is in the vehicle or within operational
range while the key is being carried.
Starting the Engine
NOTE
Starting the engine may be possible even if the key is outside of the
vehicle and extremely close to a door and window, however, always start the ...
Mazda 6 Service Manual: Luggage Compartment
Loading golf bags
Golf bags can be carried in the luggage compartment.
Up to three golf bags can be carried in the luggage compartment.
Place each of the three golf bags into the luggage compartment with the bottom
of each bag pointed to the left, and then set the top of each bag so that it is ...