Hello, Usually, when I install new OpenSUSE and make automount of any disk at the pre-installation settings (1), within /mnt dir, all is good (f.e., I have 2 disks and second I mount in /mnt/disc2 at pre-install partition settings).
But when I don’t, my automount doesn’t work even with USB flash drives. (2)
Autofs is installed. All (1) and (2) are same with a clean installation without package changing (Last time I tried it on Leap 15.1 2 times when I changed my SSD).
When I try to mount USB manually, it has only READ permissions (but one time I did it with some trick I forgot now.
And it is not
sudo mount -o remount,rw /partition/identifier /mount/point
I don’t remember and I can’t repeat it now.
Anyway, I think there is a trick of (1) step. Maybe /mnt became special and have other permissions. So, I tried
sudo chown psijic /mnt
sudo chmod 755 /mnt
it helps none.
What is the trick to configure automount properly like it makes step (1)?
Most users would just use the udisks/udev/DE mounting mechanism to detect and auto-mount USB media, but I assume you specifically prefer (or require) traditional root-controlled mounting via a static entry in /etc/fstab?
That requires appropriate configuration of /etc/auto.master (with a reference to auto.foo) and /etc/auto.foo with an appropriate entry as well.
However, for single-user access to USB media the udisks/udev mechanism is preferable IMHO. (Even for installations not using a desktop environment, mount helpers such as udiskie can provide a simple solution for automatic mounting of USB media.)
Thanks. Actually, I have no preferences except it should be an optimal way. And I think, automount should be available for different users because it’s the right way of a common PC usage.
Now I see, even Krusader’s MountMan can’t see USB devices (but SUSE ImageWriter can).
Actually, all you need to do is add a suitable entry in /etc/fstab, and systemd will take care of the “on demand” mounting (creating a systemd unit dynamically at boot).
From ‘man systemd.mount’…
FSTAB
Mount units may either be configured via unit files, or via /etc/fstab (see fstab(5) for details). Mounts listed in /etc/fstab will be converted into native units dynamically at boot and when the configuration of the system manager is reloaded. In general, configuring mount points through /etc/fstab is the preferred approach. See systemd-fstab-generator(8) for details about the conversion.
For example
/dev/sdb1 /mnt/usb auto noauto,x-systemd.automount 0 2
However, a unit file can be created manually if desired.
My primary drive is nvme, so I added /dev/sda1 in /etc/fstab and linux mounted EFI catalog with 0 size and no applet pop-up. So, I changed path to /sda and now it looks ok with automounting. I have a KDE applet pop-up, proper files in /mnt/usb and Krusader’s MountMan can see the /dev/sda folder (except it still don’t recognize it as a mounted drive but it’s not a big problem, I think)
Thanks! I can delete /mnt/usb and systemd will autocreate it next time, right?
Hm, I need a root password to unmount the USB drive.
And after that I can’t automount the same drive again.
Non-superuser mounts
Normally, only the superuser can mount filesystems. However, when fstab contains the user option on a line, anybody can mount
the corresponding filesystem.
Thus, given a line
/dev/cdrom /cd iso9660 ro,user,noauto,unhide
any user can mount the iso9660 filesystem found on an inserted CDROM using the command:
mount /cd
Note that mount is very strict about non-root users and all paths specified on command line are verified before fstab is parsed
or a helper program is executed. It's strongly recommended to use a valid mountpoint to specify filesystem, otherwise mount may
fail. For example it's bad idea to use NFS or CIFS source on command line.
For more details, see fstab(5). Only the user that mounted a filesystem can unmount it again. If any user should be able to
unmount it, then use users instead of user in the fstab line. The owner option is similar to the user option, with the
restriction that the user must be the owner of the special file. This may be useful e.g. for /dev/fd if a login script makes
the console user owner of this device. The group option is similar, with the restriction that the user must be member of the
group of the special file.
Does desktop mounting (via udev/udisks2/DE) not work for you? If you remove (or comment out) the fstab entry, then this dynamic mechanism should work in the background instead and allow you to access USB storage media without any additional configuration as I already hinted at back in post #2. Removable-device mounting can be configured in your desktop. For KDE, check out ‘Configure Removable Devices’ in the system tray, or via System Settings > Removable Storage > Removable Devices
hm, I removed the changes in fstab and turned on System Settings > Removable Storage > Removable Devices (2nd and 3rd checkboxes). It doesn’t work now.
So the shows that the removable media is enumerated as expected. It should mount ok (as you have configured ‘automatic’ mounting AFAIU). Does your desktop notifier not report it as well? It should also show up in Dolphin’s ‘Removable Devices’ panel.
So, I think, configure panel is not worked properly or I need to manually mount the flash drive first time. Or to use console to configure files manually.
So, it works if you mount manually. For example (assuming sda1)…
udisksctl mount --block-device /dev/sda1
If you can mount the USB device partition(s) successfully via udisksctl then we can examine why your desktop is not automating this process as desired.