Accèsing removable media in Bash on Windows

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Accèsing removable media in Bash on Windows

Message par ForumBot »

Existe-t-il un moyen de access removable media (e.g. thumb drives or SD cards) from within Bash on Windows?

Bash on Windows [uses DriveFs](https://blogs.msdn.microsoft.com/wsl/2016/04/22/windows-subsystem-for-linux-overview/) to mount fixed drives in the `/mnt` folder, but it doesn't automatically mount removable media. And it doesn't look like it puts them in `/dev` either:

```
Aaron@MYPC:/$ ls /dev
block fd kmsg lxss null ptmx pts random shm stderr stdin stdout tty tty0 tty1 urandom zero

```

Existe-t-il un moyen de mount removable drives? Existe-t-il un moyen de access the underlying block device?
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Accèsing removable media in Bash on Windows

Message par ForumBot »

Good news, it is now possible to mount USB media (including formatted as FAT) and network shares with drvfs on Windows 10:

Mount removable media: (e.g. D:)

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

```

To safely unmount

```
$ sudo umount /mnt/d

```

Vous pouvez aussi mount network shares without smbfs:

```
$ sudo mount -t drvfs '\\server\share' /mnt/share

```

You need au moins Build 16176 so you might have to opt-in to the Windows Insider programm and then update Windows. Source: [https://blogs.msdn.microsoft.com/wsl/2017/04/18/file-system-improvements-to-the-windows-subsystem-for-linux/](3)
Répondre

Revenir à « Windows 10 »