Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

unable to open eg USB disk

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
User avatar
graemev2
Posts: 95
Joined: 2019-01-08 17:28
Has thanked: 2 times

unable to open eg USB disk

#1 Post by graemev2 »

Posting here, because even though I've solved it, it didn't crop up in any searches. Hopefully, it now will:

Having recently installed buster, I plugged in my DSLR, to get a window pop with:

"...."no application is registered..."

There was a "little disc icon" of the desktop (representing) the camera. Clicking on it it got a new popup , to the effect of "choose an application to open this" (none worked) . If I had rapid photo downloader installed , it burst into activity but failed to download anything .

Using the GUI to visit /media/graeme/ ...got a permission error.

Looking at the directory in shell showed all /media/* files were owned an only RWX by root (for 3 different users)
looking in emacs warned of the presence of an ACL, so:

Code: Select all

 # getfacl /media/*
getfacl: Removing leading '/' from absolute path names
# file: media/cdrom
# owner: root
# group: root
user::rwx
group::r-x
other::r-x

# file: media/cdrom0
# owner: root
# group: root
user::rwx
group::r-x
other::r-x

# file: media/graeme
# owner: root
# group: root
user::rwx
user:owner:r-x              <-------------------------------- ****** NOTE *****
group::---
mask::r-x
other::---

# file: media/guest
# owner: root
# group: root
user::rwx
user:guest:r-x
group::---
mask::r-x
other::---

# file: media/user666
# owner: root
# group: root
user::rwx
user:user666:r-x
group::---
mask::r-x
other::---
(yes, I really have a user called owner )

I have no idea why anybody would want to use an ACL , rather than simple file mode bits . I guess it escapes update by things like usermod(8) and whatever I did to shoehorn my user id (graeme) back in following an install.

My solution was simply to delete the rogue directory and create simple ACL-free one owned by me:

Code: Select all

# cd /media
# rmdir graeme
# mkdir graeme
# chown graeme:  graeme
I must say I don't like this, random files owned by users outside their home, which exist statically. Feels very much like a fail to danger to me. Hard to see how it's going to work with e.g. NFS based $homes for users or user migration or even backup & restore?

Mind you I have trouble working out why random disks, plugged into a system end up being mounted and owned by whichever user happened to be on the/an xconsole? Two partitions on this machine , which are only used when it dual boots into fedora end up appearing on my desktop and mounted in /media .... they are really not there for any user on the Debian console ??

cuckooflew
Posts: 677
Joined: 2018-05-10 19:34
Location: Some where out west
Been thanked: 1 time

Re: unable to open eg USB disk

#2 Post by cuckooflew »

It might be just me,because I don't understand the post very well, first, for those that have trouble understanding acronyms,ACL is Access control list
So then you say:
(yes, I really have a user called owner )
I have no idea why anybody would want to use an ACL , rather than simple file mode bits . I guess it escapes update by things like usermod(8) and whatever I did to shoehorn my user id (graeme) back in following an install.
My solution was simply to delete the rogue directory and create simple ACL-free one owned by me:
Based only on what I read in the wiki, I can understand many reasons why a ACL would be used,
so you delete the directory, ??? I do not understand why you would do that ?In any event it does not sound like a solution to me, sounds more like the beginning of additional problems, :
graemev2 »I must say I don't like this, random files owned by users outside their home, which exist statically. Feels very much like a fail to danger to me. Hard to see how it's going to work with e.g. NFS based $homes for users or user migration or even backup & restore?
Mind you I have trouble working out why random disks, plugged into a system end up being mounted and owned by whichever user happened to be on the/an xconsole?
Really, ? Did you by any chance at least have enough sense to make a copy/back up of the unknown directory you deleted, ? I think you made a big mistake,
graemev2 >My solution was simply to delete the rogue directory
Did the "rogue" directory have a name ?
=====edited =======
First, really your posts are a bit prolix, extremely difficult to follow, the use of acronyms makes it worse,
but any way, there is a better way to mount and open a digital camera, including [ur=https://en.wikipedia.org/wiki/Digital_s ... lex_camera]DSLR[/url] I suggest restoring the directory and files you deleted, and then try using the instructions here:
https://wiki.debian.org/Digital_Cameras If that does not work , ask for advice ,before deleting directories , etc,... obviously your method does not work well, also your topic title is very misleading, "unable to open eg USB disk", a usb disk, is not at all the same as a digital camera, the "DSLR" part, really is irrelevant, but it might be relevant to know what kind of camera, I mean brand , EG:
From:https://wiki.debian.org/Digital_CamerasPractical
To detect as root what kind of camera is connected at the USB interface:

Code: Select all

 cat /var/log/syslog 
( Any one that is serious, should read it all)
If you want help in doing this correctly, please post the output of the above command.
Also ,
by graemev2 >> Having recently installed buster, I plugged in my DSLR, to get a window pop with:

"...."no application is registered..."

There was a "little disc icon" of the desktop (representing) the camera. Clicking on it it got a new popup , to the effect of "choose an application to open this" (none worked) . If I had rapid photo downloader installed , it burst into activity but failed to download anything
If you read the wiki, :
In this example it's clear that the camera is using the specific protocol, called gphoto2; the gphoto2 digital camera command-line client, which can be used by applications to access various digital camera models. An additional interesting package gtkam, is a graphical application based on GTK+ for digital still cameras supported by gphoto2. More information can be found an gphoto.org.

Required package(s):

Code: Select all

apt install gphoto2 gtkam 
https://packages.debian.org/buster/gphoto2:

digital camera command-line client

The gphoto2 library can be used by applications to access various digital camera models, via standard protocols such as USB Mass Storage and PTP, or vendor-specific protocols.

This package provides the gphoto2 command-line frontend.
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!

cuckooflew
Posts: 677
Joined: 2018-05-10 19:34
Location: Some where out west
Been thanked: 1 time

Re: unable to open eg USB disk

#3 Post by cuckooflew »

Postby graemev2 » 2020-05-30 20:58
Posting here, because even though I've solved it, it didn't crop up in any searches. Hopefully, it now will
You did not solve it, and I hope no one mistakes what you call a solution, for a real solution. Why on earth did you want that to crop up in searches ?
I don't know what keywords you use for your search, but these:

Code: Select all

How to mount and open DSLR camera  on Debian 10 
key words, get a lot of good results, the debian wiki is the first hit:
Try it :How to mount and open DSLR camera on Debian 10
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!

User avatar
eriefisher
Posts: 130
Joined: 2008-06-04 03:49
Location: Ontario's South Coast

Re: unable to open eg USB disk

#4 Post by eriefisher »

I must say I don't like this, random files owned by users outside their home, which exist statically. Feels very much like a fail to danger to me. Hard to see how it's going to work with e.g. NFS based $homes for users or user migration or even backup & restore?
If a USER plugs in a usb drive or sd card etc it would normally be mounted /media/USER/(usb-drive). How is this random files outside their HOME? It's by design.

I'm having a real hard time determining what was going on and what you did to solve it. Very hard to follow along.
____________________________________________
There's a manual?
Siduction
Debian Sid
Xfce4 4.14

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: unable to open eg USB disk

#5 Post by Head_on_a_Stick »

eriefisher wrote:I'm having a real hard time determining what was going on
The OP's user has a system ID rather than a user ID and it's causing strange b0rkage: http://forums.debian.net/viewtopic.php?p=721474#p721474

@OP: your user should have an ID starting from 1000, I suspect that would fix the problem described in this thread.
geamev2 wrote:My solution was simply to delete the rogue directory and create simple ACL-free one owned by me
That's not a solution...
deadbang

cuckooflew
Posts: 677
Joined: 2018-05-10 19:34
Location: Some where out west
Been thanked: 1 time

Re: unable to open eg USB disk

#6 Post by cuckooflew »

eriefisher »If a USER plugs in a usb drive or sd card etc it would normally be mounted /media/USER/(usb-drive). How is this random files outside their HOME? It's by design.
Not really, I might be wrong on that, but I suspect it is related to the unknown directory that got deleted, that was not a solution , it was a mistake, however the OP did do it deliberately, so I suppose it is by design, on part of the user, but certainly not by design on a normal default install, and does not occur normally.
eriefisher »Very hard to follow along.
Yes it is. The acronym ACL ( Access control list ), well even the name kind of gives you a idea of what that deleted directory was, I posted a link, that helps explain what a Access control list is, and why we use it,now the OP has random files opening out side of home, and other problems. The UID as well, but I suspect that the "rogue directory" needs to be restored, hard to say when we do not know what name and path this directory was in. it appears, /media/???? but again it hard to follow.
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: unable to open eg USB disk

#7 Post by p.H »

cuckooflew wrote:for those that have trouble understanding acronyms,ACL is Access control list
Come on. ACL is a standard acronym, just like DNS or CPU. Anyone reading and not knowing what it is should either get information by themselves (if interested) or stop reading (if not interested).
cuckooflew wrote:First, really your posts are a bit prolix
Are you really writing this seriously while your own posts account for the biggest part in this thread ?
cuckooflew wrote:You did not solve it, and I hope no one mistakes what you call a solution
You are partly correct. Deleting the directory was a perfectly valid solution, simpler than changing the access rights. But re-creating it by hand was not the best thing to do : this directory only contains dynamic mount points and is created automatically with the proper permissions when needed if it does not exist.

User avatar
graemev2
Posts: 95
Joined: 2019-01-08 17:28
Has thanked: 2 times

Re: unable to open eg USB disk

#8 Post by graemev2 »

But re-creating it by hand was not the best thing to do : this directory only contains dynamic mount points and is created automatically with the proper permissions when needed if it does not exist.
Ahh that's good to know.

OK I assumed folks knew a lot of this stuff. Possibly I misjudged:

1: It's not related to cameras , it just any USB (possibly just any) external disk plugged in behaves like this
2: The automount of these via UDEV has been around a while
3: On MY old system (but not a new squeeze, I just installed), these are simply owned by $USER (e.g graeme) with mode 660 (or similar)
4: More recently it seems to have been done with an ACL instead of mode bits. This feels really ugly and unnecessary (particularly as it seems some people are unfamiliar with with DAC & MAC type access control)

Anyhow I blew away the incorrect directory and opted to create the new one using simple file mode bits. This has the advantage of not being tied to a particular username .

In case it wasn't clear (or people are unfamiliar) that ACL entry:

Code: Select all

# file: media/graeme
# owner: root
# group: root
user::rwx
user:owner:r-x              <-------------------------------- ****** NOTE *****
group::---
mask::r-x
other::---

Gives root read+write+execute perms (as the owner) + gives a user called "owner" Read+execute but gives no access to "graeme" :-) I know how this came about (but must avoid being prolix )

So , In effect what happened is the UDEV system managed the mounting fine, normal user access, via bash, gave a sensible error , but using the GUI resulted in some very confusing messages and I thought it might help people if a quick google search pointed them at this cause.

I'm unsure how all these "features" should work when say my $HOME comes via a NFS mount and my uid is in NIS or LDAP . I must say the dynamic creation will help [ good call @p.H ] , dynamic removal would be nice too :-)

Post Reply