Page 1 of 3 123 LastLast
Results 1 to 10 of 28

Thread: USB DISK -- cannot access soft link when user change.

  1. #1
    Join Date
    Jun 2008
    Location
    South-West France
    Posts
    1,252

    Default USB DISK -- cannot access soft link when user change.

    Hello.

    A usb stick with script and data is filled by user 'user_1_vb'
    One folder contains all common data :
    Code:
    /run/media/user_1_vb/NEW_INSTALL_LINUX_USB/PRE_INSTALL/SLASH/backup_sys/000_COMMON/
    this folder (000_COMMON) contains the following sub folders :
    Code:
    Bin
    SBin
    Somewhere else the software use this folder :
    Code:
    /run/media/user_1_vb/NEW_INSTALL_LINUX_USB/SYS_SCRIPT
    this folder (SYS_SCRIPT) contains the following sub folders :
    Code:
    Bin
    SBin
    To prevent duplicate data and/or not up-to-date data, the later folders are soft link to :
    Code:
    /run/media/user_1_vb/NEW_INSTALL_LINUX_USB/PRE_INSTALL/SLASH/backup_sys/000_COMMON/Bin
    /run/media/user_1_vb/NEW_INSTALL_LINUX_USB/PRE_INSTALL/SLASH/backup_sys/000_COMMON/SBin
    Dolphin is use to copy files and folders to the usb stick and to make link where it is needed.

    The software is runnning correctly as long as the usb key is mounted by user 'user_1_vb'

    But on other computer it is another user who mounts the usb key.
    The soft link continue to points to :
    Code:
    /run/media/user_1_vb/NEW_INSTALL_LINUX_USB/PRE_INSTALL/SLASH/backup_sys/000_COMMON/Bin
    which does not exists.

    The program itself run correctly because the use of a variable (LOG_NAME) which is fill by :
    Code:
    LOG_NAME=$(logname)
    and script are called by
    Code:
    /run/media/$LOG_NAME/NEW_INSTALL_LINUX_USB/.............
    Any help is welcome.
    Thanks for helping. JCD
    __________
    server leap 15.0 -- ASUS g75vw KDE leap 15.2 -- ASUS G731GV KDE leap 15.2 -- acer aspire s13 win 10 home -- HP Omen win 10 home - scan EPSON V500 - Brother HL2250DN - Samsung CLP-325W

  2. #2
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    15,209
    Blog Entries
    3

    Default Re: USB DISK -- cannot access soft link when user change.

    It isn't clear what you are asking.

    It seems you are trying to solve a problem, but you have not told us what that problem is. Instead, you are telling us that your way of solving the problem isn't working. You need to paint a broader picture for us.

    You have not said how the USB is formatted. Since you mention soft links, I presume it uses a linux file system rather than a Windows file system. But you should not leave us guessing.

    When a mounted file system uses symbolic links to another part of the same file system, consider using relative links.

    Instead of
    [code]ln -s /mount/point/path/file .[/code[
    you could try something like:
    Code:
    ln -s ../../../path/file .
    That way, it won't matter where the drive is mounted. If you get them right, the relative links should still work.
    openSUSE Leap 15.3; KDE Plasma 5.18.6;

  3. #3
    Join Date
    Jun 2008
    Location
    South-West France
    Posts
    1,252

    Default Re: USB DISK -- cannot access soft link when user change.

    Quote Originally Posted by nrickert View Post
    It isn't clear what you are asking.
    ............
    ............
    Instead of
    Code:
    ln -s /mount/point/path/file .
    you could try something like:
    Code:
    ln -s ../../../path/file .
    That way, it won't matter where the drive is mounted. If you get them right, the relative links should still work.
    It seems difficult to do that from dolphin, because you have to edit individually the properties of all folders links and change real path to relative path.

    Why HARD drives and USB drives are treated differently. For hard drives the name of the current user does not appear in the path. As a result the data is always at the same 'somewhat address'.

    It would be more simple if usb drive was mounted always in /run/media/usb-root-path-name as a long time ago.
    I would like to be told how to do that if there is no other solutions.

    Thank you for taking the time to respond.
    Thanks for helping. JCD
    __________
    server leap 15.0 -- ASUS g75vw KDE leap 15.2 -- ASUS G731GV KDE leap 15.2 -- acer aspire s13 win 10 home -- HP Omen win 10 home - scan EPSON V500 - Brother HL2250DN - Samsung CLP-325W

  4. #4
    Join Date
    Jun 2008
    Location
    South-West France
    Posts
    1,252

    Default Re: USB DISK -- cannot access soft link when user change.

    PS : For this case, the usb stick is ntfs formated (Because it’s the first usb drive I found in my drawer.)
    Thanks for helping. JCD
    __________
    server leap 15.0 -- ASUS g75vw KDE leap 15.2 -- ASUS G731GV KDE leap 15.2 -- acer aspire s13 win 10 home -- HP Omen win 10 home - scan EPSON V500 - Brother HL2250DN - Samsung CLP-325W

  5. #5
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    2,688
    Blog Entries
    1

    Default Re: USB DISK -- cannot access soft link when user change.

    Quote Originally Posted by jcdole View Post
    It would be more simple if usb drive was mounted always in /run/media/usb-root-path-name as a long time ago. I would like to be told how to do that if there is no other solutions.
    I added flash memory of the Forerunner® 735XT to /etc/fstab:
    Code:
    erlangen:~ # grep 735 /etc/fstab  
    LABEL=FR735                                /FR735                  vfat   user,noauto                   0  0 
    erlangen:~ #
    Regardless of the user plugging in the device it gets mounted as:
    Code:
    erlangen:~ # df -h /FR735/ 
    Filesystem      Size  Used Avail Use% Mounted on 
    /dev/sdd         11M  7.1M  3.1M  71% /FR735 
    erlangen:~ #
    /run/media/ isn't needed. But I think you can have it.
    AMD Athlon 4850e (2009), openSUSE 13.1, KDE 4, Intel i3-4130 (2014), i7-6700K (2016), i5-8250U (2018), AMD Ryzen 5 3400G (2020), openSUSE Tumbleweed, KDE Plasma 5

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    28,750

    Default Re: USB DISK -- cannot access soft link when user change.

    Quote Originally Posted by jcdole View Post
    PS : For this case, the usb stick is ntfs formated (Because it’s the first usb drive I found in my drawer.)
    You seem to be very confused.

    Using the expression "HARD drives and USB drives" is not saying anything.

    There are different types of mass storage, e.g. revolving disks vs. static memory. This has nothing to do with what you experience as a difference. Once partitioned, file systems created, they are all the same when it comes to using them.

    There are different types of hardware connections/buses in use, e.g. PCI vs. USB. You can have revolving disks on both. You can have static memory on both. Once you have a partitioned, file system created, mass-storage device connected through them, they are all the same when it comes to using them.

    There are different file system types and what is more important there are Linux file systems and there are non-Linux file systems. The latter do not have the (POSIX standard required) user and group ownership and permissions. It is this non-Linux file system (like NTFS) that are at the root of your problems.

    You should focus on how Linux tries to cope with non-Linux file systems like NTFS (by using fake user/group/permissions on mount), how the desktop is handling the spontaneous connection of such a file system for the desktop user "in the seat" and what this means on what you are trying to do.
    Last edited by hcvv; 13-May-2021 at 03:47.
    Henk van Velden

  7. #7
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    15,209
    Blog Entries
    3

    Default Re: USB DISK -- cannot access soft link when user change.

    Quote Originally Posted by jcdole View Post
    It would be more simple if usb drive was mounted always in /run/media/usb-root-path-name as a long time ago.
    You can do that, with an entry in "/etc/fstab". Perhaps use Yast partitioner to set that up.
    openSUSE Leap 15.3; KDE Plasma 5.18.6;

  8. #8
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    28,750

    Default Re: USB DISK -- cannot access soft link when user change.

    Quote Originally Posted by nrickert View Post
    You can do that, with an entry in "/etc/fstab". Perhaps use Yast partitioner to set that up.
    With the additional advice not to use a directory inside /run as mount point. That is against the File System Hierarchy (https://en.wikipedia.org/wiki/Filesy...archy_Standard). Better create a mount point within /mnt, or direct within /, or another convenient place.
    Henk van Velden

  9. #9
    Join Date
    Sep 2012
    Posts
    6,499

    Default Re: USB DISK -- cannot access soft link when user change.

    Quote Originally Posted by jcdole View Post
    It would be more simple if usb drive was mounted always in /run/media/usb-root-path-name as a long time ago.
    I would like to be told how to do that if there is no other solutions.
    man udisks
    search for UDISKS_FILESYSTEM_SHARED

  10. #10
    Join Date
    Jul 2018
    Location
    Loma Linda, Mo
    Posts
    530

    Default Re: USB DISK -- cannot access soft link when user change.

    The issue is /run/mount/username is not the best place to mount a USB that multiple users need to see.

    I would umount the /run/mount/username usb drive
    mkdir /usb
    chmod 777 /usb
    mount the usb drive on /usb

    Now the permissions are everyone can see and change the USB drive.

    You can script that so that it can be run at every reboot. you will need to do that as root or sudo.
    OpenSUSE 15.3 with VirtualBox VM's (XP, 10, Ubuntu MATE 20.04, OpenSUSE 15.3, Tumbleweed)
    Pi4 with Ubuntu MATE 20.04
    Unix since 1974 (pdp-11, Interdata, AT&T, Tandy, Convergent, Sun, IBM, NCR, and HP)
    Linux since 1995 (Mandrake, Fedora, CentOS, OpenSUSE)

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •