Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

cannot mount smartphone anymore

45 views
Skip to first unread message

Emanuel Berg

unread,
Jun 11, 2021, 9:00:05 PM6/11/21
to
I use to use this little zsh

#! /bin/zsh
mount-smartphone () {
jmtpfs $(mktemp -d phone.XXXXXX)
}
alias smph=mount-smartphone

to mount the Samsung Galaxy Note 2 LTE GT-N7105 16GB (t0lte,
Android 4.4.2) smartphone filesystem in my $HOME.

But suddenly it doesn't work, it says:

Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).
libusb_get_active_config_descriptor(1) failed: No data available
no active configuration, trying to set configuration
libusb_get_active_config_descriptor(2) failed: No data available
LIBMTP PANIC: Unable to initialize device
terminate called after throwing an instance of 'MtpErrorCantOpenDevice'
what(): Can't open device

Idea?

TIA

--
underground experts united
https://dataswamp.org/~incal

deloptes

unread,
Jun 12, 2021, 5:10:04 AM6/12/21
to
Emanuel Berg wrote:

> But suddenly it doesn't work, it says:
>
> Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).
> libusb_get_active_config_descriptor(1) failed: No data available
> no active configuration, trying to set configuration
> libusb_get_active_config_descriptor(2) failed: No data available
> LIBMTP PANIC: Unable to initialize device
> terminate called after throwing an instance of 'MtpErrorCantOpenDevice'
> what():  Can't open device

On the phone did you allow the PC to access the phone?

Emanuel Berg

unread,
Jun 12, 2021, 10:10:04 AM6/12/21
to
I don't remember this was anything one had to do but no, how
do you do that?

deloptes

unread,
Jun 12, 2021, 12:30:05 PM6/12/21
to
Emanuel Berg wrote:

> I don't remember this was anything one had to do but no, how
> do you do that?

I don't use iphone/android, but last time I did (2-3 months ago), when I
plugged the cable it prompted on the phone and asked if I allow the access
for this device.
If it is not prompted look at the logs (dmesg -T) after plugging the cable
and best paste here.

Emanuel Berg

unread,
Jun 12, 2021, 12:50:05 PM6/12/21
to
deloptes wrote:

>> I don't remember this was anything one had to do but no, how
>> do you do that?
>
> I don't use iphone/android, but last time I did (2-3 months
> ago), when I plugged the cable it prompted on the phone and
> asked if I allow the access for this device. If it is not
> prompted

It says, "Connected as a media device".

> look at the logs (dmesg -T) after plugging the cable and
> best paste here.

[Sat Jun 12 18:42:12 2021] usb 1-4: new high-speed USB device number 3 using xhci_hcd
[Sat Jun 12 18:42:12 2021] usb 1-4: New USB device found, idVendor=04e8, idProduct=6860, bcdDevice= 4.00
[Sat Jun 12 18:42:12 2021] usb 1-4: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[Sat Jun 12 18:42:12 2021] usb 1-4: Product: GT-N7105
[Sat Jun 12 18:42:12 2021] usb 1-4: Manufacturer: samsung
[Sat Jun 12 18:42:12 2021] usb 1-4: SerialNumber: 42f7c50d4f409fdf
[Sat Jun 12 18:42:12 2021] usb 1-4: Device is not authorized for usage

"Device is not authorized for usage", that's probably the
problem, right?

deloptes

unread,
Jun 12, 2021, 2:10:05 PM6/12/21
to
Emanuel Berg wrote:

> "Device is not authorized for usage", that's probably the
> problem, right?

google says in context of Ubuntu - USBGuard
the package is also in debian - could be you have it installed?

Emanuel Berg

unread,
Jun 12, 2021, 4:00:05 PM6/12/21
to
I did, and when I removed it, it works again!

Thanks a lot!

Straight expert advice!

l0f...@tuta.io

unread,
Jun 13, 2021, 3:00:05 AM6/13/21
to
Hi,

12 juin 2021, 21:54 de moase...@zoho.eu:

> deloptes wrote:
>
>>> "Device is not authorized for usage", that's probably the
>>> problem, right?
>>>
>>
>> google says in context of Ubuntu - USBGuard the package is
>> also in debian - could be you have it installed?
>>
>
> I did, and when I removed it, it works again!
>
Removing usbguard is maybe a drastic decision, isn't?
Or maybe you don't want this package anymore for other reasons?

Otherwise, you could just add a rule authorizing your device to connect:

sudo usbguard append-rule 'allow id XXXX:XXXX serial "XXXX" name "XXXX" hash "XXXX" parent-hash "XXXX" with-interface XX:XX:XX'

sudo usbguard list-devices
will tell you the correct parameters (of course usbguard must be running and your device connected/blocked).

Best regards,
l0f4r0

Curt

unread,
Jun 13, 2021, 9:10:05 AM6/13/21
to
On 2021-06-13, l0f...@tuta.io <l0f...@tuta.io> wrote:
>
> Otherwise, you could just add a rule authorizing your device to connect:
>
> sudo usbguard append-rule 'allow id XXXX:XXXX serial "XXXX" name "XXXX" hash "XXXX" parent-hash "XXXX" with-interface XX:XX:XX'
>
> sudo usbguard list-devices
> will tell you the correct parameters (of course usbguard must be running and your device connected/blocked).


You can generate a ruleset based on your currently attached USB devices
by executing usbguard generate-policy > /etc/usbguard/rules.conf as
root.

https://wiki.archlinux.org/title/USBGuard

