WSL icon indicating copy to clipboard operation
WSL copied to clipboard

how to enter the ext4 partition

Open Fbougron opened this issue 10 years ago • 46 comments

Hello I am a new user of BASH with Windows preview insider

When i do the command "ls ", i can see all the NTFS partitions like one lettre each Microsoft@DESKTOP-G51CU1Q:/mnt$ ls c e f g h j k q r But no ext4 partition!!!

however i can continue to see the contents of the EXT4 partitions on Windows10-14371 with EXT2FSD ( http://www.ext2fsd.com/ ) how to be able to also view them with BASH (mount ?)

http://www.hostingpics.net/viewer.php?id=479092ext.png

Fbougron avatar Jun 24 '16 11:06 Fbougron

This is similar to #214 and #530. Currently only fixed NTFS volumes will appear as DriveFs mounts. Definitely something that we will be revisiting in the future.

benhillis avatar Jun 24 '16 14:06 benhillis

Fbougron, reading different FSes in Linux requires kernel-mode modules loaded, I believe, at boot on linux. Since the NT kernel reads NTFS partitions, and LXSS stores Linux-related file properties with NT extended attributes, NTFS is the only FS available (actually also ReFS but you get the picture).

To get real Ext-FS support from windows is something I don't think we can expect that from the MS team. Native Ext-FS support on Windows would be a cool feature in general, and I don't think it is really something directly linked to the Windows Subsystem for Linux (since it amounts basically to a kernel-mode filesystem driver).

WSL does do the VFS (virtual filesystem) emulation, which is the interesting part of the problem anyway. The rest of it is just a matter of coding something like ext2fsd, or a driver for it.

It would be cool if MS opened up the filesystem driver API for the NT Kernel so users could write drivers for the different linux filesystems though.

fpqc avatar Jun 24 '16 18:06 fpqc

This is why I think FUSE (#414) is so important before someone above the WSL team's pay grade (#423) declares bash.exe 'done'. MS can't reasonably do a "clean room" re-implementation of Ext4, but we can do this. With CUSE someone could do OSS or ALSA over a socket even if it's not a priority for the WSL team. User Voice is here.

therealkenc avatar Jun 24 '16 21:06 therealkenc

I mean, they could do a clean-room reimplementation of Ext4, but it would be a lot of work and relatively little market for it, since the Linix side already has interop through the ntfs-3g project. But my preference would be for MS to implement something like VFS on the Windows side with a well-documented API so OSS coders could do the hard work of a fully functional Ext4 driver for Windows. The point is though that this would have to be something implemented in directly in the NT Kernel by the Kernel team, not the WSL team (they seem to only work directly with the lxss/lxcore/lxsession/bash.exe stuff, which is my guess why they have to make inter-departmental requests to the Kernel team and the Console team for changes to be made).

fpqc avatar Jun 25 '16 17:06 fpqc

OSS coders can already do Ext4 on Windows without Microsoft's help, if someone felt so inclined. MS even tells you how to get started here. A VFS type layer is entirely possible too. Windows filesystems do not need to be developed by the MS NT Kernel team. It's already just a driver.

therealkenc avatar Jun 26 '16 05:06 therealkenc

@therealkenc Oh? Do the Linux FSes support all of the extended attributes and (maybe overcomplicated) security security model used by the NT kernel and implemented in NTFS?

fpqc avatar Jun 26 '16 07:06 fpqc

Nope. But you could implement all of the NTFS security constructs in a Linux kernel module if one was so inclined, just as you could implement all of the Linux security constructs in a Windows driver if one was so inclined. You were asking for a "a well-documented API so OSS coders could do the hard work of a fully functional Ext4 driver for Windows". If by "fully functional" you mean including Linux security constructs, then yep you'd need to implement those in a Windows driver. But you wouldn't need the MS NT Kernel team to do that. This setting aside the fact that an Ext4 filesystem on Windows would probably care about such security constructs about as much as the ntfs-3g filesystem on Linux does (that is, not that much). You'd probably mount the thing with some blanket permissions for the user that mounted it.

therealkenc avatar Jun 26 '16 23:06 therealkenc

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.

@benhillis can you confirm that I'm accurately describing this?

segin avatar Jul 27 '16 06:07 segin

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

benhillis avatar Jul 27 '16 15:07 benhillis

Another voice chiming in. Would be great to access files from my ubuntu partition via WSL.

I'm still excited about WSL--please keep up the morale and hard work!

michael-wise avatar Dec 23 '16 07:12 michael-wise

I'd like to be able to do this in WSL. Thanks for all the hard work folks

GaryHendrick avatar Jan 01 '17 02:01 GaryHendrick

Would be great to work this out to make Rails 10x faster. #893

aurimus avatar Apr 06 '17 12:04 aurimus

@aurimus This talk by Theodore Ts'o should probably explain why adding ext4 support is not necessarily just a matter of adding a driver:

https://www.youtube.com/watch?v=2mYDFr5T4tY

It turns out that getting good performance and supporting lots of features of the Ext filesystems would require MS to invest quite a lot of resources. Ts'o says in that talk that it takes 7-10 years for new filesystem drivers in the Linux kernel to become mature.

MS could probably relatively quickly write a small compatibility driver (something like ntfs-3g on Linux), but to really get first-party-level-performance out of it would likely take a while (or maybe coding resources that they wouldn't want to spend on such a niche feature).

Edit: But if the Microsoft team wants to prove me wrong, I'm rooting for ya.

fpqc avatar Apr 06 '17 12:04 fpqc

They don't have to. Ext2/3/4 File System Driver for Windows:

https://sourceforge.net/p/ext2fsd/code/ci/master/tree/

therealkenc avatar Apr 06 '17 17:04 therealkenc

@therealkenc so you are saying that I can see linux partitions from Bash by mounting them with your mentioned driver?

aurimus avatar Apr 07 '17 00:04 aurimus

@therealkenc -- I don't know the provenance of that driver; are you saying that it's as robust and well-optimized as the ext4 driver baked into the Linux kernel?

aseering avatar Apr 07 '17 00:04 aseering

There is also Paragon Extfs driver, would that do?

aurimus avatar Apr 07 '17 00:04 aurimus

Those file system drivers for Windows (both ext2fsd and paragon extfs) work great for mounting an EXT2/3/4 volume in Windows. But as far as I know you can't access them from Bash.

mstrelan avatar Apr 07 '17 00:04 mstrelan

@mstrelan sounds like it's true..

aurimus avatar Apr 07 '17 00:04 aurimus

Just saying it's doable, same as ISO9660 or FAT32. You can't mount Ext2 partitions or CDs or DOS floppy disks in WSL Creators, of course, because the infrastructure doesn't exist. Whether you can add a "yet" to that last sentence depends on where this project goes after all the low hanging fruit bits are finished.

therealkenc avatar Apr 07 '17 05:04 therealkenc