If you are using WSL2 (assumed, since you should find the WSL1 files on the drive with that search), then the entire filesystem for your WSL distribution is in a virtual SDD. As @blami mentioned in the comments, you'll find that in:
%PROFILE%\AppData\Local\Packages\<distro package>\LocalState\ext4.vhdx
For Ubuntu (the default), the package name will start with "Canonical". So something like:
OldDriveLetter:\Users\<your_old_username>\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\ext4.vhdx
You can also search in OldDriveLetter:\Users\<your_old_username>\AppData\Local\Packages
for any ext4.vhdx
files.
Copy the ext4.vhdx
file off to your USB drive.
As for recovering, the safest/best way would be to use another Windows system with the latest WSL installed and:
Copy the ext4.vhdx
back to a location on the Windows system (preferred over trying to access it from the USB drive). For the sake of the example below, we'll assume it's placed in C:\WSL\instances\Recovered
.
Import the distribution into that WSL instance:
wsl --import-in-place RecoveredWSL
C:\WSL\instances\Recovered\ext4.vhdx
Note that this wsl
command requires the WSL version that is
installed from the Microsoft Store (or via wsl --install
on the latest Windows releases).
Feel free to use a different name, of course. Once imported, you can access the distribution via:
wsl ~ -d RecoveredWSL
You can also set it as default, so it can simply be launched via wsl
:
wsl --set-default RecoveredWSL
If you really need to access the files from a "real" Ubuntu instance, it may be a bit more complicated, as you'll need to mount that vhdx
file into Ubuntu. I haven't done that myself, but some see this answer on Ask Ubuntu for a possibility.
Important: If accessing the ext4.vhdx
using this method, please make sure you are working from a secondary copy, as other questions on Ask Ubuntu indicate the possibility of corruption using these tools.
%PROFILE%\AppData\Local\Packages\<distro package>\LocalState\ext4.vhdx
.