What's new

USB unmount error

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Martin Fishkov

Regular Contributor
Hi all,

After months of mucking around without a solution, I am asking here: My RT-AC68U is running nicely (380.65), however, the USB scan detects an issue with one partition. It says:

/dev/sda2 is in use.
e2fsck: Cannot continue, aborting.

I have a USB drive, with two partitions. One only for Entware, one for Data. This Data partition is sda2.
If I force an umount (sometimes works) I find no problems on the drive (using e2fsck). If I scan the drive on a linux box I also see no problems.

Can it be becauseI write logs (ab-solution 2.0, Tor and OpenVPN) to this drive? It is also the home for the Tor DB. But when I disable all these services the problem persists...

So, I have 2 questions:
  1. Is this a common (or fixable) problem?
  2. Should I replace the drive (and what is the easiest way to do that, keeping in mind that Entware, Tor, OpenVPN and ab solution depend on it)?
Thanks for your tips!!
 
Wow, did not know that tool. Awesomness!
Since I am remote now I can't try to quit my vpn- but that does seem to be the culprit:)
 
Another option is to run your fsck at boot before anything can get started on it. Rmerlin suggests this in https://github.com/RMerl/asuswrt-merlin/wiki/User-scripts under 'pre-mount', and I went ahead and wrote a detailed Wiki article on how to do it here:
https://github.com/RMerl/asuswrt-merlin/wiki/USB-Disk-Check-at-Boot

It alleviates the issue of trying to umount a volume for a diskcheck after everything is up and running, which as you've noticed, can be quite a pain. I have that solution a permanent part of my setup, and normally it breezes by each volume as they are rarely marked dirty.

Fair notice though, making it permanent in your start-up sequence may not work well, as certain add-on applications are not tolerant of an extended boot time. This is covered in the 'Gotchas' section of the Wiki article. But even if that's a problem, you can still use this solution to get "clean" again, and then just disable it until the next time you notice drive errors.
 
Last edited:
Much learned, I have.
At least my fears that the drive itself was damaged are now eased.
I'm very happy I can now identify open files (thanks, Colin!) and for future scans I'll rely on the scan on boot option. Maybe a weekly scan is a bit much :)

Last question, since you guys seem to know :) If I unmount / remount the drive, Entware no longer works. A reboot seems required. Am I missing something?
 
When you say 'Entware doesn't work' I'm going to assume you mean the services run under Entware are no longer running. If you're using the standard setup with Entware services started by the wait loop in 'services-start', you simply need to manually rerun that script. (/jffs/scripts/service-start). Or optionally, run the Entware start script it calls (/opt/etc/init.d/rc.unslung start).

The other aspect of Entware "working" is the linking of the Entware volume to '/tmp/opt' in '/jffs/scripts/post-mount', but that part should have completed successfully again automatically when you remounted the volume. You can tell if that worked properly by simply using the '/opt' path to access something in the Entware volume (e.g. 'ls /opt/etc/init.d').
 
is the linking of the Entware volume to '/tmp/opt' in '/jffs/scripts/post-mount', but that part should have completed successfully again automatically when you remounted the volume.
This is exactly what happened- not sure why, but now I know how to fix it if I run into it again.
Thanks for the help!
 
In the wiki article about checking the USB disk at boot:

if [ "$1" = "/tmp/mnt/sys" ] ; then
# set up and run Entware
ln -nsf $1/opt /tmp/opt

I believe the last line should read "ln -nsf $1/entware /tmp/opt". It solved my problems with entware not starting.
 
In the wiki article about checking the USB disk at boot:

I believe the last line should read "ln -nsf $1/entware /tmp/opt". It solved my problems with entware not starting.
Kalo,

Thanks for the feedback. The 'entware' in $1/entware is whatever you chose to name the "entware" directory in your setup. It can be any legal Linux directory name as that is the only direct reference to it. I chose to name it "opt" in my setup, so it would be same name whether I'm accessing it via Samba or through a command prompt. But that's just my personal preference, and I agree it's certainly not obvious. I edited the Wiki article to hopefully make it clearer now, changing the example name to 'entware' and saying substitute whatever name you're using.

Thanks again for the feedback; always room for improvement, and happy to do so.
 
Last edited:

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top