Linux Format

FOREIGN FILESYSTEM­S

-

From the Linux side, your Windows C: drive and everything in it is available at

/mnt/c and from the Windows side, you can see your Linux filesystem(s) from Explorer by following the Linux shortcut (it has a penguin icon) below OneDrive, This PC, Network and what-have-you. While handy, you shouldn’t let Linux programs do I/O heavy operations on

/mnt/c. Why? Well read on…

If you run the mount command, you’ll see that /mnt/c uses some sort of exotic Plan 9 (9p) filesystem to mount a

drvfs volume. You’ll also see that the root

Linux filesystem lives on its own block device (/dev/sdc or such) and that there are mount points for WSLg (the helper distro that enables tools to run seamlessly with graphics and audio).

In WSL 1, drvfs is used directly, which means that performanc­e between Windows and Linux filesystem­s was a little more performant. WSL 2’s use of a 9p server to wrangle these transfers slows things down, but also enables more flexibilit­y and security. For this reason, WSL 1 will outperform WSL 2 at ‘across the boundary’ transfers. So if you need to run, say, a database in WSL but for some reason its files must be visible in Windows, then you should downgrade to WSL 1. It’s more reasonable to try and keep heavy transfers within the WSL bubble. It’s even possible to add additional drives to your machine and format them as Ext4 (or whatever is your favourite Linux filesystem) from within WSL. You won’t be able to see them from the Windows side (at least not without additional tooling), but transferri­ng large files or doing lots of random I/O should be much swifter.

Newspapers in English

Newspapers from Australia