 He was adopted into the Hayashi family at an early age.During the Boshin War, he fought against the forces of the Tokugawa shogunate in Echigo Province.Following the Meiji Restoration, Hayashi joined the new Meiji government.