Question: What is the ruling on placing two gravestones made from cement on the grave; then the name of the deceased person is written on one of them so that his grave is not confused with another grave. May Allah bless you.
Response: All praise is due to Allah, Lord of the Worlds. May peace and blessings be upon he whom Allah sent as a mercy to the Worlds. Upon his family, companions and brothers until the day of judgement. Thereafter:
The base ruling here is that it is not permissible to build upon graves, cement them, write upon them or sit on them. This is due to the Hadeeth:
The Messenger of Allah (sal Allahu alayhi wa sallam) forbade that the graves should be plastered, sat upon, built upon, added to them or written upon. 
Also the hadeeth of Abu Al-Hayyaaj al-Assadi who said, Alee Ibn Abee Taalib (May Allah be pleased with him) said to me, “Should I not send you upon the instructions that the Messenger of Allah (sal Allahu alayhi wa sallam) sent me with?
That you should not leave any image in a house except that you should deface it, nor a raised grave except that you should level it. 
Although the people of knowledge forbid all types of writing on the grave, they exempt what is required due to a necessity such as knowing the grave. This is done by merely writing the name of the deceased but not for beautification. This ruling is analogically proven, due to the Prophet (sal Allahu alayhi wa sallam) placing a stone on the grave of Uthmaan bin Madh’oon. 
So this is an exemption from the general prohibition by way of analogy, and this is permissible according to the majority of scholars.
However, this is restricted to the minimal amount of writing by which the deceased will be known, in case it is feared that it will be removed or forgotten. This can be done via writing his name or an identification number but without building upon a grave.
This is in implementing the principle: “whatever is permitted due to a necessity, its allowance is removed when the necessity is removed.”
So this is in the case where a grave cannot be identified by simply placing a stone near it. This is all due to actualising the objective for which the Prophet (sal Allahu alayhi wa sallam) placed a stone on the grave of ‘Uthmaan ibn Madh’oon (may Allah be pleased with him), he said:
I know (by it) the grave of my brother and I will bury near it those who die from my family 
All Knowledge is with Allah (the Most High); our last call is that all praise is for Allah the Lord of the Worlds and may peace and blessings be upon our Prophet Muhammad, his family, companions and brothers until the Day of Judgement.
 Narrated by Jaabir; Collected by Muslim, Abu Dawood & an-Nisaa.ee
 Narrated by Abul Hayyaaj; Collected by Muslim, Abu Dawood & at-Tirmidhi
 Narrated by Anas; Collected by Ibn Maajah
 Narrated by al-Matlabb ibn Abdillah: Collected by Abu Dawood