Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 28

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

  1. #11
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    28,669

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

    Quote Originally Posted by larryr View Post
    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.
    For mounting a file system at boot, do we not have /etc/fstab already for ~ 50 years?

    And did you take into account that this is about an NTFS file system and that thus some extra options should be used to give all users access?
    Last edited by hcvv; 13-May-2021 at 10:12. Reason: repaired typo, not NFS, but NTFS
    Henk van Velden

  2. #12
    Join Date
    Sep 2012
    Posts
    6,480

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

    Quote Originally Posted by hcvv View Post
    this is about an NFS file system
    What gave you this idea?

  3. #13
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    28,669

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

    Quote Originally Posted by arvidjaar View Post
    What gave you this idea?
    Typo. should be NTFS (post #4).

    I am often at a loss with those MS terms.
    Henk van Velden

  4. #14
    Join Date
    Jul 2018
    Location
    Loma Linda, Mo
    Posts
    515

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

    It shouldn't make any difference if it is FAT, FAT32, NTFS, EXT4 - the problem is that /run/media/username - restricts access by other users
    That path is owned by root - I think that is part of the problem - only username and root can see the USB drive.
    Code:
    LLR1:~ # ll /run/media/
    total 0
    drwxr-x---+ 2 root root 40 May 12 12:25 llrainey
    If I know the UUID - yes I can mount it from /etc/fstab wherever I want it to go. I suspect the drive is not there at boot time and it mounts when the user logs on the box.
    The issue is if the UUID of the USB is not there when the system boots /etc/fstab can hang the system.
    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)

  5. #15
    Join Date
    Jun 2011
    Location
    Germany
    Posts
    337

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

    Quote Originally Posted by hcvv View Post
    For mounting a file system at boot, do we not have /etc/fstab already for ~ 50 years?
    Ahem, sorry. Didn't the OP say it's about a different machine?
    But on other computer it is another user who mounts the usb key.
    Missing fstab mounts are rather unwanted. I'd think nrickert's first advice about relative paths should be the most appropriate, even if less convenient. Isn't it?

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

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

    Quote Originally Posted by kasi042 View Post
    Ahem, sorry. Didn't the OP say it's about a different machine?
    My remark was on your advice to "automate" the mount on boot using a script (I assume starting it with systemd).
    And of course when the file system is not always available there is no-fail.

    In fact none of my posts above is directly related to the first post of the OP, because I hardly understand it.

    I only started posting here on his casual remark that this is about a non-Linux file system. IMHO he does not see that as an important fact that he should have mentioned to his potential helpers in the first place. Then I stumbled into his wondering about the difference between"HARD drives and USB drives:. Then again, IMHO, he seems to lack a lot of understanding about devices, buses, partitioning, file systems (Linux vs. non-Linux) and mounting. I tried to explain a few basics. But I admit I still did not study his problem description in detail.

    Maybe I am not goof enough in English to make myself understandable enough and I better refrain from posting here.
    Henk van Velden

  7. #17
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    2,662
    Blog Entries
    1

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

    Quote Originally Posted by larryr View Post
    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.
    The only step actually needed is an entry in /etc/fstab. Systemd creates the mount automatically:
    Code:
    erlangen:~ # systemctl cat FR735.mount        
    # /run/systemd/generator/FR735.mount
    # Automatically generated by systemd-fstab-generator 
    
    [Unit] 
    Documentation=man:fstab(5) man:systemd-fstab-generator(8) 
    SourcePath=/etc/fstab 
    After=blockdev@dev-disk-by\x2dlabel-FR735.target 
    
    [Mount] 
    Where=/FR735 
    What=/dev/disk/by-label/FR735 
    Type=vfat 
    Options=user,noauto 
    erlangen:~ #
    Upon mount systemd will run an associated service:
    Code:
    # /etc/systemd/system/FR735.service
    [Unit] 
    Description=Get FR735 Activities 
    Requires=FR735.mount 
    After=FR735.mount 
    
    [Service] 
    ExecStart=/usr/bin/rsync -av /FR735/ /home/karl/Forerunner/ 
    
    [Install] 
    WantedBy=FR735.mount 
    erlangen:~ #
    Whenever I attach the Forerunner for loading its battery activities stored on its flash memory will be synced automaticlly.
    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

  8. #18
    Join Date
    Jun 2011
    Location
    Germany
    Posts
    337

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

    Quote Originally Posted by hcvv View Post
    My remark was on your advice to "automate" the mount on boot using a script (I assume starting it with systemd).
    And of course when the file system is not always available there is no-fail.

    In fact none of my posts above is directly related to the first post of the OP, because I hardly understand it.

    I only started posting here on his casual remark that this is about a non-Linux file system. IMHO he does not see that as an important fact that he should have mentioned to his potential helpers in the first place. Then I stumbled into his wondering about the difference between"HARD drives and USB drives:. Then again, IMHO, he seems to lack a lot of understanding about devices, buses, partitioning, file systems (Linux vs. non-Linux) and mounting. I tried to explain a few basics. But I admit I still did not study his problem description in detail.

    Maybe I am not goof enough in English to make myself understandable enough and I better refrain from posting here.
    Hi Henk,

    No offense meant!
    I just wondered if there is another solution to original issue. I have tried to replace the user name in a soft link by the variable $USER but Dolphin doesn't seem to take it.

  9. #19
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    28,669

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

    Quote Originally Posted by kasi042 View Post
    Hi Henk,

    No offense meant!
    I just wondered if there is another solution to original issue. I have tried to replace the user name in a soft link by the variable $USER but Dolphin doesn't seem to take it.
    Again, I do not understand the original problem, thus I can not comment on it or on any solution.
    Henk van Velden

  10. #20
    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 karlmistelberger View Post
    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.
    That need to have an fstab on all computer for all possible usb drive.

    It would be more simple if usb drive was mounted always in /run/media/usb-root-path-name as a long time ago.
    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

Page 2 of 3 FirstFirst 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
  •