A method for forming a protective bilayer on a magnetic read/write head or magnetic disk. The bilayer is formed as an adhesion enhancing and corrosion resistant underlayer and a protective diamond-like carbon (DLC) overlayer. The underlayer is formed of transition metal oxynitride, having the general formula MeOxNy, where Me represents a single element or an alloy formed with two or more of the following transition metal elements: Ti, Zr, Hf, V, Nb, Ta, Cr, Mo, and W, here x can be within the range between 0 and 3 and y is in the range between approximately 0 and 2 By adjusting the values of x and y the adhesion underlayer contributes to such qualities of the protective bilayer as stress compensation, chemical and mechanical stability and low electrical conductivity. Various methods of forming the adhesion layer are provided, including reactive ion sputtering, plasma assisted chemical vapor deposition, pulsed laser deposition and plasma immersion ion implantation.