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: Gear Shift Indicator (GSI)
The Gear Shift Indicator (GSI) supports you to obtain optimum fuel economy and
smooth driving. It displays the selected gear position in the instrument cluster
as well as notifies the driver to change to the most suitable gear position corresponding
to the actual driving condition.
CAUTIO ...
Mazda 6 Service Manual: No.7 abs warning light stays on more than 4 seconds with ignition switch on
Diagnostic procedure
When performing an asterisked (*) troubleshooting inspection, shake the
wiring harness and connectors while doing the inspection to discover whether
poor contact points are the cause of any intermittent malfunction. If there is a
problem, check to make sure conne ...