TOKYO—Toshiba Corp.’s future turned even murkier as it filed suit to stop a business partner from blocking the sale of its semiconductor business, meant to plug a gaping financial hole.

The struggling conglomerate is racing to raise about $20 billion from the sale to a Japanese-government-led consortium—against the opposition of Western Digital Corp., which has a stake in the business. Toshiba had aimed to announce a deal by Wednesday with the consortium, which includes South Korean chip maker SK Hynix Inc., a Western Digital...