About the filesystem mounted on
- What exactly is /mnt/c/Users/ compared with C:\Users\? It seems they are one in the same---so what is /mnt/c/?
In contrast to Windows, Linux (and the other systems based on Unix) use a single folder structure independent of the number of disks you have. If you have multiple disks, all these disks must me mounted into the folder structure at some point.
- Typically, all the disks (different than the used to boot the system) are mounted in a folder named
WSL has an special type of filesystem named DrvFS that gives you access to the disks used in windows. You can use DrvFS to mount, not only your windows filesystem, but also network disks and other media types.
- In WSL, by default, the
C: disk in windows is mounted under
- If you have another disk, for instance a
D: disk in windows, it will be mounted under
The files you can see in
/mnt/c are the same you have in
C:. If you modify some file, you will get the changes in the windows too.
You may use the
mount command to access other types of media (e.g. removable drives or network shares).
About the location of
- How can I view the files in /home/ using the Windows File Explorer? Not that I'd really ever want to---I'm just trying to get a feel for how Windows is organizing this Subsystem for Linux thing.
In WSL, all the linux filesystem is located under a Windows folder. The location of the folder depends on the version of Windows and of the WSL distribution you are using.
- Initial versions of WSL store the linux filesystem in
- WSL distributions installed from the Windows Store, starting in Windows Build 16215 (mid of 2017), use a folder like
%LOCALAPPDATA%\Packages\...\LocalState\rootfs. The name of the package varies depending on the distribution (e.g. it is different for Ubuntu than for Debian)
- Linux distributions installed using other tools, such as lxRunOffline or WSL-DistroLauncher may store the linux filesystem into any location.
You may check many options to know the location of the WSL folder. For instance, I think the easiest option is to use lxRunOffline to know the installation folder.
## You can use lxrunoffline to check which WSL distributions have installed
## using: lxrunoffline list
C:\> lxrunoffline list
## And you can use it to get the location of any of these WSL installations
## using: lxrunoffline get-dir -n <name of distribution>
C:\> lxrunoffline get-dir -n backup
C:\> lxrunoffline get-dir -n Ubuntu
Once you know the location of the installation folder, the
/home/<username> is under
- For instance, if your installation folder is
/home/<username> is in
NOTE: Both Linux and Windows stores file permissions in different ways. Nowadays, the WSL DrvFS stores the Linux permissions as Streams (metadata) attached to the files you can see in Windows. Microsoft does not recommend to modify linux files using Windows programs. It is possible that some Windows applcations damage the linux permissions without notice it.