After ruining my Ubuntu Mate (22.04) I needed to access it's from within Windows 11. Having a LUKS full disk encryption in place, it took me awhile to understand how to make my internal Linux root filesystem available in Windows
Assuming you already have Ubuntu with WSL 2 - no extra 3rd party software required:
Connect your drive to USB and let's go.
Within Power Shell running with Administrator privileges:
Find the name of your Windows device with:
GET_CimInstance -query "SELECT * fro Win32_DiskDrive"
Mount the drive without specifying filesystem:
wsl --mount \\.\PHYSICALDRIVE1 --bare
Within Ubuntu WSL 2
List your Linux block devices
Find your LUKS partition by running
$ sudo file -s /dev/XXX
for every partition
only LUKS partition will return:
sudo file -s /dev/sdd3 /dev/sdd3: LUKS encrypted files, ver 2 [, , sha256] UUID: XXXX
Create a mounting point
$ sudo mkdir /mnt/wsl/luks-drive
Open LUKS partition (mine was sdd3):
$ sudo wsl cryptsetup luksOpen /dev/sdd3 luks-device
(You can try all partitions, only LUKS one will actually succeed).
Find LUKS volume group:
$ sudo vgdisplay --short "vgubuntu-mate" ...
List logical volumes:
$ sudo lvs -o lv_name -S vg_name=vgubuntu-mate LV root swap_1
Activate root logical volume
$ sudo lvchange -ay vgubuntu-mate/root
list drive devices
$ sudo fdisk -l
The last device (i.e.
/dev/dm-1) is probably what we are looking for
Mount this device to previously created mount point:
$ sudo mount /dev/dm-1 /mnt/wsl/luks-drive
Going back to Windows
In file explorer go to
\wsl$\Ubuntu\mnt\wsl\luks-drive to find your LUKS root filesystem.