Void Linux discussion
 help / color / mirror / Atom feed
* (how to) automount USB ports
@ 2015-07-31 15:19 Userx Xbw
  2015-08-01  4:54 ` JD Robinson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Userx Xbw @ 2015-07-31 15:19 UTC (permalink / raw)
  To: voidlinux


[-- Attachment #1.1: Type: text/plain, Size: 4022 bytes --]

O' Tay, I have a few different WM/DE installed here on VOidLiNux -- now 
this automounting of the USB Ports, is getting me  very curious as to how 
does lxde and Enlightenment automount when i3 and dwm does not, mostly 
thinking in the manner of pcmanfm or simulaire FileManager when open up one 
needs to see the USB mounted devices, what ever they are and reguardless if 
it is on, /dev/sdc . /dev/sdd , /dev/sde  etc... I was reading how to's on 
this matter using autofs - then in my working this almost solution, when I 
went to istall autofs and seen that is was going to install it. I stopped 
-- said to myself, if it is not installed, then what is this system using 
to do the same thing I want it to do already? 

Just not in i3 or dwm when I am using pcmanfm, but in my de lxde and E they 
work with their respective filemanangers, and on the deaktops, minus the 
desktop, in i3 and dwm, because they are titling wm. nevertheless the 
filemanagers within these two wm and others should still have this same 
capability to automount USB Ports. 

with autofs this help me how to post is telling me I have to get the make 
of what ever it is that is pluged into it not just the fact that something 
just got pluged into it so figure it out then deal with it accordingly. as 
this is what my DE are doing.

example right now I have a little Andriod Phone pluged in so I can copy 
some movies over onto it to watch , and a 1TB hard drive using an IDE to 
USB adaptor.
/run/media/userx/4489-120D  <--- that being my android Ph /dev/sdc
/run/media/userx/winlinux  <--- that being my external HDD /dev/sdd

these are generic mount points that to me have to be getting generated 
automaticlly and not like it is said to do using autofs where I have to 
explicedly tell it the make of what ever it is I am pluging into the USB 
port limiting the ability to just plug in what ever make of USB stick or 
hdd / exteranl HDD to use in USB. (I maybe off on this thought a little) 
but nevertheless, this instruction is telling me I have to write a file 

in the example they show this, 

$ udevinfo -a -p /sys/block/sdc/ | grep model
    ATTRS{model}=="Ext HDD 1021    "


Now, that we have model attribute, we can add it to 
/etc/udev/rules.d/custom.rules by following line:

SUBSYSTEM=="scsi", ATTRS{model}=="Ext HDD 1021    ", SYMLINK+="Iomega%n"

I understand in /etc/udev/rules.d/ the only file I have in their so far is 
this one, 10-network.rules

SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:21:6a:be:c7:08", 
NAME="wlan0"

where the ATTR is hard coded because the MAC address never changes, and the 
ATTRS for a USB will, 

this is my andriod ph /run/media/userx/4489-120D 
 userx@void :^rules.d^ @~&udevadm info -a -p /sys/block/sdc | grep model
    ATTRS{model}=="File-CD Gadget  "

this is my external HDD /run/media/userx/winlinux 
 userx@void :^rules.d^ @~&udevadm info -a -p /sys/block/sdd | grep model
    ATTRS{model}=="                "

as you can see between /dev/sdc and /dev/sdd the ATTRS will change 
depending on what it is one plugs into it. as well as where are the files 
VOidLiNux uses to get their auto mounts working, as I can planly see they 
are not using the /etc/udev/rules.d/ with USB Ports. VOidLiNux is showing 
4489-120D and the lable on the HDD winlinux as mount points, the example 
for autofs says I got a use the output of udev model one shows something 
and the other is left blank on my laptop, two different things, meaning I'd 
ahve to type in every kind of mode that can be plugged into a USB to get it 
to automount? when I can see VOidLiNux and others have a better way to do 
it. 

so the question would be. How do I plug i3 and dwm and anything else 
(wm/de) I need to in order to use this methoid of behavor that VOidLiNux is 
having with the DE and E? Especially when using any number of FileManagers. 
what little "secret" program and or meth are they using to get this auto 
USB Port mount to work that I can tie into when using pcmanfm in i3 and dwm 
(so far)?



[-- Attachment #1.2: Type: text/html, Size: 4310 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* (how to) automount USB ports
  2015-07-31 15:19 (how to) automount USB ports Userx Xbw
@ 2015-08-01  4:54 ` JD Robinson
  2015-08-01  5:18 ` JD Robinson
  2015-08-01 12:47 ` Userx Xbw
  2 siblings, 0 replies; 4+ messages in thread
