You are not logged in.

#1 2024-12-06 13:31:48

Erwin Iosef
Member
Registered: 2024-05-22
Posts: 25

[SOLVED]NTFS Windows symbolic links not working

Greetings! Does the NTFS3 kernel driver support windows symbolic links pointing to another windows partition?(with the drive letter), I recently made the switch from NTFS-3G to NTFS3 and all my windows symlinks pointing to another drive broke. NTFS-3G driver has this working with the ./NTFS-3G file/directory I believe.

While researching about it I found that there were patches submitted to it but I don't know if they were applied. It's from 2022 as well. The bugzilla tracker reports the bug has been fixed and patches available.

https://bugzilla.kernel.org/show_bug.cgi?id=214833

https://lkml.iu.edu/hypermail/linux/ker … 07518.html

Last edited by Erwin Iosef (2024-12-08 15:40:48)

Offline

#2 2024-12-06 13:52:43

loqs
Member
Registered: 2014-03-06
Posts: 18,135

Re: [SOLVED]NTFS Windows symbolic links not working

The patch you linked was accepted in linux 6.2 https://github.com/torvalds/linux/commi … b5efc55839

Offline

#3 2024-12-06 13:55:50

Erwin Iosef
Member
Registered: 2024-05-22
Posts: 25

Re: [SOLVED]NTFS Windows symbolic links not working

That's good news! And thank you for replying soon. But then, why don't mine work?

Just to be sure, the symlinks with "My Documents" <--> to "C:/My Documents" should work right?

Never mind, I read the patch note again and I misinterpreted the information. My problem still exists but I still could do with any help for a solution. Many thanks again.

Last edited by Erwin Iosef (2024-12-06 15:26:10)

Offline

#4 2024-12-06 13:59:47

Erwin Iosef
Member
Registered: 2024-05-22
Posts: 25

Re: [SOLVED]NTFS Windows symbolic links not working

Oh and one more question, how do you get access to all directories on drive? What option do you use? In fstab I have the gid and uid set to 1000 and tried noacl and acl(for some reason the noacl didn't work, removed perhaps) with some folders not having the option to delete oe modify.

Last edited by Erwin Iosef (2024-12-06 14:00:11)

Offline

#5 2024-12-06 15:20:54

seth
Member
Registered: 2012-09-03
Posts: 59,896

Re: [SOLVED]NTFS Windows symbolic links not working

The patch wrote:

We have no way of knowing if the target is for the current  mounted device or not so we just assume it is.

symlinks with "My Documents" <--> to "C:/My Documents"

isn't gonna work - how is the filesystem or really anyone supposed to know what device "C:/" is?
NTFS supports mounts (yes, on windows) - I'd rather use those consitently.

Online

#6 2024-12-06 15:27:24

Erwin Iosef
Member
Registered: 2024-05-22
Posts: 25

Re: [SOLVED]NTFS Windows symbolic links not working

Right right. I just made the edits. Still wish there was a way but I guess not. Thank you for replying again. Marking as solved. Also, great suggestion, I'll try that.
I could still use advice on help with permissions though.

Last edited by Erwin Iosef (2024-12-06 15:41:23)

Offline

#7 2024-12-06 16:19:34

seth
Member
Registered: 2012-09-03
Posts: 59,896

Re: [SOLVED]NTFS Windows symbolic links not working

What's the output of "mount" with the ntfs3 device mouted?
https://docs.kernel.org/filesystems/ntfs3.html
ACL are the posix ones, you can enable that or not.
The filesystem should™ be flattened for the given uid/gid - there's some experimental permission mapping in ntfs-3g, not sure whether anything like this is currently planned for ntfs3

Online

#8 2024-12-06 17:23:50

Erwin Iosef
Member
Registered: 2024-05-22
Posts: 25

Re: [SOLVED]NTFS Windows symbolic links not working

It shows type ntfs3 (rw,nosuid,nodev,relatime,uid=1000,gid=1000,dmask=0022,fmask=0022,iocharset=utf8,prealloc,x-gvfs-show).
Also @seth I tried the windows mount option. It didn't work and Linux just doesn't recognise the mount folder or considers it a bad file with cd'ing to it giving "Invalid Argument"

Offline

#9 2024-12-06 17:26:10

Erwin Iosef
Member
Registered: 2024-05-22
Posts: 25

Re: [SOLVED]NTFS Windows symbolic links not working

seth wrote:

- there's some experimental permission mapping in ntfs-3g, not sure whether anything like this is currently planned for ntfs3

I think there was such a thing with noaclrules but that option is nowhere to be found. Got removed maybe.

Offline

#10 2024-12-06 17:27:49

seth
Member
Registered: 2012-09-03
Posts: 59,896

Re: [SOLVED]NTFS Windows symbolic links not working

You'll still have to setup the mount under linux.
What happens then?

The mount should™ own all files to 1000:1000 (most likely your user) and the mount is rw - what kind of permission errors do you experience?

Edit:
https://wiki.archlinux.org/title/NTFS-3 … d_releases
https://docs.kernel.org/filesystems/ntfs3.html - you can add "acl" to the mount options, but that's not what you're looking for if you want to map windows ntfs access to linux.

Last edited by seth (2024-12-06 17:29:34)

Online

#11 2024-12-06 17:35:40

Erwin Iosef
Member
Registered: 2024-05-22
Posts: 25

Re: [SOLVED]NTFS Windows symbolic links not working

I can't edit symlinks or write to certain folders like "Documents/StartMenu" of my windows user.
And I did setup the mount with bind under Linux but it says: "mount: /media/user/Windows/Edrive: wrong fs type, bad option, bad superblock on /media/user/E:/My Docs, missing codepage or helper program, or other error."
Edit: Before you ask, I did check for typos.

Last edited by Erwin Iosef (2024-12-06 17:36:20)

Offline

#12 2024-12-06 17:42:57

seth
Member
Registered: 2012-09-03
Posts: 59,896

Re: [SOLVED]NTFS Windows symbolic links not working

I can't edit symlinks or write to certain folders like "Documents/StartMenu" of my windows user.

Please don't paraphrase, https://bbs.archlinux.org/viewtopic.php?id=57855
Post the actual IO as well as "stat" on the relevant paths (the symlink and the directories involved)

Also post the actual mount command used t o generate that output and

stat '/media/user/E:/'
stat '/media/user/E:/My Docs'

And if you're now going for bind mounts of subdirectories, you should not have to deal w/ symlinks, ntfs mounts etc et. pp anyway.

Is E:/My Docs a windows symlink?
Edit: in that case, just skip the middle-man and mount the target directly.

Last edited by seth (2024-12-06 17:43:23)

Online

#13 2024-12-06 18:00:42

Erwin Iosef
Member
Registered: 2024-05-22
Posts: 25

Re: [SOLVED]NTFS Windows symbolic links not working

Oh my apologies, here's the output(replace My Docs with My Games, just thought it'd be more simpler at first):

