LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 09-03-2018, 01:16 PM   #1
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,772
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
how to prompt for external drive attachment


Is there a prefered or standard way to prompt the desktop and ask the end-user to attach an external HDD, thumb/key drive, or media card?
I'm asking because we have all grown to hate on-screen pop-up everything.

I'd like to use the notification features of the desktop, but I don't see a way for that to (1) stay on screen very long, and (2) allow end-user interaction with the notifying application.

In a nightmare long ago*, applications and utilities would issue a prompt at an "operator's console" asking that a specific disk pack or mag tape get mounted. The application would wait for the operator, often nagging every so often. Once the media was mounted, the operator would inform the application about which drive was used, if more than one was available, and processing would proceed.

Consider the need to copy files to external storage every day at 9AM.
This copy gets managed by a cron-job. Who knows how the workstation is being used at 0900 each day. From the cron-job, I'd like to prompt the desktop to attach the device to use for the data target, nagging the desktop until the request is satisfied, and so on.

Thanks in advance,
~~~ 8d;-} Dan

____________________
* re: "operator's console -- One example of this is the OPR utility from Digital® Tops10™. See Tops-10 Operator's Guide (This is a PDF file download.)
 
Old 09-03-2018, 03:01 PM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,235

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
YAD?
 
Old 09-04-2018, 01:18 PM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Yes, tell them if they don't, they miss the backup.
 
Old 09-07-2018, 02:19 PM   #4
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,772

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
It appears that I need to clarify my question/request.

I have scripts that run at various times. These scripts expect access to one or more EXTERNAL HDD devices -- drives not thumb/key devices or media cards. When the script runs, its required device might not be connected or powered up. Thus I want the script to prompt at the desktop to ask, I should probably say "nag," the end-user to make the desired device connected and online.

Given how everyone really hates popup everything, I would prefer to avoid something that suddenly appears on screen, and takes input focus away from whatever typing might be going on. Most desktop environments (DE) have some sort of notifier feature. Sadly, they are not really suitable for the sort of deferred interaction that suits my application requirements. I want the end-user to notice the pending request and remain aware of it until they provide the requested device. I don't want any sort of in-your-face win-dose do-this-now interruption.

I've thought about doing the following:
  • create a dialog at the back/bottom of the open window panels
  • use the notifier to announce that the dialog exists -- similar to how print queues announce their events
  • wait for interaction with the dialog
  • repeat until the request gets satisfied
  • give up after some while and notify that fact
Does this seem reasonable? Would everyone hate this sort of passive behind-the-curtain popup behavior?
If anyone has other, better, or different ideas, I'm eager to hear your suggestions.

Thanks in advance,
~~~ 0;-Dan
 
Old 09-07-2018, 02:38 PM   #5
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by SaintDanBert View Post
It appears that I need to clarify my question/request.

I have scripts that run at various times. These scripts expect access to one or more EXTERNAL HDD devices -- drives not thumb/key devices or media cards. When the script runs, its required device might not be connected or powered up. Thus I want the script to prompt at the desktop to ask, I should probably say "nag," the end-user to make the desired device connected and online.

Given how everyone really hates popup everything, I would prefer to avoid something that suddenly appears on screen, and takes input focus away from whatever typing might be going on. Most desktop environments (DE) have some sort of notifier feature. Sadly, they are not really suitable for the sort of deferred interaction that suits my application requirements. I want the end-user to notice the pending request and remain aware of it until they provide the requested device. I don't want any sort of in-your-face win-dose do-this-now interruption.

I've thought about doing the following:
  • create a dialog at the back/bottom of the open window panels
  • use the notifier to announce that the dialog exists -- similar to how print queues announce their events
  • wait for interaction with the dialog
  • repeat until the request gets satisfied
  • give up after some while and notify that fact
Does this seem reasonable? Would everyone hate this sort of passive behind-the-curtain popup behavior?
If anyone has other, better, or different ideas, I'm eager to hear your suggestions.

Thanks in advance,
~~~ 0;-Dan
I would use the desktop environment notification feature but give several warnings at timed intervals, including one saying "Final warning". You might think about also including an icon in the system tray that features an exclamation mark if a drive remains unattached which needs to be attached, to act as a permanent reminder once the warnings have been given and ignored.
 
