Something changed recently in my ubuntu 20.04 desktop regarding how it mounts removeable media (like USB storage drives).
Previously such devices would appear under location /media/$USER/....
But now that directory is empty when usb storage devices are attached.
The devices still appear in the launcher and operate OK from the GUI for nonroot users.
But I need to be able to reference them from command-line and scripts, as this has worked for years since ubuntu 16.04 and above, until some recent change.
For example, when I use the launcher to open my walkman and then use its 'Open in Terminal', I can see that the path for my walkman is now:
/run/user/1000/gvfs/mtp:host=SONY_WALKMAN_104316F6127986/Storage Media
whereas previously it was instead: /media/$USER/WALKMAN
How can I revert to the previous behaviour?
Edit 1:
with a walkman connected, the output of lsusb
as nonroot user is:
Bus 002 Device 002: ID 8087:8002 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:800a Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 004: ID 04f2:0939 Chicony Electronics Co., Ltd USB Optical Mouse
Bus 003 Device 003: ID 413c:2113 Dell Computer Corp. Dell KB216 Wired Keyboard
Bus 003 Device 074: ID 054c:0882 Sony Corp. WALKMAN
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Edit 2: with the /etc/udev/rules.d/90-sony.rules
contents:
ATTR{idVendor}=="054c", ATTR{idProduct}=="0882", ENV{ID_MTP_DEVICE}="0", ENV{ID_MEDIA_PLAYER}="1"
Note that it is not only the walkman that is impacted, but even USB3 spinning drives that I used for backups.
Attaching the walkman after root runs udevadm control -R
, does not change the symptom (/media/$USER is still empty), and dmesg shows the following:
[665818.085033] usb 3-1: new high-speed USB device number 75 using xhci_hcd
[665818.233352] usb 3-1: New USB device found, idVendor=054c, idProduct=0882, bcdDevice= 0.01
[665818.233361] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=5
[665818.233366] usb 3-1: Product: WALKMAN
[665818.233369] usb 3-1: Manufacturer: SONY
[665818.233372] usb 3-1: SerialNumber: ...
[665818.234208] usb-storage 3-1:1.0: USB Mass Storage device detected
[665818.234550] scsi host4: usb-storage 3-1:1.0`