How to access from two users at an USB disk?

Remove 99-usb-mount.rules as of no value to you.

Then

sudo udevadm control --reload
sudo udevadm trigger

Replug the USB device.

Show the output from
groups
lsblk -f
mount | grep sd

Hi, here is
removed

eros@localhost:~> ls -l /etc/udev/rules.d/
total 12
-rwxr-xr-x 1 root root 5666  7 feb 10.57 54-smfp_samsung.rules
-rwxr-xr-x 1 root root  177  2 mar 20.43 99-udisks2.rules
eros@localhost:~>
eros@localhost:~> sudo udevadm control --reload
[sudo] password for eros:
eros@localhost:~> sudo udevadm trigger
eros@localhost:~>
eros@localhost:~> groups
users docker wheel
eros@localhost:~>
eros@localhost:~> lsblk -f
NAME   FSTYPE FSVER LABEL   UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda
├─sda1 vfat   FAT32         90F5-2AA6                             478,7M     6% /boot/efi
├─sda3
├─sda4 ntfs                 7632186C32183419
├─sda5 ntfs                 3EC29B88C29B42D7
├─sda6 ext4   1.0   suse    1a53e798-5294-4f54-9f45-3ee1adcf3a71   33,1G    37% /
├─sda7 ext4   1.0   home    eb6b4b24-fb60-45a3-adaf-2772d319009d   18,8G    29% /home
├─sda8 swap   1     swap    cc5c0a32-0eee-4e84-a330-59220c44a632                [SWAP]
└─sda9 ntfs         dati    150431027024E4E9                      196,8G    34% /dati
sdb
└─sdb1 ext4   1.0   backup5 757b2f23-f610-40c0-9607-24850a4a7eec
sr0
eros@localhost:~>
eros@localhost:~> mount | grep sd
/dev/sda6 on / type ext4 (rw,relatime)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
/dev/sda9 on /dati type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
/dev/sda7 on /home type ext4 (rw,relatime)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)
gvfsd-fuse on /root/.gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0)
eros@localhost:~>

Try mounting manually with
udisksctl mount -b /dev/sdb1
Report back with exact error message. Best if you copy the command and output and post all of it here.

If it says something about not authorized, that’s a PolKit issue to be sorted.

eros@localhost:~> udisksctl mount -b /dev/sdb1
Error mounting /dev/sdb1: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error creating mount point `/media/backup5': No such file or directory
eros@localhost:~> 

it seems that /madia doesn’t exist
I created /media
and run as root

localhost:~ # udisksctl mount -b /dev/sdb1
Mounted /dev/sdb1 at /media/backup5
localhost:~ # 

and it result mounted in /media/backup5
later I’ll try with other users

Yes, the /media directory needs to exist first.

manythanks now it works as I wold like
access to the USB disks with any user in users group, no password requested.
now to summarize what is necessary and what not:

  1. users that have access to USB disks=share the primary group (for example users group) >necessary=yes
  2. users that have access to USB disks=share the wheel group necessary???
  3. create /media folder >necessary=yes
  4. rule /etc/udev/rules.d/99-udisks2.rules with this content: >necessary=yes
# Mount filesystem to shared /media
ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{UDISKS_FILESYSTEM_SHARED}="1"
  1. rule /etc/udev/rules.d/99-usb-mount.rules with this content >necessary=no
    ACTION==“add”, SUBSYSTEM==“block”, ENV{ID_BUS}==“usb”, ENV{DEVTYPE}==“partition”, RUN+=“/usr/local/bin/usb-mount.sh %k”
  2. script /usr/local/bin/usb-mount.sh with this content: >necessary I suppose=no becouse called from rule 5)
#!/bin/bash
DEVICE="/dev/$1"
MOUNTPOINT="/mnt/usb"

mkdir -p "$MOUNTPOINT"
FSTYPE=$(blkid -o value -s TYPE "$DEVICE")

if [ "$FSTYPE" = "ext3" ] || [ "$FSTYPE" = "ext4" ]; then
    mount -o rw "$DEVICE" "$MOUNTPOINT"
    chgrp users "$MOUNTPOINT"
    chmod 2775 "$MOUNTPOINT"
else
    mount -o rw,uid=0,gid=users,umask=000 "$DEVICE" "$MOUNTPOINT"
fi

Tried to reproduce this and found that only # 1. , 3. and 4. are necessary
but
the device is still mounted with permissions from the current desktop user at the moment of the insertion
and other users have “access” to the files as in “they can read them but not write to them”, neither can they write new files to the directories (with current default settings).
As an example, if “paperino” was logged to the desktop at pendrive insertion, user “bruno” sees:

bruno@LT-B:~> ll /media/UDISKPRO
total 18956
drwxr-xr-x 3 paperino users     4096 mar 26  2022 Commesse
-rw-r--r-- 1 paperino users   173879 dic 24  2007 Commesse.zip
-rw-r--r-- 1 paperino users 17299278 set 29  2010 linux-image-2.6.32.21+drm33.7evo_1_i386.deb
...
bruno@LT-B:~> touch /media/UDISKPRO/paperino.txt
touch: cannot touch '/media/UDISKPRO/paperino.txt': Permission denied
bruno@LT-B:~>

If that is not what you expect, maybe the script in 6. is still needed or some tweaking via chmod/umask/setfacl should be added.

manythanks bruno
in my disk I have:

eros@localhost:~> ll /media/backup5/
total 5080
-rw-rw-r--  1 eros   users       2  3 mar 16.40 aaa.txt
-rw-rw-r--  1 eros   users    5194  3 mar 13.38 access usb disk from two users.txt
-rw-rw-r--  1 eros   users    3243 26 feb 15.54 add repository chrome.txt
-rw-rw-r--  1 eros   users     662  9 feb 17.08 add to panel.txt
-rw-rw-r--  1 eros   users     722 25 feb 16.23 add users to groups.txt
-rwxrwxrwx  1 eros   users  176325  3 feb 14.59 agama-different as settings-photo_2026-02-03_14-58-39.jpg
... others are removed
eros@localhost:~>

where .txt files are rw for user and group

and

eros@localhost:~> touch /media/backup5/paperino.txt
eros@localhost:~>

and paperino.txt is created

eros@localhost:~> ll /media/backup5/
total 5080
....removed files
-rw-rw-r--  1 eros   users       0  3 mar 17.15 paperino.txt
.....removed files
eros@localhost:~>

and with another user

procuste@localhost:~> touch /media/backup5/paperino-procuste.txt
procuste@localhost:~>

and

procuste@localhost:~> ll /media/backup5/
total 5080
...removed files
-rw-rw-r--  1 procuste users       0  3 mar 17.20 paperino-procuste.txt
-rw-rw-r--  1 eros     users       0  3 mar 17.15 paperino.txt
....removed files
procuste@localhost:~>

this is the behaviour I would like
in this laptop seems I succeed to create files with “readeable and writeable” permission for user and group, but it doesn’t works always becouse now I have the file that is -rw-rw- that cannot be saved by “procuste”, in the other laptop I didn’t succeed so I opened another thread

I guess that the

if [ "$FSTYPE" = "ext3" ] || [ "$FSTYPE" = "ext4" ]; then
    mount -o rw "$DEVICE" "$MOUNTPOINT"
    chgrp users "$MOUNTPOINT"
    chmod 2775 "$MOUNTPOINT"

section in the /usr/local/bin/usb-mount.sh script has something to do with that; or you tweaked the umask for those two users.

I removed /usr/local/bin/usb-mount.sh script and I tweaked the umask for all users, but I have to investigate better becouse sometimes something goes wrong