1 members found this post helpful.
Old 09-07-2018, 02:41 PM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Code:
notify-send --help
I think it should answer your questions about notifications.

Last edited by ondoho; 09-08-2018 at 12:11 AM.
 
1 members found this post helpful.
Old 09-07-2018, 03:05 PM   #7
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Users can mount "EXTERNAL HDD devices"? Where is the mount point at is the Question.

Code:
man test
has example for testing. But can be difficult to decipher, so See https://www.linuxquestions.org/quest...8/#post3066998

Userland stuff (USBs, etc) are usually mounted at /media/user/something
Where fixed assets are at /mnt/ and not accessible to the user w\out elevated permissions/privs.

Last edited by Habitual; 09-07-2018 at 03:06 PM.
 
Old 09-13-2018, 06:56 PM   #8
AnastasiaGray
LQ Newbie
 
Registered: Sep 2018
Posts: 1

Rep: Reputation: 0
how to prompt for external drive attachment

Thanks. It's working.

But I have a problem, there is no debugger: missing gdb. You know how to set it?
 
Old 09-19-2018, 01:03 PM   #9
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,772

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by hydrurga View Post
I would use the desktop environment notification feature but give several warnings at timed intervals, including one saying "Final warning". You might think about also including an icon in the system tray that features an exclamation mark if a drive remains unattached which needs to be attached, to act as a permanent reminder once the warnings have been given and ignored.
Very good suggestions.
Thank you for this effort,
~~~ 0;-Dan
 
Old 09-19-2018, 01:12 PM   #10
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,772

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by Habitual View Post
...
Userland stuff (USBs, etc) are usually mounted at /media/user/something
Where fixed assets are at /mnt/ and not accessible to the user w\out elevated permissions/privs.
I'm aware of /mnt/* and /media/username/*.

Though I've asked several times, I've yet to get any explanation or a pointer to an explanation of how the processing happens, where it is configured, if and how one gets to alter any of these details, etc.
Specifically, when I connect a USB-stick, media card, or USB-connected HDD, what happens:
  • the USB hardware notices the new connection
  • a "which device" dance happens
  • an "its a disk" (of some sort) dance happens
  • things appear in /dev
  • something creates mount points
  • something causes the new device to mount at the new mount point
What decides "its a disk"?
What decides "use this /mnt vs. /media"?
What decides "create XXX as mount point name"?
What decides "mount with these parameters"?
... I could go on...

Thanks in advance,
~~~ 0;-Dan
 
Old 09-19-2018, 01:40 PM   #11
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by SaintDanBert View Post
I'm aware of /mnt/* and /media/username/*.

Though I've asked several times, I've yet to get any explanation or a pointer to an explanation of how the processing happens, where it is configured, if and how one gets to alter any of these details, etc.
Specifically, when I connect a USB-stick, media card, or USB-connected HDD, what happens:
  • the USB hardware notices the new connection
  • a "which device" dance happens
  • an "its a disk" (of some sort) dance happens
  • things appear in /dev
  • something creates mount points
  • something causes the new device to mount at the new mount point
What decides "its a disk"?
What decides "use this /mnt vs. /media"?
What decides "create XXX as mount point name"?
What decides "mount with these parameters"?
... I could go on...

Thanks in advance,
~~~ 0;-Dan
As far as I know, you can determine through the desktop environment whether or not removable devices are auto mounted.

For example, on my MATE system, there is the configuration item: org.mate.media-handling automount true

The actual mounting process, including deciding on the location, appears to be carried out by udisks (in the case of my system, udisks2).

See https://askubuntu.com/questions/2146...mount-location for some info.
 
1 members found this post helpful.
Old 09-19-2018, 02:00 PM   #12
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,730

Rep: Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920
I'm no expert and the following may not be totally correct but should be the basics of how things happen.

In a nutshell, when a USB device is plugged into a computer it goes through an enumeration process and if identified by the USB subsystem the appropriate driver is installed. A device is identified by its descriptors. In the case of a storage system the driver creates the device ID. Check out the link below.