~$ mount | grep sdb3
/dev/sdb3 on /media/admin2/Windows 10 type ntfs3 (rw,nosuid,nodev,relatime,uid=1000,gid=1000,dmask=0022,fmask=0022,iocharset=utf8,prealloc,x-gvfs-show)

~$ stat '/media/admin2/E:/'
  File: /media/admin2/E:/
  Size: 8192            Blocks: 16         IO Block: 4096   directory
Device: 8,1     Inode: 5           Links: 1
Access: (0777/drwxrwxrwx)  Uid: ( 1000/  admin2)   Gid: ( 1000/  admin2)
Access: 2024-12-06 22:37:35.873787000 +0530
Modify: 2024-12-02 20:27:30.009194300 +0530
Change: 2024-12-02 20:27:30.009194300 +0530
 Birth: 2024-08-01 20:37:29.070070700 +0530

~$ stat '/media/admin2/E:/My Games'
  File: /media/admin2/E:/My Games
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 8,1     Inode: 2655        Links: 1
Access: (0755/drwxr-xr-x)  Uid: ( 1000/  admin2)   Gid: ( 1000/  admin2)
Access: 2024-12-06 21:42:06.744122200 +0530
Modify: 2024-12-01 19:40:06.019309900 +0530
Change: 2024-12-03 13:28:38.832533200 +0530
 Birth: 2023-03-12 11:28:02.406204900 +0530

I fear I explained my actions wrongly, please allow me to clarify.

You see, after learning that  I can't get Linux to work with the symlinks, I thought I could use your earlier suggestion and do:
1) Mount the target folder into a drive path in windows and create a symlink to that path since it'd be on the same drive and Linux could recognise that symlink.
2)Bind mount the target path in Linux to the drive path folder since it's not going to do it on its own. The symlink would then work for both OSes and everyone would be happy.
It was a stretchy work around but it was I tried doing.

But in hindsight you maybe right and I created an unnecessary middle-man, I just want the windows symlink to work anyhow. Maybe I should abandon that path entirely and figure out something else.

Offline

#14 2024-12-06 18:10:42

seth
Member
Registered: 2012-09-03
Posts: 59,896

Re: [SOLVED]NTFS Windows symbolic links not working

'/media/admin2/E:/My Games/' is a directory path belonging to you - you cannot

mkdir /tmp/foo
sudo mount --bind '/media/admin2/E:/My Games' /tmp/foo

?

Wrt your further explanations:
the windows mount is "lost" when you shutdown windows, the path probably is meaningless out of context/on linux.

You need to mirror the path geometry on windows and linux, there's no carry-over because in doubt windows will still mount or symlink E:/whatever and linux has no idea what partition "E:" is. Ie. you configure the systems to have the same data show up in the same paths - not configure one system and try  the other system to pick that up. That's not gonna happen.

