Easy answer to the sensor question:

1 sensor gives speed.
2 sensors gives speed and direction
3 sensors gives that and an index pulse (absolute position)

Re the Linux side of things... that’s best answers on a one on one rather than a forum free-for-all, I’ll leave that and my amateur exploration of Linux Cnc for now unless there’s no other takers.