BARCELONA — Catalonia’s independence referendum is no longer about whether Catalans want statehood but whether they will be able to vote on Sunday at all.

Far from the orderly vote that separatists wanted to stage, the referendum has instead turned into a covert operation to avoid a Madrid-ordered shutdown.

The government of the conservative Prime Minister Mariano Rajoy has called on residents to stay home. With the help of Spanish courts and the police, it has confiscated paper ballots and closed referendum-related websites.

The moves are an attempt to thwart the turnout and to deny any legitimacy to a referendum that Spain’s constitutional court has formally suspended. Nevertheless, Catalan officials and many residents say they will find a way to vote.