Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
05-13-2025, 04:14 PM
|
#1
|
|
Member
Registered: Oct 2022
Posts: 96
Rep:
|
Experiment: How Windows deals with Linux symbolic links.
[ Log in to get rid of this advertisement]
This is not a question, I am just sharing my observations. It seems no one has documented this before. I did these tests both with Windows 7 and 10 and both behave the same in this regard.
I created a symlink on NTFS on Linux:
Code:
ln -s example.txt symlink
On Windows, it appears as a system file (a file with the "system" attribute set and the gear icon). Its contents appear like this in Notepad:
"example.txt" is replaced with the name of the source file.
Edit: It can also contain paths:
Code:
湉硴乌ŋsubfolder/example.txt
The symbolic link can be renamed and moved and even copied on Windows and still remains a valid symlink on Linux. But if you change the content in Notepad and then save the changes, it will also lose its symlink status.
If you edit its attributes on Windows (properties window or attrib command), it loses its symlink status. Tested again. attrib -s removes symlink status, but adding read-only attribute does not. Also, attrib +s reinstated symlink status.
Hardlinks created on Linux work on Windows just the same: if you change the content of one file, so does the content of the other file. The attributes also synchronize between hardlinks on Windows.
If you want to work with links under both Linux and Windows, it is best to use hardlinks because Windows does not understand Linux symlinks and Linux file managers do not recognize Windows .lnk files. At least not yet.
FAT32 and exFAT do not support Linux symlinks and hardlinks at all. It seems those file systems are intended to be as simple as possible to make it easier to implement them on pretty much all devices, including simpler devices like compact cameras and HiFi with USB ports and car radios, so they lack advanced features like symlinks, hardlinks, compression, journaling, POSIX file names, sparse files, resident files (content of very short files stored inside INDX entry).
(I hereby release this post into the public domain under CC0 1.0.)
Last edited by exerceo; 05-13-2025 at 04:45 PM.
Reason: new observation
|
|
|
|
05-14-2025, 12:30 AM
|
#2
|
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,374
|
|
|
|
1 members found this post helpful.
|
05-14-2025, 12:39 AM
|
#3
|
|
Senior Member
Registered: Sep 2004
Distribution: slackware
Posts: 4,839
|
Quote:
Originally Posted by exerceo
I created a symlink on NTFS on Linux
|
You're brave.
Which NTFS filesystem driver do you use in Linux? I don't trust NTFS enough to use it anywhere outside of Windows.
|
|
|
1 members found this post helpful.
|
05-14-2025, 03:37 PM
|
#4
|
|
Member
Registered: Oct 2022
Posts: 96
Original Poster
Rep:
|
Is NTFS bad?
Quote:
Originally Posted by rkelsen
You're brave.
Which NTFS filesystem driver do you use in Linux?
|
It is mounted as "fuseblk", which is NTFS-3G as far as I remember. I tested it with ntfs3 and symlinks created under fuseblk (ntfs-3g) do not appear as symlinks on ntfs3, but new symlinks can be created. Also, ntfs3 shows file birth times unlike fuseblk.
Here is a hexdump of the symbolic link. It is a symbolic link to a file called "hardlink", not a hardlink itself. It looks like the file path is UTF-16 encoded (two bytes per character), and there is "IntxLNK" at the beginning.
Code:
00000000 49 6e 74 78 4c 4e 4b 01 68 00 61 00 72 00 64 00 |IntxLNK.h.a.r.d.|
00000010 6c 00 69 00 6e 00 6b 00 |l.i.n.k.|
00000018
Quote:
Originally Posted by rkelsen
I don't trust NTFS enough to use it anywhere outside of Windows.
|
Why not? Because it is proprietary? Or is it bad for other reasons?
NTFS was useful for file transfer between {Linux} and {Windows 7 or Vista} because they can only mount unclean exFAT volumes as read-only, so chkdsk had to be run, and FAT32 has limited usefulness for an obvious reason. Windows 10 thankfully allows writing to unclean exFAT volumes. I don't know about Windows 8/8.1.
|
|
|
|
05-14-2025, 06:36 PM
|
#5
|
|
Senior Member
Registered: Sep 2004
Distribution: slackware
Posts: 4,839
|
Quote:
Originally Posted by exerceo
Why not? Because it is proprietary?
|
Yes. Most support for NTFS outside of Windows has had to be reverse engineered.
No operating system written outside Microsoft can ever implement NTFS 100% correctly because there are parts of it which Microsoft keeps secret.
The Paragon driver in the kernel goes further than any other Linux NTFS driver ever has, but there remains an element of risk whenever you use NTFS outside of a Windows environment. We can debate the degree of risk, but nothing will change the fact that the risk exists while NTFS remains proprietary.
This risk doesn't exist at all under Linux with, for example, ext4.
|
|
|
1 members found this post helpful.
|
05-15-2025, 12:14 AM
|
#6
|
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,374
|
Quote:
Originally Posted by exerceo
NTFS was useful for file transfer between {Linux} and {Windows 7 or Vista} because they can only mount unclean exFAT volumes as read-only, so chkdsk had to be run, and FAT32 has limited usefulness for an obvious reason. Windows 10 thankfully allows writing to unclean exFAT volumes. I don't know about Windows 8/8.1.
|
I don't think linux allows writing on any "dirty" volumes. Also Windows restricts it, that is just a "trick". And in general it is not a good idea (to write to an unclean device).
Anyway, NTFS was useful because there were no better/other possibilities, otherwise in the linux world you need to avoid ntfs (if possible).
We have now "native" ntfs support on linux, thanks to the mentioned paragon driver (called ntfs3), which is much better that the old ntfs-3g, but still not an "official", microsoft certified software.
|
|
|
|
05-15-2025, 02:52 AM
|
#7
|
|
Senior Member
Registered: Sep 2014
Distribution: Slackware
Posts: 1,913
Rep: 
|
That ntfs3 driver is mostly good, writes fast, 99% of the time there was no problem at all.
There was one time it broke hard, can't remember the exact details or output but I know how it started.
When I went to unpack a large zip file from ext4 to ntfs and it didn't complete properly for some reason, I've tried to delete the output files and couldn't.
So I unpacked from ext4 to ext4 and did an overwrite of those ntfs files, but then it was so messed up the chkdsk verification took few hours because $MFT seemed corrupt.
After those few hours of $MFT verification it was fine, I think only windows chkdsk can fix it if/when it happens.
|
|
|
|
05-15-2025, 07:27 AM
|
#8
|
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 11,270
|
My advice in all such cases is: "Go to Windows," and set up the filesystem the way you want it. Then, access the Windows material as a remote volume hosted by Windows. They have very solid networking support.
|
|
|
|
Today, 06:10 PM
|
#9
|
|
Member
Registered: Oct 2022
Posts: 96
Original Poster
Rep:
|
NTFS folders with colons and pipe characters
Quote:
Originally Posted by rkelsen
We can debate the degree of risk, but nothing will change the fact that the risk exists while NTFS remains proprietary.
|
I can confirm that. I have an NTFS drive with some folders with POSIX-only characters (":" and "|") that were created by saving pages on an older Firefox version on Linux which did not filter those characters. Now those folders are inaccessible. When trying to list their contents on Linux, I get an input/output error. This only happened on some folders, not all. Some others with those characters are prefectly readable. I have not managed to recreate this bug.
There are no folders without those characters that are unreadable, so it must somehow be related to those characters.
While Windows does not support characters like the colon ":" and pipe "|", NTFS has a POSIX subsystem (even Microsoft says so) and therefore does normally support such characters.
Probably running chkdsk from Windows would make the contents accessible again inside found.000, but before that I'll have to back up anything else because I don't trust chkdsk not to cause some unwanted side effects.
So while NTFS can indeed "blend into" a Unix environment, it is pushing its limits.
|
|
|
|
All times are GMT -5. The time now is 06:12 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|