Fabrication of stable nanopatterns on metals