You are not logged in.

#1 2012-10-20 19:38:14

sambul13
Member
Registered: 2012-08-18
Posts: 34

Rescan USB Bus for ejected Sticks ?

Is there a way to rescan USB Bus in ArcLinux?  For example, if I eject a USB Stick or Card by Eject command in XFCE, but won't detach it from the PC, how I can rescan it later to assign device name / number again, so that it can be auto re-mounted, hopefully by UDEV. Is fstab record required to re-mount in this case? I don't want to remove and reinsert the stick each time it was Ejected, as at times its not required for my tasks.

Last edited by sambul13 (2012-10-21 19:42:20)

Offline

#2 2012-10-20 19:40:51

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Rescan USB Bus for ejected Sticks ?

read `man udevadm`, specifically the "trigger" section.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2012-10-20 19:56:36

sambul13
Member
Registered: 2012-08-18
Posts: 34

Re: Rescan USB Bus for ejected Sticks ?

Can you suggest some udevadm command examples for a generic USB Stick rescan?

Offline

#4 2012-10-20 20:10:59

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Rescan USB Bus for ejected Sticks ?

Have you read the man page trilby recommended? What have you tried?

Please do not expect to be spoonfed here; it doesn't help you and it has a detrimental effect on the community.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2012-10-20 20:31:21

sambul13
Member
Registered: 2012-08-18
Posts: 34

Re: Rescan USB Bus for ejected Sticks ?

I don't expect to be spoon-fed. smile The Manual IMHO doesn't remotely resemble that term.

What subsystem a USB Stick belongs too?
What's its list of Attributes and Properties with allowed Values for each? How to find it out at that stage, when its visible as /dev/sdb only?

Anyone actually tried to rescan a USB Bus to remount an ejected USB Stick? What command did you use successfully? This is not an unusual exersize, but rather a typical one. For that reason, Windows Device Manager has command: Rescan Hardware, and its used often by millions. Why its missing in ArchLinux, and nowhere mentioned in any Wiki, including Udev & Systemd?

Last edited by sambul13 (2012-10-20 20:33:20)

Offline

#6 2012-10-20 20:44:42

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Rescan USB Bus for ejected Sticks ?

It is missing in Arch Linux because you havne't implemented it. 

All your other questions can be answered on the same man page you apparently only read a small part of.  So yes, it seems you do expect to be spoon fed.

Offline

#7 2012-10-20 20:54:05

sambul13
Member
Registered: 2012-08-18
Posts: 34

Re: Rescan USB Bus for ejected Sticks ?

WonderWoofy wrote:

You do expect to be spoon fed.

I didn't expect something like that on the forum aimed to share solutions, not try teaching moral without having a teacher diploma. smile Plenty of aggression with no useful feedback. Meanwhile, searching Google, there is absolutely NO success reported in rescanning USB bus in ArchLinux or other Linux incarnation. I tried udevadm settle & trigger, it just lists devices, nothing more.

One doesn't look smart by merely being rude to others. Show you can do MORE by offering a working tested by you solution, not empty words. Compare number of my posts to yours - and prove, not all your posts were empty garble like the above. Did you help others on this forum with something, they can actually use? Otherwise, what this forum is for - empty replicas with no payload? One won't succeed in that, only diminish of what "number of posts" here actually means.

Last edited by sambul13 (2012-10-21 11:11:43)

Offline

#8 2012-10-20 21:10:22

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Rescan USB Bus for ejected Sticks ?

sambul13 wrote:

One doesn't look smart by merely being rude to others.

You are absolutely right, so stop.

sambul13 wrote:

Show you can do MORE by offering a working tested by you solution

I have no desire to show you anything.  Do you really normally treat people this way?  We are not your employees - even if we were, you'd be a pretty nasty boss.

Perhaps my suggestion wasn't perfect.  I won't defend it.  But I no longer have any interest in following up and helping you come up with anything better.

Good luck on your own.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#9 2012-10-20 21:17:01

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Rescan USB Bus for ejected Sticks ?

@Trilby, word.

Offline

#10 2012-10-20 21:24:31

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Rescan USB Bus for ejected Sticks ?

sambul13 wrote:

What subsystem a USB Stick belongs too?
What's its list of Attributes and Properties with allowed Values for each? How
to find it out at that stage, when its visible as /dev/sdb only?

As the man page makes clear, these questions can be answered using udevadm info.

You accuse the people tying to help you of being rude, but you (a) do not extend
the courtesy of actually following the suggestions that have been provided, and
(b) couch your comments as explicit criticisms of the shortcomings of Linux
generally and the Arch wiki specifically.

If you want help from a community of volunteers, you might want to seek that
help a little more graciously.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#11 2012-10-20 21:36:34

