Symlinks to Removable Media

If it doesn't relate to Debian, but you still want to share it, please do it here
Message
Author
KitchM
Posts: 124
Joined: 2019-06-11 18:11

Re: Symlinks to Removable Media

#21 Post by KitchM »

One of the issues with most forums is that, although there are many well-meaning respondents like yourselves, it is extremely difficult for most people to get their minds around the needs of the poster. This is mostly because of the inability to read minds, and not really because something is not clear.

There is only one way around that. We must remember that the poster is absolutely not wanting to take a college course on a subject and is just trying to find a quick and concise answer or solution to a given problem. RTFM is rarely the solution. Therefore the solution is to show a simple way to do the job.

In my case, I have not seen any concrete answers as yet. However, there have been many ideas that force me into reading yet more information on my way to a college degree on the subject. I don't want that and I do not see forums as the place for that.

@ Dai_trying,
Interesting. I would think that the link must automatically work on every insertion of the USB device. Wouldn't that mean it must always be there? So why would I want the symlink removed? I don't understand that.

@cuckooflew,
I appreciate your view point and you most certainly have a right to it. If only it helped me. I believe you do not understand that everyone is different. Some minds do not understand auto mechanics or cooking or physics, and some minds do not well comprehend the poorly written (as I see it from an editor's viewpoint) text in man pages. For the most part it is geek-speak. And I have used computers and taught their use for thirty years. Believe me when I say that I would not expect many of my customers to ever understand man pages, nor would I ask them to.

Also, I believe that you may have failed to keep your thoughts on the subject when addressing my points. The subject was "udevadm monitor". When one types that command into a terminal, something is expected to happen and in this case to show a display of some sort. Correct? I got nothing.

Hence the points needing to be answered.

Thank you both for your interesting responses.

Dai_trying
Posts: 960
Joined: 2016-01-07 12:25

Re: Symlinks to Removable Media

#22 Post by Dai_trying »

KitchM wrote:@ Dai_trying,
Interesting. I would think that the link must automatically work on every insertion of the USB device. Wouldn't that mean it must always be there? So why would I want the symlink removed? I don't understand that.
If you are using a udev rule to mount a specific usb device (to a specific location) then I would think that when you physically remove this device from the system you want to remove the symlink to that device, otherwise you will always have the symlink but it will be broken unless you have that device inserted.

User avatar
Head_on_a_Stick
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Symlinks to Removable Media

#23 Post by Head_on_a_Stick »

KitchM wrote:The subject was "udevadm monitor". When one types that command into a terminal, something is expected to happen and in this case to show a display of some sort. Correct? I got nothing.
You do understand what the word "monitor" means, yes?

From the "useless" man page (emphasis added):
udevadm monitor [options]
Listens to the kernel uevents and events sent out by a udev rule and prints the devpath of the event to the console.
And once more:
I wrote:plug a device in
Black Lives Matter

Debian buster-backports ISO image: for new hardware support

cuckooflew
Posts: 681
Joined: 2018-05-10 19:34
Location: Some where out west

Re: Symlinks to Removable Media

#24 Post by cuckooflew »

H_O_A_S has told you twice now, and I will make a 3rd attempt , you need to plug in a device, then it will start producing out put, this will be the "uevent " out put. It is demonstrated here:
https://www.tecmint.com/udev-for-device ... -in-linux/
The following screenshot shows an excerpt of an ADD event after connecting a USB flash disk to the test system:

Code: Select all

$ udevadm monitor 
Image
I did post the link in a previous post: http://forums.debian.net/viewtopic.php? ... 92#p721362 But apparently you do not have enough interest to read any of the links we post, we must copy/paste it to here for you,...this is getting old.
by KitchM »
Also, I believe that you may have failed to keep your thoughts on the subject when addressing my points. The subject was "udevadm monitor"
Yes, your right it was, about udevadm monitor, but did you forget so fast, you are the one that also asked,What is a uevent?
KitchM wrote:As you should know, man pages are almost useless to the newbie. As such, they leave a lot of questions unanswered. In this case, here are some:
What is a uevent?
What sort of format should I expect to see?
How do I know if it is working correctly?
How do I get out of it, since this one, unlike most commands, does not return to the prompt on its own.
How does this help a person wishing to create a symlink?

Do not think that your efforts are not appreciated, because they are (regardless of any indication to the contrary by anyone). I raised no criticism of your efforts.

Thank you for your help and contributions.
So perhaps, if you do not want our thoughts to drift into other subjects, don't ask about other subjects, however, since uevent is related, but ok, I see what happened now, and I am sorry, I posted the wrong manual page, silly me . Here is the correct one,:
https://www.man7.org/linux/man-pages/ma ... adm.8.html
udevadm monitor [options]
Listens to the kernel uevents and events sent out by a udev rule and
prints the devpath of the event to the console. It can be used to
analyze the event timing, by comparing the timestamps of the kernel
uevent and the udev event.

-k, --kernel
Print the kernel uevents.

-u, --udev
Print the udev event after the rule processing.

-p, --property
Also print the properties of the event.

-s, --subsystem-match=string[/string]
Filter kernel uevents and udev events by subsystem[/devtype].
Only events with a matching subsystem value will pass. When this
option is specified more than once, then each matching result is
ORed, that is, all devices in the specified subsystems are
monitored.

-t, --tag-match=string
Filter udev events by tag. Only udev events with a given tag
attached will pass. When this option is specified more than once,
then each matching result is ORed, that is, devices which have
one of the specified tags are monitored.

-h, --help
Print a short help text and exit.
But even the one I did post, is related, to some extent, down at the bottom it shows you what more needs to be read:
SEE ALSO top

systemd-udevd.service(8), udevadm(8), systemd.link(5)
Any way, if you want us to keep our thoughts on the subject, it would help if you do the same. Don't worry, I enjoy this, and I am starting to figure out the game your playing, not sure if I like it though, I suspect I am going to stop seeing your posts pretty soon, so there fore will not be replying any more either, all though I might respond to comments made by others,...have a good day
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!

KitchM
Posts: 124
Joined: 2019-06-11 18:11

Re: Symlinks to Removable Media

#25 Post by KitchM »

@ Dai_trying,
If you are using a udev rule to mount a specific usb device (to a specific location) then I would think that when you physically remove this device from the system you want to remove the symlink to that device, otherwise you will always have the symlink but it will be broken unless you have that device inserted.
What would happen if it was not removed? In the case of a USB stick, the data on it would no longer be available and simply nothing would happen with the program that needed it to exist. In other words, the program would throw an access error and that would be that. No harm done.

However, once plugged back in, it immediately becomes available to the running program. Therefore the program can keep running if desired.

Have I missed something there?

Dai_trying
Posts: 960
Joined: 2016-01-07 12:25

Re: Symlinks to Removable Media

#26 Post by Dai_trying »

It is possible something could get written to the mount-point and it might cause the mount to fail later on and this is likely to show as a mount error in system logs, but it would be futile to have the udev rule attempt to unmount the device as it will not be triggered until the device is removed, and by that time there is nothing to unmount, which in itself can be an issue.

When in desktop mode I use file manager to mount/unmount any inserted device that I need and never have an issue, I kinda get the feeling that you might be trying to re-invent the wheel here as you already have a file manager which can do this and most DE's have an option to automount devices upon insertion, but looking back I remember now that you aren't actually using Debian so maybe the tails forum would be a better place to ask on this as there is likely to be much better advise, and I don't want to download another OS just to test this.

KitchM
Posts: 124
Joined: 2019-06-11 18:11

Re: Symlinks to Removable Media

#27 Post by KitchM »

Yes, I got it, but I think you misunderstand.

I would like to mount my drive which contains my Wasabi Wallet data under TailsOS. I don't really care I guess how it is done, except that I want it to be immediately recognized by the OS upon insertion (I think we're good on that part as is), and I want Wasabi to see it as its data location (.walletwasabi) without any further work.

