Unable to mount MTP with a colon in device name
Hello!
I'm unable to mount a MTP device using Nautilus.
I did some investigation and found that somehow Nautilus drops the colon on the device name and it can't find the USB path for it.
Logs:
mtp: (I) do_mount
mtp: (I) do_mount: host=Xiaomi_SDM660-MTP__SN
mtp: (II) get_dev_path_from_host: Xiaomi_SDM660-MTP__SN
mtp: send_reply(0x5587bcac1820), failed=1 (Couldn’t find matching udev device.)
mtp: (I) g_vfs_backend_mtp_finalize
mtp: (I) g_vfs_backend_mtp_finalize done.
[ 3498.629755] usb 1-4: new high-speed USB device number 29 using xhci_hcd
[ 3499.136492] usb 1-4: New USB device found, idVendor=2717, idProduct=ff48, bcdDevice= 4.04
[ 3499.136495] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3499.136496] usb 1-4: Product: SDM660-MTP _SN:B95009B1
[ 3499.136497] usb 1-4: Manufacturer: Xiaomi
[ 3499.136498] usb 1-4: SerialNumber: 9d94caed
As you can see, the MTP name is "SDM660-MTP _SN:B95009B1", and Nautilus correctly shows the name: .
But when I try to mount it, Nautilus tries to mount using device name: Xiaomi_SDM660-MTP__SN
, losing everything after the colon, and thus unable to mount.
When I try to mount on Nautilus using 'mtp://[usb:001,014]'
, Nautilus correctly opens it, so it isn't a udev problem.
Nautilus version: 3.30.0 gvfs version: 1.38.0+3+g7da3b0ba-1 gvfs-mtp version: 1.38.0+3+g7da3b0ba
I found the correct device path to mount using GIO:
gio mount 'mtp://Xiaomi_SDM660-MTP__SN%3AB95009B1_9d94caed'
I escaped the colon and added the rest of the device name and appended the serial number.