Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 7 of 7
  1. #1
    Senior Member dolodobendan's Avatar
    Join Date
    Dec 2017
    Location
    Braunschweig, Germany
    Posts
    1,446

    Using a QNAP NAS share with both Ubuntu (LMS) and Windows

    I'm having fun with permissions again. What I want to achieve:

    ubuntu (LMS) <-- user: squeezeboxserver (RW) --> NAS <-- user: myuser RW --> Windows

    I rip CDs on my Windows machine and copy them to the NAS share. Doing that makes me the owner, the group is "everyone", and octal permissions is 770.

    LMS installed on the NAS is happy with that and works fine.

    LMS installed on ubuntu is not happy. What do I have to do to make it happy?

    I tried samba shares (which I think Windows is using), but then LMS only has read-only access.

    I tried nfs shares, but LMS has no access to the music. Other folders work, but again, I want to make it work with the permissions that are already there.

    From what I read it should be possible to mount the music library using nfs 4, because that can somehow remap users, so my hope is to use this...

    I'm grateful for any help, I don't really know what I'm doing here.


    SOLVED
    Last edited by dolodobendan; 2021-10-10 at 14:08. Reason: Added accumulated wisdom
    QLMS 8.3@2.21 x64 (digimaster) / QNAP 469L QTS 4.3.4
    LMS 8.3 x64 / Intel NUC8 i3

  2. #2
    Senior Member
    Join Date
    Feb 2011
    Location
    Cheshire, UK
    Posts
    6,234
    Quote Originally Posted by dolodobendan View Post
    I'm having fun with permissions again. What I want to achieve:

    ubuntu (LMS) <-- user: squeezeboxserver (RW) --> NAS <-- user: myuser RW --> Windows

    I rip CDs on my Windows machine and copy them to the NAS share. Doing that makes me the owner, the group is "everyone", and octal permissions is 770.

    LMS installed on the NAS is happy with that and works fine.

    LMS installed on ubuntu is not happy. What do I have to do to make it happy?

    I tried samba shares (which I think Windows is using), but then LMS only has read-only access.

    I tried nfs shares, but LMS has no access to the music. Other folders work, but again, I want to make it work with the permissions that are already there.

    From what I read it should be possible to mount the music library using nfs 4, because that can somehow remap users, so my hope is to use this...

    I'm grateful for any help, I don't really know what I'm doing here.
    Have you tried mounting the Samba share from ubuntu with your Windows user rather than squeezeboxserver user ?
    I have a pi configured this way which works fine

    Other than that the difference on my QNAP is that Multimedia is setup for "administrators" rather than "everyone" - my Windows user is a member of administrators group.
    If you were to change the share folder permissions from everyone to administrators it would make no difference to your access (if you are in the group). The QNAP would rewrite all the permissions accordingly.

    You could try it by creating a new Test shared folder with "everyone" on the QNAP and drop a few music files in and remount and see whether that works then change to "administrators" having put yourself into that group and see if it still works.
    Jim
    https://jukeradio.double6.net


    VB2.4 storage QNAP TS419p (NFS)
    Living Room Joggler & Pi4/Khadas -> Onkyo TXNR686 -> Celestion F20s
    Office Joggler & Pi3 -> Denon RCD N8 -> Celestion F10s
    Dining Room SB Radio
    Bedroom (Bedside) Pi Zero+DAC ->ToppingTP21 ->AKG Headphones
    Bedroom (TV) & Bathroom SB Touch ->Denon AVR ->Mordaunt Short M10s + Kef ceiling speakers
    Guest Room Joggler > Topping Amp -> Wharfedale Modus Cubes

  3. #3
    Senior Member dolodobendan's Avatar
    Join Date
    Dec 2017
    Location
    Braunschweig, Germany
    Posts
    1,446
    Quote Originally Posted by d6jg View Post
    Have you tried mounting the Samba share from ubuntu with your Windows user rather than squeezeboxserver user ?
    I have a pi configured this way which works fine
    I tried that. Mounting works fine, but I only have RO access to the share via ubuntu.

    Quote Originally Posted by d6jg View Post
    Other than that the difference on my QNAP is that Multimedia is setup for "administrators" rather than "everyone" - my Windows user is a member of administrators group.
    Hmm. "Multimedia" has RW permissions for users "admin", myuser, and "squeezeboxserver", the owner is "admin". Guest access is denied.
    Subfolder "Playlists" has the same permissions, but the owner is "squeezeboxserver". Guest access is denied.
    Subfolder "Music" has RW access for users "admin", and myuser. "Squeezeboxserver" has RO access. Myuser is the owner. Guest access is denied.

    I have three groups:

    everyone
    family: "No Access" (=nothing set) for Multimedia.
    administrators: "admin" and "squeezeboxserver". I added myuser here and remounted the share. But still no RW access. The group administrators has "No Access" (=nothing set) to "Multimedia". I changed that to RW. Applying is gonna take a while.

    No change.

    Quote Originally Posted by d6jg View Post
    If you were to change the share folder permissions from everyone to administrators it would make no difference to your access (if you are in the group). The QNAP would rewrite all the permissions accordingly.

    You could try it by creating a new Test shared folder with "everyone" on the QNAP and drop a few music files in and remount and see whether that works then change to "administrators" having put yourself into that group and see if it still works.
    Gonna try that next, thank you!
    QLMS 8.3@2.21 x64 (digimaster) / QNAP 469L QTS 4.3.4
    LMS 8.3 x64 / Intel NUC8 i3

  4. #4
    Senior Member dolodobendan's Avatar
    Join Date
    Dec 2017
    Location
    Braunschweig, Germany
    Posts
    1,446
    Quote Originally Posted by d6jg View Post
    You could try it by creating a new Test shared folder with "everyone" on the QNAP and drop a few music files in and remount and see whether that works then change to "administrators" having put yourself into that group and see if it still works.
    I created a new share "Test". "admin" and the group "everyone" have RW access rights. Myuser is the owner. I mounted the share with myuser.

    No RW access.

    I added myuser with RW rights and remounted the share (do I have to do that?). Still nothing.

    This may sound silly, but it is normal that myuser doesn't have RW access to /mnt/share, right?

    It's probably something really, really embarrassing.
    QLMS 8.3@2.21 x64 (digimaster) / QNAP 469L QTS 4.3.4
    LMS 8.3 x64 / Intel NUC8 i3

  5. #5
    Senior Member dolodobendan's Avatar
    Join Date
    Dec 2017
    Location
    Braunschweig, Germany
    Posts
    1,446
    This is getting frustrating. I mounted the share like this in fstab:

    Code:
    //192.168.178.1/Multimedia /mnt/NAS cifs credentials=/root/.lmscredentials,uid=123,gid=1001,rw,nounix,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0
    uid 123 is system account "squeezeboxserver" on ubuntu
    gid 1001 is group "squeezeboxserver" on ubuntu (I created this)

    That's how it looks on ubuntu:

    Name:  lms_cifs1.png
Views: 57
Size:  15.6 KB

    I tried copying a file using myuser and WinSCP and there's this:

    Name:  lms_cifs2.png
Views: 58
Size:  13.5 KB

    The files are created nicely, the permissions are correctly set. The timestamps look good to me, too.

    Any ideas?
    Last edited by dolodobendan; 2021-10-09 at 03:48. Reason: typo
    QLMS 8.3@2.21 x64 (digimaster) / QNAP 469L QTS 4.3.4
    LMS 8.3 x64 / Intel NUC8 i3

  6. #6
    Senior Member dolodobendan's Avatar
    Join Date
    Dec 2017
    Location
    Braunschweig, Germany
    Posts
    1,446
    I set up everything for nfs4 idmapping. After a reboot, the NAS decided to revert any changes. That was fun.

    Then I tried to beat the system by creating matching uids and gids. Both NAS' uid and gid are already in use on ubuntu, so I tried to match the ubuntu uid and gid on the NAS. But the NAS decided to just delete the user. That was fun, too.

    I'm at this point where I'm ready to just wipe everything and start from scratch.

    But it REALLY shouldn't be this hard, should it. It should be easier to connect two Linux machines than one Linux machine and one Windows machine.
    QLMS 8.3@2.21 x64 (digimaster) / QNAP 469L QTS 4.3.4
    LMS 8.3 x64 / Intel NUC8 i3

  7. #7
    Senior Member dolodobendan's Avatar
    Join Date
    Dec 2017
    Location
    Braunschweig, Germany
    Posts
    1,446
    I managed to do this somehow.

    sudo mount -t cifs -o username=squeezeboxserver,uid=123,gid=1001 //192.168.178.1/Playlists /mnt/NAS/Playlists
    sudo mount -t cifs -o username=squeezeboxserver,uid=1000,gid=1000 //192.168.178.1/Music /mnt/NAS/Music

    uid=123:1001 is squeezeboxserver:squeezeboxserver on ubuntu
    uid=1000:1000 is myuser:myuser

    user squeezeboxserver exists on QNAP (normal user). Can probably even be deactivated.

    No special rights are needed.

    On both the NAS and ubuntu mount points:

    squeezeboxserver is the owner of "Playlists", myuser is the owner of "Music".

    The problem could have been that I tried it by mounting it as one share "Multimedia" (which previously held the subfolders "Music" and "Playlists") which need different user rights for both Windows access and LMS playlist write access to work. Having two shares makes this possible. If this was even the problem.

    I also don't know if this uid and gid bending are really necessary. I'm just happy it works now. Maybe this helps someone else.

    Update:

    Using two shares isn't the best idea because

    1. The shares' trash bins will be scanned, too, unless a subfolder is used (e.g. /Music/Music & /Playlists/Playlists).
    2. One share is sufficient, as long as there are two mounts:
      • sudo mount -t cifs -o username=squeezeboxserver,uid=123,gid=1001 //192.168.178.1/LMS/Playlists /mnt/NAS/Playlists
      • sudo mount -t cifs -o username=squeezeboxserver,uid=1000,gid=1000 //192.168.178.1/LMS/Music /mnt/NAS/Music


    This way, there's only one trash bin (\LMS\@Recycle) that is not scanned because both mounts use subfolders (Music & Playlists) of the share "LMS".
    Last edited by dolodobendan; 2021-11-25 at 22:27.
    QLMS 8.3@2.21 x64 (digimaster) / QNAP 469L QTS 4.3.4
    LMS 8.3 x64 / Intel NUC8 i3

Posting Permissions

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