[SOLVED] usb thumb drive unmount and remount by itself
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
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.
Hi, I have thumb drive connected to a busybox box.I mounted it /opt in initialzation file. However after a while it will unmount itself because it changes its drive letter from sda1 to sdb1. How could a usb device change its drive letter by itself? How could I prevent it happening? Thx.
Something really don't seem right with how you are mounting your device. Can you show the output when you type the following?
Code:
mount
I am asking this because where you said "I mounted it /opt in initialzation file" means to me that you are mounting directly to /opt, which you shouldn't do. Have you tried manually mounting your device with no options, just using "mount," and to a different directory?
I think I should tell the story from the begging. -) I installed Tomato, which is based on busybox on my router. There is nothing under /opt folder. In order to install Asterisk on the router I have to attach a usb thumdrive to it because there is not enough space on it. That's the only reason I mount the thumdrive to /opt by myself. I know I shouldn't do it normally. Do you think this is the reason? I didn't hear anyone else complaining this problem though.
Ahhh, so that's why this doesn't all add up. This is your router... You need to explain these things next time...
Now honestly, I never worked with Tomato, but if you say that you shouldn't mount to /opt normally, and you are having a problem, then most likely that is possibly part of the problem. Have you tried mounting it where you are originally supposed to mount? And can you tell me where that is? Thanks man,
I have to mount it to /opt in order to install asterisk because there is no space left on the router. That's the instruction I got from online. But I will try mount it somewhere else just to check whether it works. Thanks for your advice.
It doesn't work even I mount it to another place. I even tried mount it using uuid. The problem is it keeps changing from sda1, to sdb1, then to sdc1. How come this could happen?
After going through all the output you gave me, and what I have thought, this seems to be a Tomato issue. Have you tried there forums? I'm not one to steer someone away from LQ, but I think you will have better luck on there forums. And in all honesty, I have never used Tomato before ever; I was always a DD-WRT guy Here is a link over there - http://www.linksysinfo.org/forums/fo...play.php?f=160
I found this thread on the tomato forums and adapted it to work for me.
In summary what I did was to include the following line in the 'Run after mounting' script:
Code:
echo 128 > /sys/block/sda/device/max_sectors
which simply sets the max_sectors file from the default value (240) to 128, for "sda" which is my USB hdd once it gets automounted.
Note that sometimes "sda" might be "sdb" or "sdc", so you might want to include several variations just to cover your bases...
Now my USB hdd has remained mounted for many days without any problems!
Hope that helps ya out
Cheers,
Mike
Last edited by schmichael; 07-13-2011 at 07:38 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.