sambul13
Member
Registered: 2012-08-18
Posts: 34

Re: Rescan USB Bus for ejected Sticks ?

WonderWoofy wrote:

@Trilby, word.

Thanks to all above. smile Going back to the subject of this thread, was anyone successful in rescanning a USB Bus in ArcLinux and remounting an ejected USB Stick? Suggested udevadm command doesn't seem to do that, but another approach may exist.

This thread is depersonalized now. Share your own success story in a way others can replicate, including Linux novices. Talk about your own solution, you will be the first on the web to report it. Of course, you read some Manual, but did you manage to remount USB Stick - how? Don't give anyone here a warm advice of any kind, just post the code you used to rescan USB bus and remount own USB Stick. We know, the folks giving irrelevant advice without testing it first, don't honor themselves and Linux community.

Don't shame yourself by claiming superiority you don't have - all community members are equal, despite having different knowledge and skills. Don't paint others as lazy and ungrateful, if your own contribution to this topic is zero. smile

Last edited by sambul13 (2012-10-21 13:54:12)

Offline

#12 2012-10-20 21:41:06

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Rescan USB Bus for ejected Sticks ?

Seriously?  You don't know when to quit, do you?  Please go read the man page, it is all there.

Offline

#13 2012-10-21 11:33:15

sambul13
Member
Registered: 2012-08-18
Posts: 34

Re: Rescan USB Bus for ejected Sticks ?

jasonwryan wrote:

do not expect to be spoonfed here; it doesn't help you and it has a detrimental effect on the community.

Attempting to teach morals and giving wrong advice while incapable to offer real solution is a lot more detrimental to the community.

jasonwryan wrote:

you (a) do not extend
the courtesy of actually following the suggestions that have been provided

As mentioned several times above, I tried udevadm command and it doesn't seem to do the task. Are you able to post the CODE (not moral) allowing to rescan USB Bus and remount USB Stick or Card? Lets forget about the Manual - its irrelevant as udevamd can't do the task discussed here, unless you show otherwise. Should I file a bug report? smile


jasonwryan wrote:

you (b) couch your comments as explicit criticisms of the shortcomings of Linux
generally and the Arch wiki specifically.

Does any ArchLinux Wiki address this typical task now? No, since there is no solution. Did you find required code in any other Linux package? No, unless you can give a reference. Once the solution is found, I'll try making it accessible to the community. It may require some rewrite of udevadm code or adding a new package, which I can't do being not a programmer, just like most other members of this community. smile

Last edited by sambul13 (2012-10-21 17:16:45)

Offline

#14 2012-10-27 04:02:37

Ken_g6
Member
Registered: 2012-10-27
Posts: 1

Re: Rescan USB Bus for ejected Sticks ?

Hello, I'm having a problem with removing USB devices on Linux Mint Debian Edition 12.  I found this thread while searching for solutions, and I just registered to comment that this is the worst treatment of a new Linux user I have ever seen.  Granted, I haven't looked much, but this must be one big reason why so many people use Windows and so few use Linux.

Now, I am a programmer, I have been using BSD and Linux for the past 15 years, and I did look at the udevadm man page.  The man page is dense, the info section does not explain how to use the path or name options to identify a device, and worst of all there is no "Examples" section.  I think udevadm may help with my problem, but it's going to take either a lot more help or a lot more research to solve it.

Now, for sambul13's problem, I may have some other ideas.  First, the Xfce eject command may simply have unmounted your device.  Which means you simply need to mount it again.  The easiest way to figure out how to mount it properly is probably to find its /etc/mtab entry while it's mounted, copy that to /etc/fstab, and then type "mount" followed by the path the device was mounted on.

If that doesn't work, I did come across these instructions, which didn't work for me (the first modprobe simply froze), but may work for you.

Offline

#15 2014-12-02 16:21:50

derekp7
Member
Registered: 2014-08-17
Posts: 3

Re: Rescan USB Bus for ejected Sticks ?

Let's say your USB disk shows up as /dev/sdc, with partitions such as /dev/sdc1.  After running "eject /dev/sdc", you won't see sdc in /proc/partitions -- but you do still see a /dev/sdc entry (but not /dev/sdc1 or any other partitions).

At this point, you can run "eject -t /dev/sdc", and your partitions come back, as if you removed and re-inserted your USB device.

If you don't know which "/dev/sdX" device to use, look for any /dev/sdX that isn't in /proc/partitions.

Offline

#16 2014-12-02 17:51:42

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Rescan USB Bus for ejected Sticks ?

Thanks for the input derekp7, but please keep an eye on thread dates - this thread is over two years old.  As the OP hasn't even been around in a year or so, we can close this thread.

Closed.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB