Ferromagnetic carbon grains are formed by (at least) long periods of electrolysis packed between lead electrodes using a sodium bicarbonate electrolyte. There may well be other methods of doing this too.
This is a picture of the set up some years ago in my old lab space - running 4 tanks at once hunting for another effect.