Code Monkey home page Code Monkey logo

Comments (15)

BachoSeven avatar BachoSeven commented on August 23, 2024

Probably a duplicate of #1; see https://aur.archlinux.org/packages/ntfs3-dkms/?O=60&PP=10 for explanations: basically ntfs-3g creates its own fake versions of a symlink which are not even supported by Windows, so their use is limited. I suggest you replace them by re-creating them using ntfs3 if you wish to have properly working, cross-platform(meaning both on linux and windows), "symlinks".

from ntfs3.

simona70 avatar simona70 commented on August 23, 2024

yes, but it's an annoying thing :-)
I'd like to switch from one driver to another in a "transparent" way without having to change the contents of the disc from time to time.
but thanks for reply.

from ntfs3.

BachoSeven avatar BachoSeven commented on August 23, 2024

If you wanted to "convert" all of the symlinks in the ntfs partition from the "fake" ntfs-3g type to the ntfs3 type, all you would need to do is:

  • Mount your NTFS partition using ntfs-3g (i.e. mount -t ntfs)
  • cd /root/of/your/ntfs/partition
  • find -type l, which will tell you all the symlinks present in the partition
  • run realpath SYMLINK on all of them, and save both the path and realpath of the symlink in a file for later
  • unmount the NTFS partition, and re-mount it using mount -t ntfs3 for the paragon fs
  • recreate the symlinks :)
    just leaving this here for anybody who is looking to do what I needed to do for this

from ntfs3.

simona70 avatar simona70 commented on August 23, 2024

from ntfs3.

BachoSeven avatar BachoSeven commented on August 23, 2024

Sorry, I meant find -type l

from ntfs3.

simona70 avatar simona70 commented on August 23, 2024

from ntfs3.

BachoSeven avatar BachoSeven commented on August 23, 2024

you can do something like that using the -exec flag for find; which combined with -print will give you a list with two lines for each symlink, where each second line is the real path:

find -type l -print -exec realpath {} \;

You could then redirect this to a file using > script, and then make it into a script by editing the file, prepending #!/bin/sh, chmod +x script and then formatting the lines like
ln -sf realpath symlinkpath
for each entry; this way, once you re-mount it, you can automatise the process(-f is needed to overwrite the "fake" pre-existing links)

P.S. in order for the script to work you might want to have absolute paths; you can achieve this easily by running the above find command from /, like:

cd /
find /PATH/TO/ROOT/OF/NTFS (other flags)

P.P.S. you might want to quote ("path") all the paths as well in order for the script to work correctly

Edit: I was planning on doing everything manually, but since I took the time to try and automatise it for you I went ahead and tried the above, and can confirm it will work; i.e. I successfully recreated all the symlinks automatically. Might be useful if you have many; if you know how to use vim it will be helpful in formatting the script; for reference here is my script so you see how it should look.

from ntfs3.

simona70 avatar simona70 commented on August 23, 2024

from ntfs3.

simona70 avatar simona70 commented on August 23, 2024

from ntfs3.

simona70 avatar simona70 commented on August 23, 2024

from ntfs3.

BachoSeven avatar BachoSeven commented on August 23, 2024

That should be fine, as long as you stay in that directory, since the "%p" part is only a relative path. Although, you might have to add the -f flag to ln as I was saying earlier, since those symlinks already exist, so you need to -force re-creating them

from ntfs3.

simona70 avatar simona70 commented on August 23, 2024

from ntfs3.

BachoSeven avatar BachoSeven commented on August 23, 2024

realpath PATH gives you the absolute path; as for returning directly the absolute path from the output of find, you can use the trick I suggested above of launching the command from /:

P.S. in order for the script to work you might want to have absolute paths; you can achieve this > easily by running the above find command from /, like:

cd /
find /PATH/TO/ROOT/OF/NTFS (other flags)

from ntfs3.

simona70 avatar simona70 commented on August 23, 2024

from ntfs3.

BachoSeven avatar BachoSeven commented on August 23, 2024

With / do not give only links for this only mounted partition but entire system

Not if you give the "base path" as the first argument to find; i.e. find BASEPATH <Other Flags>

from ntfs3.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.