I'm for taking the route of least resistance (to my hebetude).

> Best regards,
> l0f4r0

Emanuel Berg

unread,
Jun 13, 2021, 11:10:05 AM6/13/21
to
l0f4r0 wrote:

> Removing usbguard is maybe a drastic decision, isn't?
> Or maybe you don't want this package anymore for
> other reasons?

No, why do I need it for?

Anyway it is removed now...

Curt

unread,
Jun 13, 2021, 12:20:04 PM6/13/21
to
On 2021-06-13, Emanuel Berg <moase...@zoho.eu> wrote:
> l0f4r0 wrote:
>
>> Removing usbguard is maybe a drastic decision, isn't?
>> Or maybe you don't want this package anymore for
>> other reasons?
>
> No, why do I need it for?

He probably assumed you installed it intentionally, and so for a reason,
as it appears to be an optional package.

l0f...@tuta.io

unread,
Jun 13, 2021, 3:00:04 PM6/13/21
to
Hi,

13 juin 2021, 17:51 de cu...@free.fr:
Exactly! You should have had a good reason Emanuel to install it at the first place, no?

This package can be useful to limit access to your computer usb ports (in case you leave the machine unattended).

Best regards,
l0f4r0

Emanuel Berg

unread,
Jun 13, 2021, 4:00:05 PM6/13/21
to
Curt wrote:

>>> Removing usbguard is maybe a drastic decision, isn't?
>>> Or maybe you don't want this package anymore for
>>> other reasons?
>>
>> No, why do I need it for?
>
> He probably assumed you installed it intentionally, and so
> for a reason, as it appears to be an optional package.

If so I don't remember why :)

Emanuel Berg

unread,
Jun 13, 2021, 4:00:05 PM6/13/21
to
l0f4r0 wrote:

>> He probably assumed you installed it intentionally, and so
>> for a reason, as it appears to be an optional package.
>>
> Exactly! You should have had a good reason Emanuel to
> install it at the first place, no?

I don't remember.

> This package can be useful to limit access to your computer
> usb ports (in case you leave the machine unattended).

That doesn't sound like me. I have autologin enabled and
I never lock the front door...

Andrei POPESCU

unread,
Jun 14, 2021, 2:30:04 AM6/14/21
to
On Du, 13 iun 21, 21:49:03, Emanuel Berg wrote:
> Curt wrote:
>
> >>> Removing usbguard is maybe a drastic decision, isn't?
> >>> Or maybe you don't want this package anymore for
> >>> other reasons?
> >>
> >> No, why do I need it for?
> >
> > He probably assumed you installed it intentionally, and so
> > for a reason, as it appears to be an optional package.
>
> If so I don't remember why :)

But aptitude might know:

aptitude why usbguard


Kind regards,
Andrei
--
http://wiki.debian.org/FAQsFromDebianUser
signature.asc

Emanuel Berg

unread,
Jun 14, 2021, 3:50:05 AM6/14/21
to
Andrei POPESCU wrote:

>>>>> Removing usbguard is maybe a drastic decision, isn't?
>>>>> Or maybe you don't want this package anymore for
>>>>> other reasons?
>>>>
>>>> No, why do I need it for?
>>>
>>> He probably assumed you installed it intentionally, and so
>>> for a reason, as it appears to be an optional package.
>>
>> If so I don't remember why :)
>
> But aptitude might know:
>
> aptitude why usbguard

OK:

i gnome-online-accounts Recommends gnome-control-center (>= 3.6.1)
i A gnome-control-center Depends gnome-settings-daemon (>= 3.37)
i A gnome-settings-daemon Suggests usbguard

Not really a GNOME user so again don't know what that means...

Reco

unread,
Jun 14, 2021, 4:00:05 AM6/14/21
to
Hi.
It means this, based on the package changelog:

gnome-settings-daemon (3.35.91-1) experimental; urgency=medium

[ Sebastien Bacher ]
* New upstream release:
- Add capability to disable USB while the lockscreen is on
(based on USBGuard)
* debian/control.in:
- Suggests usbguard for the new lockscreen protection, the feature
didn't get much testing yet and usbguard could create problems so
don't bring it in by default yet


I.e. what it should do is to deny any usb devices from configuring while
you have a lockscreen on. The changelog message also shows that
currently one have to install Suggests type of dependency to get this
feature.

Reco

Andrei POPESCU

unread,
Jun 15, 2021, 12:00:05 AM6/15/21
to
On Lu, 14 iun 21, 09:46:02, Emanuel Berg wrote:
> Andrei POPESCU wrote:
> >>
> >> If so I don't remember why :)
> >
> > But aptitude might know:
> >
> > aptitude why usbguard
>
> OK:
>
> i gnome-online-accounts Recommends gnome-control-center (>= 3.6.1)
> i A gnome-control-center Depends gnome-settings-daemon (>= 3.37)
> i A gnome-settings-daemon Suggests usbguard
>
> Not really a GNOME user so again don't know what that means...

This suggests (no pun intended) it was installed manually
(`apt list usbguard` would confirm this), as Suggests are not installed
by default.
signature.asc

Emanuel Berg

unread,
Jun 15, 2021, 12:20:04 AM6/15/21
to
Andrei POPESCU wrote:

> This suggests (no pun intended) it was installed manually
> (`apt list usbguard` would confirm this), as Suggests are
> not installed by default.

alias ai='sudo apt-get --install-suggests install'
https://dataswamp.org/~incal/conf/.zsh/apt
0 new messages