Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I hope this is the right place, I have a little board with atom processor and slax 2.6.24.3 with KDE 3.5.10 installed and booted from a compact flash card. In it I have a software that loop continuously checking for a pendrive to be attached to an USB port so then it can mount it copy a file and unmount it again so that user can detach the pendrive. It usually works fine but sometime it fails and return this error:
mount: /dev/sdc1 is not a block device
from that moment any pendrive I use and that is assigned to (in this example, but it can be other) /dev/sdc1 return same error, the only thing I can do is restarting the computer (and then it work again).
In this condition if I launch fdisk -l /dev/sdc1 is listed but I cannot mount it as usual (mount /dev/sdc1 /mnt/_dev_sdc1/), I also attached a double partition pendrive and it detect both the partitions but that assigned to sdc1 doesn't work meanwhile the other assigned to sdc2 can be mounted, so it can't be an hardware issue but some problem in usb software management.
I've tried to restart all USB devices by executing unbind/bind as for following example:
echo -n "0000:00:1d.7" | tee /sys/bus/pci/drivers/ehci-pci/unbind
echo -n "0000:00:1d.7" | tee /sys/bus/pci/drivers/ehci-pci/bind
but it didn't work.
My objective is to restore initial functionality without restarting computer, or in alternative, there is a way to avoid system assigning /dev/sdc1 to the next pendrive so that it can go on until user shut down the machine?
I can understand why restarting correct the problem, someone can give me advise in it or how linux start USB management?
sorry in advance for my possibly bad English
Last edited by fabio massacci; 11-12-2015 at 01:38 AM.
A few suggestions, based on educated (I hope) guesses.
When you plug any USB filesystem into your board, you should see something in the kernel mesage buffer (dmesg command) and/or the system log file (/var/log/syslog on Debian-based systems, don't know Slax). What messages do you get?
Also interesting, run udevadm monitor to see what kind of information udev gets from the kernel when you plug the drive in.
Then did you check /dev/sdc1? I mean, just run ls -l. Perhaps it has turned into a regular file and isn't overwritten when udev wants to create the device file.
thanks for reply berndbausch, today I can't try what you suggested because I haven't the board with me, I'll try as soon as I can tomorrow.
Anyway this is interesting:
Quote:
Then did you check /dev/sdc1? I mean, just run ls -l. Perhaps it has turned into a regular file and isn't overwritten when udev wants to create the device file
if this is the case how can I turn it back to device file?
P.S. I'm from Italy so my replies can come a bit late for you
Last edited by fabio massacci; 11-11-2015 at 02:01 AM.
if this is the case how can I turn it back to device file?
Remove the regular file. udev will create the device file next time the drive is plugged in.
The deeper question would be, where does the regular file come from.
Quote:
P.S. I'm from Italy so ma replies can came a bit late for you
thank you so much berndbausch, it was as you said: sdc1 was changed in a turned into a regular directory!!! it was enough to delete it to make it work again
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.