Microsoft warned all Windows 10 users who have installed the Windows Subsystem for Linux recently that they should not modify Linux files on Windows using apps, tools, scripts or other means.
The Windows Subsystem for Linux (WSL) is part of Microsoft's new Windows 10 operating system. It is not installed by default however and needs to be enabled by a user or administrator before it becomes available.
To enable Bash on Windows 10, a user would have to enable the Developer Mode first in the Settings app under Update & Security > For Developers. Once done, it is necessary to open the "Turn Windows features on or off" option in the classic Control Panel, and select Windows Subsystem for Linux to enable the feature.
Windows 10 downloads Bash then from the Store. Once that operation completes, you may fire it up by writing bash on the command prompt.
Microsoft warns users of Windows 10 not to edit any Linux files that are part of the Linux subsystem using Windows apps, scripts, console commands or other means.
DO NOT, under ANY circumstances, create and/or modify Linux files using Windows apps, tools, scripts, consoles, etc.
The reason given is that creating or changing Linux files from Windows may result in data corruption or even a damaged Linux system.
Creating/changing Linux files from Windows will likely result in data corruption and/or damage your Linux environment requiring you to uninstall & reinstall your distro!
Microsoft refers to all Linux files that are part of WLS, and those are all stored under %localappdata%\lxss on the system drive.
The reason for this is that file metadata is handled differently on Linux than it is on Windows. Since WSL is stored in a NTFS folder, it is necessary that it "calculates and persists each Linux file's metadata in its NTFS extended attributes".
While WSL is capable of that, Windows apps, scripts, tools or programs are not. This means that create or modify events won't store any Linux file metadata.
Files without proper metadata may not open, write or read at all because of this.
Microsoft's solution is to store files that you need to use on Windows and Bash in separate directories.
When you access files on your Windows filesystem from within Bash, WSL honors the NT filesystem behaviors (e.g. case-insensitivity), permissions, etc. so you can easily access the same files using both Windows tools and Bash tools without having to copy files back and forth between filesystems.
While you might say that this is inconvenient if you use WSL regularly, it would be the same if you'd copy a NTFS file to a Linux partition, edit it, and copy it back.
Now You: Do you use Bash on Windows 10?
Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.
We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.
If you like our content, and would like to help, please consider making a contribution:
Ghacks is a technology news blog that was founded in 2005 by Martin Brinkmann. It has since then become one of the most popular tech news sites on the Internet with five authors and regular contributions from freelance writers.