Where and how it is mounted is dependent on the distribution/desktop. I'm not exactly sure how the desktop gets the message that a drive was inserted but I assume by some process communication like d-bus which is used by udisks. By convention these days external media is mounted at /media. Depending on distribution/desktop the mount point name is typically one of the following, volume name if it exists, UUID if it exists or by device ID.

The desktop itself should have a configuration setting that enables auto mounting as well as the mount options.


https://www.ftdichip.com/Support/Doc...numeration.pdf

Last edited by michaelk; 09-19-2018 at 02:01 PM.
 
1 members found this post helpful.
Old 09-20-2018, 01:00 AM   #13
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by SaintDanBert View Post
Though I've asked several times, I've yet to get any explanation or a pointer to an explanation of how the processing happens, where it is configured, if and how one gets to alter any of these details, etc.
Specifically, when I connect a USB-stick, media card, or USB-connected HDD, what happens:
  • the USB hardware notices the new connection
  • a "which device" dance happens
  • an "its a disk" (of some sort) dance happens
  • things appear in /dev
  • something creates mount points
  • something causes the new device to mount at the new mount point
What decides "its a disk"?
What decides "use this /mnt vs. /media"?
What decides "create XXX as mount point name"?
What decides "mount with these parameters"?
udev

and really, please at least try to do some research yourself before asking such questions.
 
1 members found this post helpful.
Old 10-02-2018, 04:15 PM   #14
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,772

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by ondoho View Post
...
and really, please at least try to do some research yourself before asking such questions.
Thank you for this reminder.

In my defense, I'd like to point out that having knowledge of system behavior and having any idea of the several names that it might be called are two distinctly different bases of knowledge. In addition, some behaviors and their supporting packages have been rapidly moving targets for several years -- even to the point of changes from one release to the next. In my specific case, the parts and packages and names for detecting connection of a device, loading drivers, making entries in /dev, connecting /dev entries with upper-level modules or components so that the end-user layers might access them, creating mount points when required, mounting drives, and so on, are a real boiling sea ... and thus not even include the issues of SysV-init vs. Upstart vs. Systemd and friends.

I expected to find prose of some sort that would walk me through the processing whereby one connects a device by USB, the crank turns, and an end-user mounted file system becomes available. That prose might continue to discuss how that process might be configured or altered by an admin end-user. When I did not find the prose that I sought, I asked questions.

I regret that my lack of knowledge resulted in questions for which answers should have been obvious to others who are better or differently informed. I regret, too, that "you just gotta know" and "read the code" are attitudes that continue to prevail in the Linux/Unix world.

Thanks for your reply,
~~~ 0;-/ Dan
 
Old 10-03-2018, 04:27 PM   #15
jmgibson1981
Senior Member
 
Registered: Jun 2015
Location: Tucson, AZ USA
Distribution: Debian
Posts: 1,141

Rep: Reputation: 392Reputation: 392Reputation: 392Reputation: 392
If I understand. You want to prompt people to plug in a drive so that backups can happen? I'll say it. That is a terrible plan. Anytime manual intervention is required for a backup to happen then you will miss backups guaranteed! I don't even trust myself to plug in a drive when prompted. I do it all over the network. Hell I'm not even sure when my backups run, just know they fire daily. Relying on people / employees? to keep up with this is a bad idea all around. This should be fully automatic, preferably over the network to a NAS, cloud storage, anything that doesn't require anyone to follow a prompt. This prompt you happen to be trying to make very easy to ignore. Recipe for disaster is what this looks like to me. I don't mean to offend of course. There are a number of better ways to go about this.


Unless I misread your intent of course?

Last edited by jmgibson1981; 10-03-2018 at 04:52 PM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
convert email files with attachment to save as attachment file (metamail?) ted_chou12 Linux - Software 2 04-08-2011 08:01 PM
How to boot External USB drive in grub prompt? rajarishi Linux - General 1 06-14-2006 04:27 AM
mount External usb drive in grub prompt. rajarishi Linux - General 2 06-12-2006 11:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 07:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration