1

I am in a position where I need to access a drive from WSL. Unfortunately, I need to format it with a specific filesystem (ext4) on WSL since windows doesn't support that filesystem. As a result, I need to be able to have a device file to reference when formatting the disk on WSL. While I can mount a drive to a folder using sudo mount -t drvfs e: /mnt/edrive, I cannot seem to find any information about how to create a device file for a drive mounted in Windows. Is there any way that I can create a device file in WSL that references a drive mounted in Windows?

0

2 Answers 2

1

If I understand you correctly, it sounds like you are looking for a new feature that is coming in WSL, but is currently only available in Windows Insider/Preview. Don't let the fact that the command is named --mount confuse the issue (although it certainly is confusing). At least the way I read the doc (I'm not using Preview), this can create a block device in WSL from a raw, unformatted drive connected in Windows.

0

The simplest way is to attach your device, e.g. a USB-disk which appears as E:, to your Windows system and reboot.

Then restart wsl2 (WindowsTerm->Debian or whatever) and you will now see a new /mnt/e magically created for you :-)

Then use the command sudo mount -t drvfs E: /mnt/e you show above to mount that disk as a normal unix mountpoint.

1
  • 1
    OP is using ext4, which Windows does not support. drvfs mounts are not going to work.
    – Daniel B
    Sep 15, 2022 at 12:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .