For the Moon and Mars, carve them into stone there. You'll have to defend against meteor strikes so they'll be carved and stored deep underground. No idea about seismic activity on those bodies.
For outer space, maybe it's pointless because finding, boarding, unloading an interstellar probe and sending the cargo back home is not easy unless you have very advanced interstellar ships. An orbit around the sun could be an easier place to spot. The Library of Ceres or the Library of the Troians?