29

I have a dual boot configured PC.

Since Windows 10 has Windows Subsystem for Linux, is it possible, to access the EXT4 partition from within it?

Ramhound
  • 41,734
  • 35
  • 103
  • 130
Roberto Aureli
  • 391
  • 1
  • 3
  • 5
  • Yeah, that is possible. This thread has some info about that https://askubuntu.com/questions/9933/how-to-read-ext4-partitions-in-windows – Strepsils Aug 31 '17 at 11:38

2 Answers2

15

is it possible to access the EXT4 partition from it?

It does not appear that WSL can access any partition that Windows itself cannot access. It additionally appears to be limited to only NTFS partitions mounted by the system itself. This means network shares wouldn't be accessible even if they were using the NTFS file system.

This is supported by the following statements:

WSL queries system-wide drives for DriveFS; letter mounts that are per-user (like some network maps, or Paragon's ext4fs driver for Windows) aren't picked up.

One of the WSL developers confirmed this was the case.

You are mostly correct. Currently we only support fixed NTFS volumes.

How to enter the ext4 partition

It appears that while this information is correct for Windows 10 1703 and below starting with Windows 10 1709 it should be possible.

In the latest Windows Insider build, the Windows Subsystem for Linux (WSL) now allows you to manually mount Windows drives using the DrvFs file system. Previously, WSL would automatically mount all fixed NTFS drives when you launch Bash, but there was no support for mounting additional storage like removable drives or network locations.

Now, not only can you manually mount any drives on your system, we've also added support for other file systems such as FAT, as well as mounting network locations. This enables you to access any drive, including removable USB sticks or CDs, and any network location you can reach in Windows all from within WSL.

File System Improvements to the Windows Subsystem for Linux

Since the partition already exists on the drive, you should be able to mount it, like you would any other partition in Linux. However, based on the information and examples I found, it might not be possible because Windows itself wouldn't know how to handle the EXT4 partition.

In order to mount a Windows drive using DrvFs, you can use the regular Linux mount command. For example, to mount a removable drive D: as /mnt/d directory, run the following commands:

$ sudo mkdir /mnt/d

$ sudo mount -t drvfs D: /mnt/d

Now, you will be able to access the files of your D: drive under /mnt/d. When you wish to unmount the drive, for example so you can safely remove it, run the following command:

$ sudo umount /mnt/d

The following question is related to this topic Windows 10 Ubuntu Bash Shell: How Do I Mount Other Windows Drives?, and while I have not pulled anything directly from it, it still is related to the subject of mounting volumes from within WSL.

Ramhound
  • 41,734
  • 35
  • 103
  • 130
6

Yes, you can. I regularly use ext2fsd to access ext4 volumes from Windows. Mostly my requirement is for read access, which is how I configure it, and it has worked flawlessly.

I have occasionally tested write access without noticing problems, but I have not used it enough to vouch for its reliability.

The SourceForge link describes it as A Linux ext2/ext3 file system driver for Windows, and it certainly reads ext4 volumes with no problems whatever, but I won't rely on using it for write access until I have either tested it a lot more or seen some reassurances that ext4 is supported.

AFH
  • 17,300
  • 3
  • 32
  • 48
  • 4
    The user isn't really asking how to access EXT4 from within Windows, doing that is well documented, but how to access the EXT4 volume from within Ubuntu specifically the Windows Subsystem for Linux variant. Now I don't disagree that using ext2fsd, would allow them to do this though, because they could simply mount the volume with the supplied command in my answer. – Ramhound Aug 28 '17 at 20:40
  • 3
    @Ramhound - Once the volume is mounted in `ext2fsd` it can be accessed from WSL like any other Windows volume. – AFH Aug 28 '17 at 20:49
  • @AFH how would you mount that to WSL? – Aftab Naveed Apr 25 '18 at 10:26
  • 1
    All Windows volumes with drive letters are mounted automatically when WSL is started, including those accessed with `ext2fsd`. I assigned `U:` to the Ubuntu partition, and WSL sees it as `/mnt/u/`. Type `df` to check. – AFH Apr 25 '18 at 10:43
  • ext2fsd is very slow for me. 800kb/s compared to 20 mb/s on native linux. – x0a Jul 01 '18 at 19:54
  • 2
    @x0a - I've not noticed the performance. I use it only occasionally and I'm grateful that I have Windows access at all. – AFH Jul 01 '18 at 21:17
  • ext2fsd doesn't work in Windows 10 x64, at least on my Surface Pro 4. The driver isn't loaded. To make Windows load that driver, I have to jump through things I cannot remember shortly after. Not recommended. – ygoe Dec 29 '18 at 13:53
  • 2
    @ygoe - It works fine on my Win10x64 desktop, currently at 1803, but it had no problems on any of the previous releases. It is run without parameters on start-up. – AFH Dec 29 '18 at 14:55
  • I think the Surface has some special safe boot option. That really does prevent unsigned drivers from loading, as opposed to regular installations that never should but still do load such drivers. – ygoe Dec 29 '18 at 18:12
  • 1
    Perhaps making the disk available to virtualbox and mounting it on a linux guest & letting the host have access via samba may be a stack of proven & reliable pieces of software. I used paragon software ext drivers and ended up corrupting my disk during write :( – Lord Loh. May 01 '20 at 09:59