I don't think anyone wants to bring up a file manager just to do that. I failed to check, however, if Tails mounts it automatically or not. I'll let you know.

Dai_trying
Posts: 960
Joined: 2016-01-07 12:25

Re: Symlinks to Removable Media

#28 Post by Dai_trying »

KitchM wrote:Yes, I got it, but I think you misunderstand.

I would like to mount my drive which contains my Wasabi Wallet data under TailsOS. I don't really care I guess how it is done, except that I want it to be immediately recognized by the OS upon insertion (I think we're good on that part as is), and I want Wasabi to see it as its data location (.walletwasabi) without any further work.
I think you're right, wouldn't an fstab entry do that easier? or would it need to be on any machine/installation/VM?
KitchM wrote:I don't think anyone wants to bring up a file manager just to do that.
I was just making a point about the device being recognised and can be mounted in several ways not really suggesting you do that unless it was an easy option of course.
KitchM wrote:I failed to check, however, if Tails mounts it automatically or not. I'll let you know.
[do I score a point for this]Maybe a tails forum post might have told you already[please] :lol:

KitchM
Posts: 124
Joined: 2019-06-11 18:11

Re: Symlinks to Removable Media

#29 Post by KitchM »

Yeah, yeah, very funny. :lol: But not exactly what I meant.

So, yes, I started Tails, opened the file manager and plugged a USB drive in, saw it appear in the listings and was immediately able to browse the files on it. Works fine. So that part is verified.

Post Reply