Skip to content

how to enter the ext4 partition #579

Open

Description

@Fbougron

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

Activity

  1. benhillis commented on Jun 24, 2016

    @benhillis
    Member

    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.

  2. fpqc commented on Jun 24, 2016

    @fpqc

    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.

  3. therealkenc commented on Jun 24, 2016

    @therealkenc

    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.

  4. fpqc commented on Jun 25, 2016

    @fpqc

    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).

  5. therealkenc commented on Jun 26, 2016

    @therealkenc

    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.

  6. fpqc commented on Jun 26, 2016

    @fpqc

    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?

  7. therealkenc commented on Jun 26, 2016

    @therealkenc

    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.

  8. segin commented on Jul 27, 2016

    @segin

    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.

    Ben Hillis (@benhillis) can you confirm that I'm accurately describing this?

  9. benhillis commented on Jul 27, 2016

    @benhillis
    Member

    Kirn Gill II (@segin) You are mostly correct. Currently we only support fixed NTFS volumes.

  10. michael-wise commented on Dec 23, 2016

    @michael-wise

    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!

  11. GaryHendrick commented on Jan 1, 2017

    @GaryHendrick

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

  12. aurimus commented on Apr 6, 2017

    @aurimus

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

  13. fpqc commented on Apr 6, 2017

    @fpqc

    Aurimas (@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.

  14. therealkenc commented on Apr 6, 2017

    @therealkenc
  15. 17 remaining items

  16. Biswa96 commented on Nov 18, 2018

    @Biswa96

    There may be support for ext4 file system in future. If you've Windows 10 insider build 18262 or greater then run this command using strings from sysinternals.

    set X=C:\Windows\System32\lxss\LxssManager.dll
    strings.exe %X% | find /i "ext4"

    LxssManager.dll has a string ext4.vhdx.

    Another evidence supports my investigation. This error showed in Process Monitor while uninstalling a distro. LxssManager can't find the ext4.vhdx file.

    ext4_cant_find

  17. therealkenc commented on Nov 18, 2018

    @therealkenc

    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.

    Okay, it's the future now.

    FWIW the future came in 16176, in April 14, 2017. The volume being mounted in the OP was not a fixed NTFS volume; instead, it was a a fixed ext2fsd volume, which according to Menci mounts now. Similar to, like Ben said in the post you quote, #214 or #530. I just didn't have the heart to close the issue because it acts as a useful dupe target.

    This is blocking for a number of our use cases.

    Why is it always "a number of use cases" and never one use case. [Don't answer that, I'm mumbling to myself again not you.]

    There may be support for ext4 file system in future.
    LxssManager.dll has a string ext4.vhdx.

    More likely they need to present a static ext4 image to userspace as a ro block device and/or to satisfy some ABI I haven't thought of. That's my guess. My guess could be wrong. I think it is a better guess than your guess, tho. But to be sure, I wish you were right.

  18. segin commented on Nov 19, 2018

    @segin
  19. mcmordie commented on Dec 22, 2018

    @mcmordie

    Kirn Gill II (@segin) not a cluster. We are looking for vital functionality here and it depends on WSL understanding ext4 filesystems properly. WSL is emulating a Linux environment and it cannot do that properly without speaking ext4.

    Use cases:

    1. Using qemu-arm-static to chroot into embedded filesystems located within WSL's home directory. Status: this almost works, but issues with permissions and ownership still not working properly prevent the use of sudo commands. We use Qt within these systems and qmake returns an error about cannot stat ".".

    2. Mounting remote ext4 filesystems in order to have multi-platform projects building eg. Win32/Linux-ARM/Linux-x86.

  20. therealkenc commented on Dec 23, 2018

    @therealkenc

    it depends on WSL understanding ext4 filesystems properly. WSL is emulating a Linux environment and it cannot do that properly without speaking ext4.

    Replace "ext4" above with btrfs or reiserfs. Now replace that with lxfs. They all have *nix semantics, including stat(2). You can chroot(1) into a arm root on lxfs right now. The statement "speaking ext4" isn't particularly well formed (except in really exceptional edge cases).

    Now, I can maybe assume what want. Maybe you want to mount a ext4 image on a loop device. [Not that I would use WSL for the purpose if it were me. WSL is demonstrably the wrong tool for the scenario right now.] But even if this is the case, the scenario that has nothing to do with the OP, which is about mounting an Windows ext2fsd drive in WSL.

    In short, "building multi-platform projects" doesn't have anything to do with "speaking ext4" or "speaking reiserfs" or "speaking zfs" or "speaking NFSv4". If you've got problems with qmake or whatever, okay. If you can narrow the problem to some syscall surface that is behaving differently on WSL on lxfs versus Real Linux on ext4, or some other syscall diverge, that's legit enough. Maybe it can be looked at. It won't be a trivial exercise to demonstrate such a diverge, mind. But in any case, such a diverge won't have anything to do with whether your chroot lives on an ext4 filesystem mounted on a loop device (or any other filesystem that respects *nix semantics). qmake doesn't have a clue whether it is living in a ext4 filesystem image (or resierfs image) on a loop device, versus living in lxfs.

  21. segin commented on Dec 23, 2018

    @segin

    Dave McMordie (@mcmordie) Let me try to tell you this again because it seems you either didn't understand, or didn't like what you were told and are being arrogant about the reality of the situation.

    Where you wrote: "WSL understanding ext4 filesystems properly"... WSL does not understand ANY filesystem. It does not understand NTFS. That's the NTFS driver's job, and not part of WSL. Similarly, ext4 support would be the job of a separate, external, and disconnected ext4 driver. That would be the job of the main Windows kernel team to create, not the WSL team.

    Where you wrote: "WSL is emulating a Linux environment and it cannot do that properly without speaking ext4." I can compile a Linux kernel, yes, a real Linux kernel, latest version straight from kernel.org, and configure it's build options so that this very real Linux kernel also does not speak ext4. Because what I have said is fully possible, it completely disproves that ext4 support is needed to "fully"
    emulate a Linux ABI - hell, the BSD systems do it without needing ext4 as well.

    Where you wrote: "Mounting remote ext4 filesystems in order to have multi-platform projects building eg. Win32/Linux-ARM/Linux-x86." Remote filesystems have no bearing over what WSL can and cannot do, unless you're using iSCSI or Fibre Channel connected storage where raw block-level access of drives is performed over the network.

    So yes, this thread is a cluster because it's full of people asking the wrong team for something that team isn't responsible for. I wouldn't ask the President of Mexico for a change in US law and push the matter anyway, trying to argue "but it's all on Earth so they should be able to figure it out". That's basically what you're doing here.

  22. therealkenc commented on Dec 23, 2018

    @therealkenc

    WSL does not understand ANY filesystem

    Nit - WSL understands lxfs and drvfs filesystems equivalently to any other diskless filesystem such as nfs or cifs or even procfs or tmpfs which lives in memory. There is no requirement for a filesystem to have an on-disk layout of any kind. WSL understands filesystems fine. [I know what you meant; I just wanted to clarify the quoted text above, which has correctness problems in boldface.]

    So yes, this thread is a cluster because it's full of people asking the wrong team for something that team isn't responsible for.

    More than one way to skin a cat, but that's a fair enough (if not exclusive) way to look at it. Mostly this issue is a cluster because no one has read the OP. Also because no one has come to the acceptance part of the grief stages - namely that MSFT isn't doing a clean-room ext4 re-implementation full stop (whatever team one thinks they should assign the task to). Because that would be silly.

  23. therealkenc commented on Oct 30, 2019

    @therealkenc

    I have still this issue.

    Given the green open button at the top that is not too surprising. Paragon could put their FS under a debugger and look, if they were motivated to do so. A FOSS developer could do the same with Ext3fsd, which best I can tell hasn't had a commit since early 2018.

    There is some recent chatter on the broader topic in #2999. An experiment to try might be to export/share that Paragon filesystem in WIndows, and them mount -t cifs it under WSL2. You'll need to turn off the (default) localhost bridge thing. Haven't tried with Paragon (don't have it) but it might work. Might not too. Bonne chance.

  24. mcmordie commented on May 24, 2020

    @mcmordie

    Folks, just an update to say that this is completely resolved at least for me, on WSL2. qmake, which was unable to stat filesystem entries due to a missing system call, is now working correctly. Thanks to everyone who helped make this a reality.

  25. muHashh commented on May 29, 2020

    @muHashh

    Folks, just an update to say that this is completely resolved at least for me, on WSL2. qmake, which was unable to stat filesystem entries due to a missing system call, is now working correctly. Thanks to everyone who helped make this a reality.

    How were you able to mount an ext4 partition? I'm using WSL2 and I can't access my 2nd drive's ext4 partiton (its NTFS partition is the only one I can see).

  26. mcmordie commented on May 30, 2020

    @mcmordie

    Mine was a side-effect of the OP's issue-- being able to stat filesystem objects inside chroots which wasn't working because the implementation didn't fully support ext4 internally. I have also been able to mount ext4 partitions on a looper in order to prepare boot media. But mounting real hardware with ext4 partitions is another matter entirely because the host OS (Windows) would have to provide access to WSL2 to the underlying block device.

  27. pcause commented on Jun 11, 2020

    @pcause

    If we could have access to a raw disk partition / USB device from WSL2 Linux could handle the filesystem access. Perhaps admin access of something would be required, but why not support this. Virtualbox enables this although you have to dig in the docs to figure out how. MS should be able to implement this pretty easily.

  28. craigloewen-msft commented on Sep 10, 2020

    @craigloewen-msft
    Member

    We've now added support to access ext4 and other Linux file formatted physical hard disks in a WSL 2 distro.

    See the details here in this blog post.

  29. therealkenc commented on Sep 10, 2020

    @therealkenc

    The OP ask is was drvfs interop with ext2fsd. Analogous open #530 #2163 #2999 (probably others). They could all be tagged by-design or external, but #2999 got deemed fair game feature request to look at, ergo....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions