Formation of a mannose 6-phosphate marker. A glycoprotein destined for delivery to lysosomes acquires a phosphate marker in the Golgi compartment in a two-step process. First, GlcNAc phosphotransferase adds a phospho-N-acetylglucosamine unit to the 6-OH group of a mannose, and then an N-acetylglucosaminidase removes the added sugar to generate a mannose 6-phosphate residue in the core oligosaccharide.