[android-kernel] How do you un-mount a busy partition?

98 views
Skip to first unread message

archieval

unread,
Sep 22, 2010, 10:06:01 PM9/22/10
to Android Linux Kernel Development
Hello everyone,

Unmounting a busy partition has been quite a problem for me, my
busybox package v1.16.0 have no lsof, and fuser does not really help
in determining if a file in the mount point is being used, or opened.
Does anyone have a workaround for this? I tried to insert an lsof
binary to the system but everytime I execute it, it returns error that
it is not found. Is there a proc file or something like that wherein I
can find whether the mount point is opened and what process is using
it?

Regards,
archieval

archieval

unread,
Sep 23, 2010, 4:21:40 AM9/23/10
to Android Linux Kernel Development
I have got a solution now that so far has no apparent bad effects. I
used "umount -l" to unmount a busy usb mass storage device mounted on
a certain folder. I unmount it while playing a video directly from the
usb device, and no fatal effect has been observed. I hope this can
also help anyone. =)

Chris Stratton

unread,
Sep 24, 2010, 1:00:19 AM9/24/10
to Android Linux Kernel Development
/proc/[procid]/fd/ will be full of symlinks to the target files or
devices, you could search that

Or you could try to figure out where android implements the "kill
anything with an open handle on the sdcard when it gets unmounted" for
an example, though it may be done in kernel rather than user code.

Dianne Hackborn

unread,
Sep 24, 2010, 4:29:14 AM9/24/10
to android...@googlegroups.com
I believe vold does it:




--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

Joshua Hruday

unread,
Sep 24, 2010, 9:50:27 PM9/24/10
to Android Linux Kernel Development
hi,
void Process::killProcessesWithOpenFiles(const char *path, int action)
in [platform/system/vold.git] / Process.cpp does the job of killing
all the processes using a mounted partition it does the scanning of
all the relevant fds using a particular mount point using /proc/pid/
*.

Thanks and Regards,
Hruday

archieval

unread,
Sep 27, 2010, 1:58:08 AM9/27/10
to Android Linux Kernel Development
Thanks for these information, but are you guys referring to latest
Android OS 2.2 source codes? I do not have a copy of that yet, I am
working on 2.1 source codes instead.
Reply all
Reply to author
Forward
0 new messages