They fought on both the Union and Confederate sides, but the Union side was segregated and the Confederate side was mixed.
I don't know who mentioned the kkk and lincoln liking blacks but that is false. The kkk was not formed in Lincolns lifetime. And Lincoln believed that whites were superior to blacks. He just hated slavery.