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: Base installation
1. Cut away all of the original sealant using a razor.
2. Clean and degrease the ceramic coating on the glass and the base.
3. Apply primer to the bonding area of the glass and the base.
Caution
Keep the area free of dirt and grease, and do not touch the
surface or the primer may not prope ...
Mazda 6 Service Manual: Rear drain hose installation
Caution
If the rear drain hose is pinched or bent anywhere, the water in the hose may
not discharge and enter the inside of the vehicle. During and after installation
of the trims and the headliner, always make sure there is no interference with
the rear drain hose. Fix any problem if foun ...