How to know if my Linux distro is corrupt - Windows Subsystem for Linux

I have the Windows Subsystem for Linux installed on my Windows 10 laptop, and I have Ubuntu-20.04 installed there. Today, I read an old blog post from Microsoft, Do not change Linux files using Windows apps and tools, which says...

DO NOT, under ANY circumstances, access, create, and/or modify Linux files inside of your %LOCALAPPDATA% folder using Windows apps, tools, scripts, consoles, etc.

Opening > files using some Windows tools may read-lock the opened files > and/or folders, preventing updates to file contents and/or metadata, > essentially resulting in corrupted files/folders.

Creating/changing Linux files in your Appdata folder from Windows willlikely result in data corruption and/or damage your Linux environment requiring you to uninstall & reinstall your distro!

Why is this?

File metadata (e.g. permissions, ownership, timestamps, etc.) is stored for every file, folder, etc., on your storage devices. Alas, file metadata representation differs from one OS to another: Windows file metadata is different from Linux file metadata.

While it’s the OS’ job to store and update your file metadata, most of Windows doesn’t know anything about Linux, nor Linux file metadata, and doesn’t automatically add or update Linux file metadata for all Windows files because that would impose an unnecessary overhead on the vast majority of Windows users who will never run WSL.

It’s WSL’s job to write/update Linux file metadata for all the files under your Linux filesystem root (i.e. /), storing the Linux metadata in each file’s NTFS extended attributes. WSL also synthesizes pseudo metadata for most of the files in your Windows filesystem.

The problem arises when, for example, you use a Windows app/tool to open, create and/or modify a file under your distro root: Since the file was created with a Windows tool, the file won’t have any Linux file metadata (e.g. permissions, owner, access/update timestamps, etc.). Thus, to Linux, (which only receives Linux file metadata), the file may be reported as empty, may not even exist, or may have some metadata, but that metadata may not reflect the file’s details resulted in the file’s contents being corrupted.

That's all relatively clear I suppose...just, I read it too late. I'm pretty sure I did copy some files in/out of my home directory in that Appdata folder using standard Windows applications. I can't remember off-hand, but I may well have opened files with Notepad++ for example, edited them, and saved them.

So, if I take the advice at face value, it sounds like my Linux distro is "likely corrupted/damaged". But my question is, how can I know for sure? I've never noticed any strange behaviour there. I'd like to know if I should uninstall and reinstall.

2 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like