Image caption The old cemetery in Fes, Morocco

From working-class neighbourhoods of French towns and cities to the villages of Algeria and Morocco, a strange kind of reverse migration is under way - of the dead.

Every year thousands of bodies are being repatriated from France to the Maghreb, as Muslim families return their loved ones to the soil of their original home. It is a costly and complicated business, involving flights, consular administrators and specialist funeral providers. It also prompts the question: why not get buried in France?

After all, France is the country where these families are now destined to live. Would it not be a sign of successful integration if France were also where they chose to rest when they died?

The answer to that question has to do with the complexities of national identity in a world of mass migration.

But also with France's own obsession with secular "republican" values, and its reluctance to give ground - literally - on matters of faith.

At the el-Ouadjib (Duty, in Arabic) funeral parlour in Lille in northern France, Abdallah Hadid receives three or four calls a day from families that have just had a death.

Image caption Abdallah Hadid in front of his funeral parlour in Lille

I interview him as we careen across the city in one of his hearses, racing against time to get official papers filed at the Algerian and Moroccan consulates.

"I would say about 70% of families want bodies repatriated to Algeria or Morocco or wherever," he says.

On most flights from France to the big cities of north Africa there are bodies in the hold Abdallah Hadid, undertaker

"While the bodies are prayed over and put in the shroud, our administrative team has to rush to get all the documents: from the city hall, from the police, from the consulates. Then we get the plane tickets for the family, and pay for the coffin to go in the hold. People don't realise it, but on most flights from France to the big cities of North Africa there are bodies in the hold - between one and four, depending on the size of the plane.

"Sometimes it is the villagers back in the old country who club together to pay for the removal. It costs about 2,500 euros (£2,150).

"But more and more families are using insurance companies, paying a little every year to make sure there is the money for a repatriation when they die."

According to Abdallah Hadid, there are two main reasons for sending the bodies of loved ones back to the Maghreb.

Image caption French authorities frown upon separate Muslim burial areas

The first is the pull of the heart - memories, loyalties, a wistful longing for the "old country".

The second is a more practical consideration: the absence of Muslim cemeteries in France.

France calls itself "laic" (secular). For 100 years there has been a strict separation of religion and state.

Muslims in France Estimated 4.5m Muslims in France in 2009; country's second largest religion after Roman Catholicism

Majority have ethnic background in former French colonies in North Africa (Algeria, Morocco, Tunisia)

2004 ban on religious symbols in French schools - including Islamic scarf , or hijab - opposed by many Muslims

This means that when it comes to burial places, town councils - which administer the country's cemeteries - refuse any special provision for faiths.

For years, French Muslims have been clamouring for designated areas in municipal graveyards - what they call carres confessionnels. In these, Muslim tombs would be directed towards Mecca as required by religion.

But they are blocked by an institutional reluctance on the part of the French authorities.

In practice, more and more Muslim areas are being created in cemeteries, simply because Muslim graves are being put next to each other. But they are tolerated rather than authorised. There is certainly no official policy to create them.

Another problem for Muslims is that space in French cemeteries is normally provisional. Families take out a lease for 30 or 50 years, after which the bodies are put in a common grave.

But this offends many Muslims, who believe bodies in the ground should not be touched. They are reluctant to burden future generations with the cost of renewing the lease of a French grave, so prefer to have their bodies repatriated.

Muslim funeral rituals Islamic law dictates that the funeral or Janazah should take place as soon as possible after death, with the following steps: Bathing the dead body

Placing the corpse in a white cotton or linen cloth shroud

Funeral prayer

Burial of the dead body in a grave (cremation is forbidden)

Positioning the body so the head faces Mecca Find out more about Islam Islamic Funerals

"This question of carres confessionnels is extremely important to us," says Dalil Boubakeur, who as Rector of the Grand Mosque in Paris is the nearest there is to a leader of French Islam.

"There are now six million Muslims in France. They pay taxes, they vote, they take part in local government. Why should they not have a say in how their dead are buried?"

The debate over whether to repatriate or bury in France is being held every day inside thousands of Muslim families.

Teacher Karim Saidi's parents came to Saint Quentin from Algeria in the 1960s. He and his brothers and sisters were all born in France, and he considers himself unequivocally French.

"When my father died in a road accident here, we decided to send his body back to his home in Algeria. It was automatic. It was what you did. But now we regret it, because we cannot visit the grave without making the long trip to Algeria. So with my mother, we have agreed that when she dies we will bury her here. In a way it will be quite fitting: one parent on either side of the Mediterranean," he says.

Walk around the Muslim graves in a cemetery like the one at Amiens, and you catch a glimpse of shifting attitudes towards death and identity.

There is something unfinished about Muslim identity here - many are not totally at peace Yassin Shaibi

Some of the graves are simple mounds of earth, with a name scratched on a small piece of wood. But newer ones are elaborate marble structures, virtually indistinguishable from their Christian neighbours. There are flowers, carved inscriptions, framed messages of love. For a child, a small image of a teddy bear.

"In traditional Islam, the grave is part of the earth. It is nothing. It is visited as long as there is close family, but then it vanishes," says Yassin Shaibi, an academic who has written extensively on the subject.

"But here we see how some Muslims have adopted the symbolism of the French way of death - the striving for permanence. It is funny: the more there is of physical structure on a grave, the more it shows the society's fear of death."

For Yassin Shaibi, the day that all French Muslims feel happy to be buried in France will be the day that the process of integration in French life is complete.

"But we are not there yet," he says. "There is something unfinished about Muslim identity here. Many are not totally at peace. To be totally at peace would mean preparing to die here just as they have lived here. But they don't."

You can follow the Magazine on Twitter and on Facebook