Hamadi was born in Moudjeria, then part of the French Colony of Mauritania. He attended primary school in Moudjeria and Aleg from 1956 to 1961. He attended secondary school between in Atar, Rosso, and Nouakchott from 1962 to 1966.