From: JD Robinson @ 2015-08-01  4:54 UTC (permalink / raw)
  To: voidlinux

[-- Attachment #1: Type: text/plain, Size: 2535 bytes --]

There's really no easy solution if say, your lables are changing and so too are the ports your plugging things into.

I'm sadly reminded of why windows uses such things as autorun.inf and am comforted in knowing that Linux DEs can recognize hard drives by UUID and thus mount them automatically. This is usually done via the respective settings because the DE is aware of hot plugging and can restore the state of a session if need be.

That being said. Mounting by UUID is most likely the culprit for remembering hdd USB devices and built ins, however I, myself, have noticed that flash drives are identified by lables and what not.

If you're going to use something like automount you could simply create a folder with whatever name you like and set the appropriate mounting point to the folder. This would be one way to alias a UUID to a folder name without changing any drive parameters and thus be easy to recognize.

As for void, I haven't bothered trying this, even with identical drives and different data on each it becomes a matter of manual intervention since the uuids are all different it makes things easier.

So getting back to autorun.inf, lol, this is an innocuous file that could be used to do things in Linux if you had something you wanted to trigger on automounting.

Autofs and automount or similar daemons should have various ways of identifying drives storage volumes similar to logical volume management, it would just be a matter of setting up your own triggers for where you want things mounted or directed based on what the daemons can see.

I wouldn't rely on devices attached to the USB bus as static or as static as as actual data plugs. These don't change unless you move a plug, but don't quote me on that, this is why things are givemna UUID.

( for void, sv )

Flash drives, thumb drives and phones, etc. aren't as easy to pin down unless you've got sv set up to run a shell scripts as a daemon that looks for dbus events and activities that indicate that your phone or a special device has been plugged in and then what to do with it after that. This wouldn't solve the problem of identical models with different contents, which is why I mention autorun.inf...

Instead I would probably create a file with a file name that's a UUID or an sha1 sum of something random. Place it in the base directory and then have my monitoring daemon mount it according to this.

( I'm going to reread your post since I got a little windy and clarify if need be since I can't reread it while posting from my phone ) 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* (how to) automount USB ports
  2015-07-31 15:19 (how to) automount USB ports Userx Xbw
  2015-08-01  4:54 ` JD Robinson
@ 2015-08-01  5:18 ` JD Robinson
  2015-08-01 12:47 ` Userx Xbw
  2 siblings, 0 replies; 4+ messages in thread
From: JD Robinson @ 2015-08-01  5:18 UTC (permalink / raw)
  To: voidlinux

[-- Attachment #1: Type: text/plain, Size: 1234 bytes --]

In short, DEs like xfce use the UUID to automatically mount the volume at session startup. The settings are different for each de. The "disks" GUI also has a setting for this, but I haven't seen it since I was playing with mint.

I'm not sure how void would be doing anything differently. I wouldn't rely on the generic device names sda sdb, etc, they change according to how the kernel sees them once they're on the bus and enumerated.

I'm sticking with the UUID theory. As for the corner case I mentioned with the flash drives, it was a bit off topic. And I know not to rely on anything being the same that's hot plugged unless it can be positively identified with a UUID or in the case of DEs, UUID or some fingerprinting scheme.

The configuration settings might be found with udev outside of DEs, but I think you'll find them to be generic in an out of the box installation.

Some DEs look for the device at session start or on insertion by monitoring events coming from dbus or udev. It's not really a specific procedure I trust when dealing with identical models though and the phenomenon might not stand up unless there's some other info being taken into consideration like serial numbers ( something unique to each device ).

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: (how to) automount USB ports
  2015-07-31 15:19 (how to) automount USB ports Userx Xbw
  2015-08-01  4:54 ` JD Robinson
  2015-08-01  5:18 ` JD Robinson
@ 2015-08-01 12:47 ` Userx Xbw
  2 siblings, 0 replies; 4+ messages in thread
From: Userx Xbw @ 2015-08-01 12:47 UTC (permalink / raw)
  To: voidlinux


[-- Attachment #1.1: Type: text/plain, Size: 7091 bytes --]

It'd have to be generic in order to get past an UID because the creator of 
the product can in no way know each make or model of what is going to be 
plugged into the usb and used. it can only go by what types of devices use 
a USB port, then start their having to come up with a solution to be able 
to recognize just what it is that was just plugged into the USB Port. an 
external HDD, usb mouse, external Keyboard, usb stick. the list goes no 
hence the term 

*Universal Serial Bus. * take MATE, E, XFCE4 and other DE , not WM and they 
all seem to have this worked out, but the how they do it is hard to find, 
someone has to know and does not want to share this knowledge. Instead they 
tell us how to manually mount it using autofs and other means, or hard code 
it for just one specific USB Stick as if that is the only one I will ever 
use my entire life. 

while if using a DE in how ever they set it up will just work no matter 
what you plug into it. I have FATDOG on a USB stick, it will know the 
/dev/sdc , sdd, sde and if I have a usb stick split into more then one 
partitions. it shows sdc1 sdc2 or sdd1 sdd2 etc. like it does a blkid on it 
to know what it is looking at then goes from their.

but where is the how to's on getting this done? if someone that just takes 
off and starts up their own distro like MATE or anyone else. How did they 
get this information to do this?

When I can google my fingers off and not find out the how to do it like 
they did, but for some reason they know this secret. In Slackware I 
installed openbox, did not do anything special with mounting drives, and my 
PCMANFM just sees what ever it is I plug into the USB Port, it just works. 
if their is a label attached to the device then it will show that name if 
no label is attached it will give it a generic number / name. nevertheless 
it knows what it is and how much space is on it, etc. 

this tells me that their is a procedure that can be tied into that is or 
has to be a system wide but not really because depending on the model of 
the Linux being used, ie. VOid, Exbuntu, or what ever name someone comes up 
with to call their version of Linux.

this is a split thought because the auto mounting is now like it is split, 
if my pcmanfm works for automounting in one de / wm but not another one on 
the same linux system it cannot be a system wide set up, so now I got to 
look at who is auto mounting and where are all of their files it uses to 
get this done to try and copy what they did so that another wm / de will do 
the same thing just like they are doing it not having to type in a UUID 
because even a UUID is unique and no longer can the system deal with that 
random USB Stick someone hands you to plug in then just auto mount it. like 
Windows and some of the Linux DE's. 

How they are doing it is what I am looking for. 



On Friday, July 31, 2015 at 10:19:26 AM UTC-5, Userx Xbw wrote:
>
> O' Tay, I have a few different WM/DE installed here on VOidLiNux -- now 
> this automounting of the USB Ports, is getting me  very curious as to how 
> does lxde and Enlightenment automount when i3 and dwm does not, mostly 
> thinking in the manner of pcmanfm or simulaire FileManager when open up one 
> needs to see the USB mounted devices, what ever they are and reguardless if 
> it is on, /dev/sdc . /dev/sdd , /dev/sde  etc... I was reading how to's on 
> this matter using autofs - then in my working this almost solution, when I 
> went to istall autofs and seen that is was going to install it. I stopped 
> -- said to myself, if it is not installed, then what is this system using 
> to do the same thing I want it to do already? 
>
> Just not in i3 or dwm when I am using pcmanfm, but in my de lxde and E 
> they work with their respective filemanangers, and on the deaktops, minus 
> the desktop, in i3 and dwm, because they are titling wm. nevertheless the 
> filemanagers within these two wm and others should still have this same 
> capability to automount USB Ports. 
>
> with autofs this help me how to post is telling me I have to get the make 
> of what ever it is that is pluged into it not just the fact that something 
> just got pluged into it so figure it out then deal with it accordingly. as 
> this is what my DE are doing.
>
> example right now I have a little Andriod Phone pluged in so I can copy 
> some movies over onto it to watch , and a 1TB hard drive using an IDE to 
> USB adaptor.
> /run/media/userx/4489-120D  <--- that being my android Ph /dev/sdc
> /run/media/userx/winlinux  <--- that being my external HDD /dev/sdd
>
> these are generic mount points that to me have to be getting generated 
> automaticlly and not like it is said to do using autofs where I have to 
> explicedly tell it the make of what ever it is I am pluging into the USB 
> port limiting the ability to just plug in what ever make of USB stick or 
> hdd / exteranl HDD to use in USB. (I maybe off on this thought a little) 
> but nevertheless, this instruction is telling me I have to write a file 
>
> in the example they show this, 
>
> $ udevinfo -a -p /sys/block/sdc/ | grep model
>     ATTRS{model}=="Ext HDD 1021    "
>
>
> Now, that we have model attribute, we can add it to 
> /etc/udev/rules.d/custom.rules by following line:
>
> SUBSYSTEM=="scsi", ATTRS{model}=="Ext HDD 1021    ", SYMLINK+="Iomega%n"
>
> I understand in /etc/udev/rules.d/ the only file I have in their so far is 
> this one, 10-network.rules
>
> SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:21:6a:be:c7:08", 
> NAME="wlan0"
>
> where the ATTR is hard coded because the MAC address never changes, and 
> the ATTRS for a USB will, 
>
> this is my andriod ph /run/media/userx/4489-120D 
>  userx@void :^rules.d^ @~&udevadm info -a -p /sys/block/sdc | grep model
>     ATTRS{model}=="File-CD Gadget  "
>
> this is my external HDD /run/media/userx/winlinux 
>  userx@void :^rules.d^ @~&udevadm info -a -p /sys/block/sdd | grep model
>     ATTRS{model}=="                "
>
> as you can see between /dev/sdc and /dev/sdd the ATTRS will change 
> depending on what it is one plugs into it. as well as where are the files 
> VOidLiNux uses to get their auto mounts working, as I can planly see they 
> are not using the /etc/udev/rules.d/ with USB Ports. VOidLiNux is showing 
> 4489-120D and the lable on the HDD winlinux as mount points, the example 
> for autofs says I got a use the output of udev model one shows something 
> and the other is left blank on my laptop, two different things, meaning I'd 
> ahve to type in every kind of mode that can be plugged into a USB to get it 
> to automount? when I can see VOidLiNux and others have a better way to do 
> it. 
>
> so the question would be. How do I plug i3 and dwm and anything else 
> (wm/de) I need to in order to use this methoid of behavor that VOidLiNux is 
> having with the DE and E? Especially when using any number of FileManagers. 
> what little "secret" program and or meth are they using to get this auto 
> USB Port mount to work that I can tie into when using pcmanfm in i3 and dwm 
> (so far)?
>
>
>

[-- Attachment #1.2: Type: text/html, Size: 7446 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-08-01 12:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-31 15:19 (how to) automount USB ports Userx Xbw
2015-08-01  4:54 ` JD Robinson
2015-08-01  5:18 ` JD Robinson
2015-08-01 12:47 ` Userx Xbw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).