He is probably the James B Lloyd (filed under Loyd) in the 1st Alabama Infantry, Co. G (Old Co. C) The Perote Guards. He enlisted at Girard on Feb. 13, 1861, for 12 months. The last card in his file shows him present in Nov/Dec. 1861. It is likely that when his enlistment was up he went home prior to his unit's surrender at Island No. 10.
http://www.archives.alabama.gov/referenc/flags/010a.html
There is another James B Lloyd in the 23rd Battalion Alabama Sharpshooters, but he is shown to be 28 years old in 1864, and so is not likely your man.