4 votes

Mount physical linux drives in wsl

Tags: linux, wsl

7 comments

  1. [4]
    streblo
    Link
    Somewhat old news but probably useful to some. Apparently as of this fall you can mount your ext4 or other drives in wsl2. For someone like me who lives in my linux drive but keeps a windows...

    Somewhat old news but probably useful to some. Apparently as of this fall you can mount your ext4 or other drives in wsl2.

    For someone like me who lives in my linux drive but keeps a windows install handy it's nice to have access to your linux file system in windows without needing third-party programs. Because WSL2 is a full linux kernel it should be safe to use without fear of nuking your drive. I know there was some concern about WSL2 corrupting files but AFAIK the issue was with the block device emulation for the virtual filesystem but that shouldn't apply here.

    This does still require you to join the Windows insider program and update to the Dev release.

    3 votes
    1. [3]
      parsley
      Link Parent
      About that.... https://github.com/microsoft/WSL/issues/5895

      Because WSL2 is a full linux kernel it should be safe to use without fear of nuking your drive.

      About that.... https://github.com/microsoft/WSL/issues/5895

      1 vote
      1. [2]
        streblo
        Link Parent
        Hey thanks for the update. This is what the fix says I don't understand what is happening here. If it were the block device emulator that would make sense but improper shutdown should not result...

        Hey thanks for the update. This is what the fix says

        We've identified the error that has caused this issue and have put in a fix to add a sync() call before shutdown to make sure that all IO is completed. This fix is currently being verified internally and we're working on making it available to all of you! I'll post any updates here when it becomes available and how to get it. Thank you for the reports and help debugging!

        I don't understand what is happening here. If it were the block device emulator that would make sense but improper shutdown should not result in a file system corruption in a journaled file system. They're making it sound like a hard shutdown was causing the problem but I can yank the power cord out of my PC and while I may lose data fsck should resolve any issues in the file system.

        3 votes
        1. parsley
          Link Parent
          There are several issues regarding corruptions but they are mostly empty blob files in git repos or empty history files. It is still very strange. I need WSL for work (company issues windows pcs...

          There are several issues regarding corruptions but they are mostly empty blob files in git repos or empty history files.

          It is still very strange. I need WSL for work (company issues windows pcs but the software we are building only runs on linux) and updated to WSL2 recently for docker... we'll see if it affects me.

          2 votes
  2. [3]
    floweringmind
    Link
    I liked WSL-1 but WSL-2 is just a VM. I really don't understand why people don't just use real linux in Virtual Box or VMWare Workstation.

    I liked WSL-1 but WSL-2 is just a VM. I really don't understand why people don't just use real linux in Virtual Box or VMWare Workstation.

    2 votes
    1. streblo
      Link Parent
      I'm probably not your intended audience as I usually boot into a host linux but WSL2 boots in a literal second on my machine and I'm just using it to access my filesystem. If I had an actual linux...

      I'm probably not your intended audience as I usually boot into a host linux but WSL2 boots in a literal second on my machine and I'm just using it to access my filesystem. If I had an actual linux workflow but was constrained to Windows I would probably just use VB.

      3 votes
    2. Wren
      Link Parent
      It's better integrated than standard VM software. I personally don't really like that, but it's a plus for some.

      It's better integrated than standard VM software. I personally don't really like that, but it's a plus for some.

      1 vote