James M. Barnett was born around 1823 in Albemarle County, Virginia. Prior to the war, Barnett lived as a freeman in Pike County, Ohio. On September 20, 1855, he married Lucinda Cooper in Pike County, Ohio. Together they had two sons: John William, born August 12, 1856; and Joseph Henry, born December 15, 1857. Lucinda died in Pike County on March 4, 1858 of unknown causes. James subsequently married Mary Ann Jackson. They had two children: Sarah A., born August 2, 1862; and James V., born December 7, 1864.
Barnett enlisted as a private in the Union army on September 7, 1864, and mustered in on September 13, in Dayton, Ohio. His service record describes him as 5 feet, 7 inches tall, with black hair, black eyes, and black complexion. He served in Company I of the 17th USCT Infantry Regiment. Barnett fought in the Battle of Nashville in the late winter of 1864, helping the Union army repel Hood's invasion of middle Tennessee. He died on April 18, 1865, at the Wilson General Hospital in Nashville, Tennessee. Army surgeons listed his cause of death as acute diarrhea.
Following the war, Barnett's widow and children continued to live in Waverly, Pike County, Ohio. While Mary Ann applied for a pension in 1866, she did not receive it until 1877, though the federal government backdated the pension to the day after her husband's death. Although she initially received $8 a month, her pension gradually increased to $50 a month by 1935. She died of of senility on July 10, 1935, in Waverly, Ohio.