Mount native ext4 partition in WSL2 [closed]
Asked Answered
I

1

16

I often work on Windows and Linux (on dual boot) and I'm using a ntfs partition to synchronize a data between systems which is something problematic (lots of docker containers have a problem to work with ntfs permissions). I've tried to mount an ext4 partition in wsl1 but it's impossible but I've read that with release of WSL2 it could be achieved. I've tried to do that but have no idea how it can be done. Is there really a way to mount native ext4 in wsl2 to share one partition between linux and wsl2?

UPDATE:

at last WSL2 supports mounting native EXT4 partition (well, partially). More info:

https://learn.microsoft.com/en-us/windows/wsl/wsl2-mount-disk

You have to be aware that it requires (at least for now) separate disk to work (so it's not applicable for my case :) my laptop doesn't have second disk slot)

Incombustible answered 13/11, 2019 at 22:3 Comment(2)
Same here.. also curious if WSL2 would have support for luksRemediosremedy
@Jaume: WSL2 means, that there is a real Linux kernel running inside some sort of virtual machine. What makes you think that this kernel cannot mount ext4 file systems? In particular the root file system of a WSL2 machine is ext4 already.Lovieloving
S
2

Windows Subsystem for Linux Brings the Full 4.19 Kernel to Windows said -

In WSL 2, the Linux filesystem is now just using EXT4 directly over a virtual pmem device, so we get Linux native filesystem performance on the Linux side and Windows native filesystem performance on the Windows side (best of both worlds). And with the 9P bridge, we can connect them together for a great integrated experience.

The following informations are found in Windows 10 will soon let you access Linux files from File Explorer -

Windows 10, version 1903 allows Windows 10 File Explorer to access, move and copy files stored inside Windows Subsystem for Linux distros.

To use File Explorer with WSL files, users need to open a WSL distro in Windows 10, change the directory to their Linux home folder, and type explorer.exe

This will open up the window below, which will allow users to manipulate WSL files in the same way as is possible using traditional File Explorer in Windows 10.

However, if you dual-boot Windows with a Linux-based OS, the new feature will not allow File Explorer to access EXT4-formatted partitions used by that Linux-based OS, only the file systems used by the WSL distros.

Spurling answered 20/11, 2019 at 17:3 Comment(2)
This is not an answer to the questionPolitics
if you want to mount an ext4 partition from usb drive, here a solution: github.com/jovton/USB-Storage-on-WSL2Resection

© 2022 - 2024 — McMap. All rights reserved.