Page 1 of 4 123 ... LastLast
Results 1 to 10 of 38

Thread: Mounting USB HDD / Permissions

  1. #1

    Question Mounting USB HDD / Permissions

    Hello, I'm new to Linux and am building a pc with opensuse Leap (KDE) to use primarily as an HTPC.

    My media is on an external HDD (connected via usb3). I got it to automount at startup using the KDE system settings. The problem is that it mounts the drive under '/run/media/[username]/'. The software I'm using (Emby media server) has its own user 'emby' and therefore cannot access this location.

    I've learnt that i cannot change permissions of this mount point, as it's a running process that resets after restart. So I'm looking for some way to solve this, either make 'emby' get access to it or mount the drive another way, so that I don't have a permissions issue.

    Thanks for reading and hope someone can help.

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,972

    Default Re: Mounting USB HDD / Permissions

    Is that device connected "permanent"?

    In that case, it would be better to mount it like all disk devices belonging to the system, by giving it an entry in /etc/fstab. You can do this using YaST > System > Partitioner. (Be carefull, do not Format the partition(s)).

    Do not forget to first decide what the mount point should be, you need it in configuration time.

    Afterwards you (as system manager) can then decide if you want the owner of the mount point should be and what permissions it should have. Place, owner and permissions depend on it's usage.

    E.g when it is user emby is the only one to use it, the mount point could be /home/emby/<nice name> , with emby (and emby's default group) as owner and permission, well, emby can then set that him/herself.

    BTW, it looks as you miss some background information: https://en.opensuse.org/SDB%3ABasics...,_mount_points
    Last edited by hcvv; 08-Mar-2017 at 04:41.
    Henk van Velden

  3. #3

    Default Re: Mounting USB HDD / Permissions

    Thanks for replying so fast. Yes, that's exactly what I wanted. I've got my external HDD mounted to '/home/emby' automatically on system startup, and user 'emby' can see and access it now!

    But how do I change the ownership? Do I have to use 'konsole' or is there another application for that?

    I tried using 'file manager - root', but the changes I make don't stay. And thanks for that link, I've book marked it for reading later.

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,972

    Default Re: Mounting USB HDD / Permissions

    You have to change that as root:
    Code:
    su -l -c 'chown emby /home/emby'
    But using "File manager as root" from a desktop (you did not tell which one), should do the trick also.

    Maybe you could post
    Code:
    ls -l /home
    to let us check if it is OK.
    Henk van Velden

  5. #5

    Default Re: Mounting USB HDD / Permissions

    Sorry I couldnt get back to you sooner, we had a passing thunderstorm, and i didnt want to turn my PC on.

    I was referring to 'File Manager-Super User Mode - Dolphin' from the KDE menu. It doesnt save the changes i make to the 'ownership' section, shows me a progess bar like its doing something and then closes.

    I tried the first code in konsole, unfortunately it didnt help. Heres the output of the other command:

    Code:
    wolf@Suse-wolf:~> ls -l /home 
    total 12 
    drwxr-xr-x  1 root users 8192 Mar  7 07:48 emby 
    drwxr-xr-x 25 wolf users 4096 Mar  8 21:58 wolf 
    wolf@Suse-wolf:~>

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,972

    Default Re: Mounting USB HDD / Permissions

    Quote Originally Posted by K3kiaze View Post
    Sorry I couldnt get back to you sooner, we had a passing thunderstorm, and i didnt want to turn my PC on.
    Never mind. Your turn around time is already shorter then of many others
    Quote Originally Posted by K3kiaze View Post
    I was referring to 'File Manager-Super User Mode - Dolphin' from the KDE menu. It doesnt save the changes i make to the 'ownership' section, shows me a progess bar like its doing something and then closes.
    IMHO a progress bar for such a short action is a bit strange. In any case, because you can not really see what such a GUI program does, we better do it in the CLI.
    Quote Originally Posted by K3kiaze View Post
    I tried the first code in konsole, unfortunately it didnt help.
    Not posting this like you do the other one below, does not really help in finding out if I proposed something wrong, or you did something I did not expect. I, like may others here, have no crystal ball.
    Quote Originally Posted by K3kiaze View Post
    Heres the output of the other command:
    Code:
    wolf@Suse-wolf:~> ls -l /home 
    total 12 
    drwxr-xr-x  1 root users 8192 Mar  7 07:48 emby 
    drwxr-xr-x 25 wolf users 4096 Mar  8 21:58 wolf 
    wolf@Suse-wolf:~>
    Yes, it shows that root is still owner instead of emby.
    So we really need to see what the other command gives on the screen (I reread it and can find no error in it), else I can not improve it.

    BTW, one question, how did you intriduce user emby in the system?
    When you do this with YaST in normal cases /home/emby will be created with the correct owner.
    Henk van Velden

  7. #7

    Default Re: Mounting USB HDD / Permissions

    IMHO a progress bar for such a short action is a bit strange. In any case, because you can not really see what such a GUI program does, we better do it in the CLI.
    I figured this out, it was because i checked the option "Apply changes to all subfolders and their contents", thats when it shows a progess bar, but no changes are made.

    Not posting this like you do the other one below, does not really help in finding out if I proposed something wrong, or you did something I did not expect. I, like may others here, have no crystal ball.
    Sorry I meant, there was no output:
    Code:
    wolf@Suse-wolf:~> su -l -c 'chown emby /home/emby' 
    Password:  
    wolf@Suse-wolf:~> ls -l /home 
    total 12 
    drwxr-xr-x  1 root users 8192 Mar  7 07:48 emby 
    drwxr-xr-x 25 wolf users 4096 Mar  9 00:07 wolf 
    wolf@Suse-wolf:~>
    BTW, one question, how did you intriduce user emby in the system?
    User 'emby' was created automatically when i installed "Emby Media Server" application. 'emby-server' package from yast2 (Install/Remove Software from KDE menu).

    When you do this with YaST in normal cases /home/emby will be created with the correct owner.
    When I click on 'User and Group Management' in Yast - under Groups there's only 1 entry - Group Name 'users', and the group members were 'games,wolf', so i added 'emby' to that group. So now it shows group members as 'emby,games,wolf'. That was the only this I tried, hoping it would solve my issue.

  8. #8
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,972

    Default Re: Mounting USB HDD / Permissions

    This is all a bit strange.

    Can you please post
    Code:
    grep emby /etc/passwd
    to check if the user name emby is there and how it is configured?
    Henk van Velden

  9. #9

    Default Re: Mounting USB HDD / Permissions

    First, I want to say I really appreicate you spending time to help me fix this, thank you.

    Here is the output you asked for:

    Code:
    wolf@Suse-wolf:~> grep emby /etc/passwd
    emby:x:480:476:Account under which Emby runs:/var/lib/emby-server:/sbin/nologin
    wolf@Suse-wolf:~>

  10. #10
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,972

    Default Re: Mounting USB HDD / Permissions

    This shows that emby is there as a user, that it has 480 as user-id. It's primary group-id is 476, which is definitely not "users". Please check with
    Code:
    grep 476 /etc/group
    to see what it is named.

    I do not think that adding emby to the users group is something the makers of the product require you to do.

    Further to that entry:T
    The home directory of emby is /var/lib/emby-server. Just a sort of filler I assume.
    The loginshell is /sbin/nologin. This is to prevent emby to do a login. Not unusual for such an application bound user.

    Nevertheless, I am stumbled why doing as root
    Code:
    chown emby /home/emby
    does not give any error and does not do what it should.
    Henk van Velden

Page 1 of 4 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
  •