Posts: 5
Threads: 2
Joined: Aug 2024
Reputation:
0
08-18-2024, 06:16 AM
(This post was last modified: 08-18-2024, 12:03 PM by piesmoke.)
Hi all,
Apologies if this question has been asked and answered already. I did my best to search the forum for a solution.
I have a Pi 4 running MoOde Audio from an SD card, and a 2TB external usb drive storing all my music. The usb drive is formatted as exFAT. I can see it mounted at /media. All works perfectly.
Basically, I want to copy files to the usb drive via ssh/sftp, as well as give other programs on the network permissions to write to it, but I get a permissions error. Samba works fine, but is not a viable alternative in this case.
From what I've read moode uses udisk-glue to mount usb drives, and I believe the config I need to edit is /etc/udisks-glue.conf
Can someone confirm that for me, and give me an idea of the syntax I need to add to give me the permissions I need?
Posts: 13,439
Threads: 305
Joined: Mar 2018
Reputation:
545
Yes, udisks-glue and /etc/udisks-glue.conf
Try looking at the output of the mount command. It should look like below for an exfat drive.
Code: /dev/sda1 on /media/EXFAT4 type exfat (rw,nosuid,nodev,noexec,noatime,nodiratime,fmask=0022,dmask=0022,iocharset=utf8,errors=remount-ro,uhelper=udisks)
The default fmask=0022,dmask=0022 permissions equate to 0755/-rwxr-xr-x That means that root (sudo) is needed if not the owner.
If you want to change the auto-mount permissions for exfat then add suitable dmask and fmask settings to the filter block. There are calculators on the net that do octal or rwx <-> mask
Posts: 5
Threads: 2
Joined: Aug 2024
Reputation:
0
Thanks heaps!
Fantastic product, and support!
Posts: 5
Threads: 2
Joined: Aug 2024
Reputation:
0
Okay, so only just now have I had a chance to test this. I'm afraid I still can't get the syntax right.
I want it to be mounted with the equivalent of 777 permissions, so I ussumed that I'm editing these lines from the config file...
match exfatdisks {
automount = true
automount_options = {noexec,nodev,noatime,nodiratime}
post_mount_command = '/var/www/util/automount.sh add_mount_udisks "%mount_point"'
post_unmount_command = '/var/www/util/automount.sh remove_mount_udisks "%mount_point"'
... and that I want to add something like...
fmask=0000,dmask=0000
... to it, but I'm not sure.
Could you please give me an example of the line and where it should go please?
Posts: 13,439
Threads: 305
Joined: Mar 2018
Reputation:
545
Add the params like below.
Code: automount_options = {noexec,nodev,noatime,nodiratime,'dmask=0000','fmask=0000'}
Here's an article explains the mapping between umask and chmod
https://askubuntu.com/questions/429848/d...nt-options
Posts: 5
Threads: 2
Joined: Aug 2024
Reputation:
0
08-27-2024, 03:19 PM
(This post was last modified: 08-27-2024, 03:21 PM by piesmoke.)
Thanks Tim,
So I tried that. This is how it reads now...
match exfatdisks {
automount = true
automount_options = {noexec,nodev,noatime,nodiratime,'dmask=0000','fmask=0000'}
post_mount_command = '/var/www/util/automount.sh add_mount_udisks "%mount_point"'
post_unmount_command = '/var/www/util/automount.sh remove_mount_udisks "%mount_point"'
}
But now the drive doesn't mount at all. Am I missing something obvious?
Posts: 13,439
Threads: 305
Joined: Mar 2018
Reputation:
545
It's not obvious to me what might be happening on your end but I ran a quick test with an ExFat USB stick and using the stock udisks glue conf and no issues writing via SSH.
Code: pi@moode9:~ $ mount | grep /dev/sda1
/dev/sda1 on /media/EXFAT4 type exfat (rw,nosuid,nodev,noexec,noatime,nodiratime,fmask=0022,dmask=0022,iocharset=utf8,errors=remount-ro,uhelper=udisks)
pi@moode9:~ $ cd /media/EXFAT4/
pi@moode9:/media/EXFAT4 $ sudo touch tim.txt
pi@moode9:/media/EXFAT4 $ ls
'Stereo Test' tim.txt
pi@moode9:/media/EXFAT4 $
|