Did Umar somehow know that the Prophet (s) had asked Imam Ali (as) not to use his sword to claim his right after the death of the Prophet (s)?
Yes he and his group and many companions knew that the Prophet Muhammad (SAWA) had ordered Imam Ali (AS) not to fight against those who will deviate from his orders and grab his right. That is why Umar and his group did what they did against Ahlul Bayt (AS).
Wassalam.