将 Ubuntu 从 C: 移至 D: 后,WSL 无法正常工作

将 Ubuntu 从 C: 移至 D: 后,WSL 无法正常工作

我需要将一些文件从 SSD(C:)移动到 HDD(D:),因此我使用了“设置”>“应用”>“已安装的应用”中列出的 Ubuntu 应用上的移动选项。然而,这导致 WSL 无法识别我已安装 Ubuntu,即使我将它移回 C: 驱动器也是如此。

通过 Powershell 或 Microsoft Store 卸载并重新安装 Ubuntu 后,我收到以下错误消息:

Failed to attach disk 'C:\Users\sukes\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc\LocalState\ext4.vhdx' to WSL2: The system cannot find the file specified.
Error code: Wsl/Service/CreateInstance/MountVhd/ERROR_FILE_NOT_FOUND
Failed to attach disk 'C:\Users\sukes\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc\LocalState\ext4.vhdx' to WSL2: The system cannot find the file specified.
Error code: Wsl/Service/CreateInstance/MountVhd/ERROR_FILE_NOT_FOUND
Failed to attach disk 'C:\Users\sukes\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc\LocalState\ext4.vhdx' to WSL2: The system cannot find the file specified.
Error code: Wsl/Service/CreateInstance/MountVhd/ERROR_FILE_NOT_FOUND
Press any key to continue...

我应该怎么做才能解决这个问题?

相关内容