Sidebar, likely see the 3rd link below. Mandatory.
Disable it (it's NOT the BIOS setting!) and reboot windows and linux twice for voodo reasons.

Online

#15 2024-12-07 04:29:58

Erwin Iosef
Member
Registered: 2024-05-22
Posts: 25

Re: [SOLVED]NTFS Windows symbolic links not working

Of course I can.

~$ mkdir /tmp/foo
~$ sudo mount --bind '/media/admin2/E:/My Games' /tmp/foo
[sudo] password for admin2:
~$

Wrt your further explanations:
the windows mount is "lost" when you shutdown windows, the path probably is meaningless out of context/on linux.

I know but the folder should still remain and be usable right? In my case however, in Linux it doesn't. 
The folder does turn into a regular folder when I remove the mount volume path in windows.

You need to mirror the path geometry on windows and linux, there's no carry-over because in doubt windows will still mount or symlink E:/whatever and linux has no idea what partition "E:" is. Ie. you configure the systems to have the same data show up in the same paths - not configure one system and try  the other system to pick that up. That's not gonna happen.

Yeah. I guess not.

Sidebar, likely see the 3rd link below. Mandatory.
Disable it (it's NOT the BIOS setting!) and reboot windows and linux twice for voodo reasons.

I did some time ago but I'll check again. Thank you for your time.
EDIT: Alright I disabled EnableHibernateDefault in the registry after checking all other options. Rebooted both OSes twice, no luck.

Last edited by Erwin Iosef (2024-12-07 04:58:25)

Offline

#16 2024-12-07 08:47:58

seth
Member
Registered: 2012-09-03
Posts: 59,896

Re: [SOLVED]NTFS Windows symbolic links not working

The fast start condition likely isn't relevant to your NTFS struggles.

Ok, let's say ntfs permanently flags the mount folder and it cannot be used.
You can still directly symlink or bind-mount ~/MyDocuments to the actual ntfs target directory, bypassing any symlinks or ntfs mounts, no?


If you wanted to link C:\foo to D:\bar on windows and linux, things will get more dicy.
* the windows C:\foo "symlink" is unusuable on linux (because crossing devices)
* the windows D:\bar mountpoint is unusuable on linux
=> you're not getting around manipulating the filesystem (ie. eg. "mv /media/admin2/C:/foo /media/admin2/C:/foo.lnk; ln -s /media/admin2/D:/bar /media/admin2/C:/foo" after mounting and "mv /media/admin2/C:/foo.lnk /media/admin2/C:/foo" before unmounting /media/admin2/C:)

Online

#17 2024-12-08 07:27:00

Erwin Iosef
Member
Registered: 2024-05-22
Posts: 25

Re: [SOLVED]NTFS Windows symbolic links not working

Right, I solved the permissions issue by manually editing it, in Plasma you can do this by right clicking the folder/file and editing permissions to your group.
And I also did a workaround on the symlink situation that actually works, I'd like to hear your thoughts on it.
https://pastebin.com/6exn7qzB

Offline

#18 2024-12-08 07:55:29

seth
Member
Registered: 2012-09-03
Posts: 59,896

Re: [SOLVED]NTFS Windows symbolic links not working

You can skip " /path/to/Edrive /path/to/E:/ auto, none bind,nofail 0 0" and just mount the relevant drive/partition directly into /path/to/Edrive (udisks should™ honor such fstab entries)

Online

#19 2024-12-08 08:07:27

Erwin Iosef
Member
Registered: 2024-05-22
Posts: 25

Re: [SOLVED]NTFS Windows symbolic links not working

Right, can you tell me how to do that?
Also, it seems I made a mistake in the last line, the mount paths should be reversed with:

/path/to/E:/  /path/to/Edrive auto, none bind,nofail 0 0

Offline

#20 2024-12-08 08:28:12

seth
Member
Registered: 2012-09-03
Posts: 59,896

Re: [SOLVED]NTFS Windows symbolic links not working

You just add a regular fstab entry for the partition

UUID=ABCDEF /path/to/Edrive     	ntfs3      	<options>	0 0

Online

#21 2024-12-08 08:43:47

Erwin Iosef
Member
Registered: 2024-05-22
Posts: 25

Re: [SOLVED]NTFS Windows symbolic links not working

Yes but that is in the event that you don't really want E: to be a seperate mount as well, in my case I want E: to be mounted at Edruve and also be a seperate mount. Would that still work with this?

Offline

#22 2024-12-08 15:21:58

seth
Member
Registered: 2012-09-03
Posts: 59,896

Re: [SOLVED]NTFS Windows symbolic links not working

No.
You could manually mount the device twice instead of binding it, but that's pointless.

In this case: carry on wink

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Online

#23 2024-12-08 15:39:47

Erwin Iosef
Member
Registered: 2024-05-22
Posts: 25

Re: [SOLVED]NTFS Windows symbolic links not working

Yes of course and thank you so much as well, I wouldn't have created the workaround without your suggestion. Marking as solved now ?
Binding is more the standard solution, I mean that's what it literally is for.

Offline

Board footer

Powered by FluxBB