Skip to content

New --links parameter not working with mount? #2975

Closed

Description

@ErAzOr2k

What is the problem you are having with rclone?

I uploaded some symlinks with "rclone copy" and parameter "--links" to my gdrive remote.
As expected, files with the extension "rclonelink" are generated.

I now expect that the rclonelink files are not visible via rclone mount. Instead they should be translated to symlinks. But actually it is not the case. Only plain rclonelink files are visible.

Additionally I'm also not able to create symlink. Instead I get I/O error (see below).

What is your rclone version (output from rclone version)

rclone v1.46-DEV (latest commit as of today)

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Linux x64

Which cloud storage system are you using? (eg Google Drive)

Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone --config /config/rclone.conf mount gdrive_decrypted:/ /mnt --allow-other --allow-non-empty --uid=1000 --gid=1000 --umask=007 --links --fast-list --rc--verbose

A log from the command with the -vv flag (eg output from rclone -vv copy /tmp remote:tmp)

ln -s /tmp/testfile testlink
ln: testlink: I/O error

Activity

  1. ErAzOr2k commented on Feb 16, 2019

    @ErAzOr2k
    Author

    Ok if I undetstand it correctly, it only works with local remote.
    Is it possible to implement this feature for drive remote?

  2. ncw commented on Feb 16, 2019

    @ncw
    Member

    I think this would have to be a new flag for mount, say --use-links or something like that which inteprets the .rclonelink files and turns them back into symlinks.

    Therefore you would be able to mount your drive remote, and have the symlinks appear as symlinks.

    Is that what is required do you think?

  3. added this to the Soon milestone on Feb 16, 2019
  4. ncw commented on Feb 16, 2019

    @ncw
    Member

    This probably wouldn't be too tricky if someone wanted to have a go?

  5. ErAzOr2k commented on Feb 16, 2019

    @ErAzOr2k
    Author

    I think this would have to be a new flag for mount, say --use-links or something like that which inteprets the .rclonelink files and turns them back into symlinks.

    Therefore you would be able to mount your drive remote, and have the symlinks appear as symlinks.

    Is that what is required do you think?

    yes, this is exactly the expected behavior :)

  6. felisucoibi commented on Aug 23, 2019

    @felisucoibi

    I hope this i implemented soon, i would like too mount to follow symlinks instead of show .rclonesymlink and e able to reate symlinks in the cloud (internally .rlclonelink) but for mount a symbolik one.

  7. diamondsw commented on Dec 23, 2019

    @diamondsw

    I was just wondering about this myself. It would certainly be useful if the mount layer could seamlessly translate rclonelink files back into symlinks (and bonus points if creating symlinks on a rw rclone mount would create rclonelink files behind the scenes).

  8. thekiefs commented on Jun 13, 2020

    @thekiefs

    I would also love this feature!

  9. kocane commented on Oct 15, 2020

    @kocane

    @ncw Any plans on implementing this? would be very useful. Had plans on using 'UrBackup' with Google Drive mount but as it's built completely on symlinks, it don't seem possible :-(

  10. mikwaluk commented on Nov 24, 2020

    @mikwaluk

    It would be great if you could add this feature! :)

  11. dinoboy197 commented on Nov 27, 2020

    @dinoboy197

    I think this would have to be a new flag for mount, say --use-links or something like that which inteprets the .rclonelink files and turns them back into symlinks.

    Therefore you would be able to mount your drive remote, and have the symlinks appear as symlinks.

    Is that what is required do you think?

    Hi @ncw - from the documentation for the --links flag in local mode:

    --links, -l
    ...
    If you supply this flag then rclone will copy symbolic links from the local storage, and store them as text files, with a '.rclonelink' suffix in the remote storage.
    ...
    This flag applies to all commands.
    

    Considering that the documentation written indicates that the flag applies to all commands, do you think it would reasonable instead to simply allow the pre-existing --links flag to work both for sync as well as mount operations?

  12. dinoboy197 commented on Jan 19, 2021

    @dinoboy197

    I've created a draft PR of a code addition to have the mount command support symbolic links. No extra mount parameters are needed; this works without any extra --links command line arguments.

    I still need to add documentation and tests, but it should be ready for use. For anyone who is still interested in this feature, please try out my branch and let me know if that works for you! I hope to have the PR ready for review in the next week or two.

  13. 154 remaining items

  14. ncw commented on Dec 13, 2024

    @ncw
    Member

    I've merged this to master now which means it will be in the latest beta in 15-30 minutes and released in v1.69

    Thank you @pasnox

    Any more testing gratefully received :-)

    BTW this was the resolution to the --links flag problem which gives the most flexibility at the cost of a few more flags (!).

    fs: make --links flag global and add new --local-links and --vfs-links flag
    
    Before this change the --links flag when using the VFS override the
    --links flag for the local backend which meant the local backend
    needed explicit config to use links.
    
    This fixes the problem by making the --links flag global and adding a
    new --local-links flag and --vfs-links flags to control the features
    individually if required.
    
  15. added a commit that references this issue on Dec 17, 2024
  16. i-api commented on Feb 8, 2025

    @i-api

    Hi @ncw, sadly it seems symlinks don't seem to work on the mounted "crypt" type.
    I am able to create symlinks inside the mount. However, after I unmount, or sometimes even randomly even if i haven't unmounted, the symlinks are being deleted erroneously.
    Are the flags I'm using wrong? I'm just mounting local to local.

    rclone --version                                                                                    
    rclone v1.69.0
    - os/version: darwin 14.2.1 (64 bit)
    - os/kernel: 23.2.0 (arm64)
    - os/type: darwin
    - os/arch: arm64 (ARMv8 compatible)
    - go/version: go1.23.4
    - go/linking: dynamic
    - go/tags: cmount
    
    
    rclone mount \
            --crypt-remote ~/my_crypt_dir \
            :crypt: ~/folder_123 \
            --crypt-password  $(rclone obscure "12345") \
            --crypt-password2 $(rclone obscure "12345") \
            --links \
            --metadata \
            --vfs-cache-mode=writes \
            --vfs-cache-max-size=500M \
            --vfs-cache-poll-interval=5s \
            --crypt-filename-encoding "base32768" 
    
    bash-3.2$ cd ~/folder_123 
    bash-3.2$ ln -s test.txt test_symlink       # creating a symlink file with ln -s
    bash-3.2$ readlink test_symlink              # verify the symlink
    test.txt
    bash-3.2$ cd ~/
    bash-3.2$ ls -la folder_123/
    total 16
    drwxr-xr-x@  1 a  staff     0 Feb  7 15:50 .
    drwxr-x---+ 49 a  staff  1568 Feb  7 15:48 ..
    -rw-r--r--   1 a  staff    18 Feb  7 15:50 test.txt
    lrw-r--r--   1 a  staff     8 Feb  7 15:51 test_symlink -> test.txt
    bash-3.2$ cat folder_123/test.txt
    this is test file
    bash-3.2$ cat folder_123/test_symlink
    this is test file
    bash-3.2$
    
    # after unmounting and remounting the symlink file is erroneously deleted?
    
    bash-3.2$ ls -la folder_123/
    total 8
    drwxr-xr-x@  1 a  staff     0 Feb  7 15:52 .
    drwxr-x---+ 49 a  staff  1568 Feb  7 15:48 ..
    -rw-r--r--   1 a  staff    18 Feb  7 15:50 test.txt
    bash-3.2$
    
    
  17. hongkongkiwi commented on Feb 8, 2025

    @hongkongkiwi

    You may be better off to open a new issue and link it to this.

  18. ncw commented on Feb 8, 2025

    @ncw
    Member

    @i-api that does look like a bug. Can you put it in a new issue please? Thanks

  19. despian commented on Feb 8, 2025

    @despian

    I'm also using crypt and it seems to be working as expected for me. Though I'm using the --vfs-links switch as well as --vfs-cache-mode full.

  20. i-api commented on Feb 10, 2025

    @i-api

    @i-api that does look like a bug. Can you put it in a new issue please? Thanks

    sure @ncw #8367

  21. i-api commented on Feb 10, 2025

    @i-api

    I'm also using crypt and it seems to be working as expected for me. Though I'm using the --vfs-links switch as well as --vfs-cache-mode full.

    i tried this thank you sir, unfortunately it didn't work as expected for me

  22. pjhfggij commented on Feb 23, 2025

    @pjhfggij

    released in v1.69

    nice

  23. locked as resolved and limited conversation to collaborators on Feb 24, 2025
  24. added a commit that references this issue on Nov 21, 2026
    beb90bc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions