Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Do not change Linux files using Windows apps and tools


  • Please log in to reply
7 replies to this topic

#1 Jeremy_C

Jeremy_C

  • Members
  • 189 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:United States
  • Local time:05:44 PM

Posted 17 November 2016 - 07:11 PM

DO NOT, under ANY circumstances, create and/or modify Linux files using Windows apps, tools, scripts, consoles, etc.

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!

If WSL can’t find Linux file metadata for a given file, it assumes the file is corrupted/damaged, and will likely fail to open/read the file correctly, causing apps, tools, etc. to fail and in some cases, delete files seen as “corrupt”!

File metadata (e.g. permissions, ownership, timestamps, etc.) is represented differently in Linux than in Windows...

 

Read more at: https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-not-change-linux-files-using-windows-apps-and-tools/

.

 

On a side-note, this might explain why I had all sorts of trouble with an external drive (Mint Ate My Portable HDD) that I was occasionally swapping back and forth between Linux Mint and Win7. Or maybe that fiasco was due to something else...

 

Anyway, as a new Linux user, this blog post probably just saved me some headaches down the road, so it seemed worth sharing just in case in more 'nix noob's like me are running two systems, or dual-booting, or whatever else may apply. :)


A programmer's wife sends him to the store for a gallon of milk,

and she adds the instructions, "If there are eggs, buy a dozen."

The programmer goes to the store and returns home with 13 gallons of milk.


BC AdBot (Login to Remove)

 


#2 Viper_Security

Viper_Security

  • Members
  • 816 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:127.0.0.1
  • Local time:02:44 PM

Posted 17 November 2016 - 07:23 PM

Good Post!  :thumbsup2:  :thumbsup2:

 

And yes that is NOT a good idea since most Linux's run level is higher than an NTFS OS. (at least it used to be) That and the FileTree is completely different. :P

 

Windows being NTFS and *Nix being EXT*

 

and i swap my 1TB external between windows linux and mac, and have had no issues o.0 I'm curious now. 


Edited by Viper_Security, 17 November 2016 - 07:25 PM.

    IT Auditor & Security Professional

hQBT2G3.png


#3 TsVk!

TsVk!

    penguin farmer


  • Members
  • 6,230 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:The Antipodes
  • Local time:07:44 AM

Posted 17 November 2016 - 08:02 PM

This refers to system files though, not general usage data. If I understand correctly...

 

 

...if you use a Windows app/tool/console to create and/or modify a file under your distro root, it won’t have any Linux file metadata (e.g. permissions, owner, timestamps, etc.) stored in its extended attributes...

 

Why one would use Windows to modify Linux system files I'm not really sure. Possibly just a poor understanding of working with Linux, so use Win to modify Linux and the balloon pops. (mustn't let it touch the grass)



#4 NickAu

NickAu

    Bleepin' Fish Doctor


  • Moderator
  • 12,360 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:127.0.0.1 Australia
  • Local time:07:44 AM

Posted 17 November 2016 - 08:13 PM

 

Why one would use Windows to modify Linux system files I'm not really sure.

I cant see how I could modify Linux system files with Whingedos, My laptop is dual boot Whingedos on NTFS partition and Ubuntu on Ext partition, My Whingedos installation is blissfully unaware that my Ubuntu install even exists.



#5 TsVk!

TsVk!

    penguin farmer


  • Members
  • 6,230 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:The Antipodes
  • Local time:07:44 AM

Posted 17 November 2016 - 08:15 PM

I'm sure if you really tried you could hose it up mate :whistle:



#6 Guest_hollowface_*

Guest_hollowface_*

  • Guests
  • OFFLINE
  •  

Posted 17 November 2016 - 09:17 PM

when it comes to Bash on Windows: DO NOT, [...] create and/or modify Linux files using Windows apps

If WSL can’t find Linux file metadata [...] it assumes the file is corrupted/damaged

-REF:https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-not-change-linux-files-using-windows-apps-and-tools/
 
 

Windows Subsystem for Linux (WSL).

-REF:https://blogs.msdn.microsoft.com/wsl/2016/04/22/windows-subsystem-for-linux-overview/
 
 

WSL calculates and persists each Linux file’s metadata in its NTFS extended attributes. [...] Windows apps do not know how to

Windows tools implement different strategies to handle file updating [...] NT file extended properties are often not persisted and are “lost”

-REF:https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-not-change-linux-files-using-windows-apps-and-tools/

This article is discussing the Bash on Windows 10 feature, and pointing out that (according to the article) when you edit files managed by WSL with an external Windows application, the Windows app won't write the Linux file attributes, and depending on how it performs the write, may even cause loss of existing attributes.


Edited by hollowface, 18 November 2016 - 12:22 AM.


#7 TsVk!

TsVk!

    penguin farmer


  • Members
  • 6,230 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:The Antipodes

Posted 17 November 2016 - 11:16 PM

Good point at the bottom there hollowface.

 

You really didn't need to put the same link that's in the OP 5 times in your post though mate.



#8 wizardfromoz

wizardfromoz

  • Banned
  • 2,799 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:07:44 AM

Posted 18 November 2016 - 12:22 AM

 

You really didn't need to put the same link that's in the OP 5 times in your post though mate.

 

Can't accuse the man of not quoting his sources, oh Northern One?

 

Nice one hf, nice one Jeremy :thumbsup:

 

WSL - gives a whole new meaning to "Windows can go and whistle (WSL)"? :whistle:

 

Avagudweegend

 

:wizardball: Wizard






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users