Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mount native ext4 partition in WSL2 [closed]

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://docs.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)

like image 837
Jaume Avatar asked Nov 13 '19 22:11

Jaume


People also ask

Can WSL2 read ext4?

WSL2 can now mount Linux ext4 disks directly.

Can wsl access Linux partition?

On Windows 11, the Windows Subsystem for Linux (WSL) ships with a new feature that allows you to attach and mount physical drives to access Linux file systems (for example, ext4) not natively supported on Windows.


1 Answers

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.

like image 54
blueray Avatar answered Sep 30 '22 18:09

blueray