Posts: 12 | Thanked: 6 times | Joined on Oct 2009
#1
I cannot unmount mmc2

Each time that I launch Garnet VM to access some calculators and stuff, the mmc2 card gets mounted. When I close Garnet VM, mmc2 stays mounted and cannot be accessed through USB, which is a problem.

I have tried unmounting, remounting rw and then unmounting, running fuser -k /media/mmc2 and unmounting... nothing helps. I thus need to restart my NIT after running PalmOS apps... So, maybe mmc2 is the working directory of something? What?
 
solarion's Avatar
Posts: 117 | Thanked: 32 times | Joined on Oct 2009 @ USA
#2
You can use lsof to find which applications have various files open.

If it's not already installed, you may need to install it (should be apt-get install lsof).

Then you enter in the following command:
lsof | grep mmc2
which uses lsof (list open files) to list all "files" (scare quotes because this includes file-like objects such as pipes and sockets) open on the device. The output of lsof is a bunch of lines like
rhythmbox 3837 <user> mem REG 8,5 65208 1196851 /usr/lib/libgnome-media-profiles.so.0.0.0
(here, from my desktop) The first item is the executable being run. The second is the process, the third is the user, file descriptor (here, it's not a file descriptor, but rather a memory region; the types of "file descriptors" are in the lsof manpage (http://www.netadmintools.com/html/lsof.man.html); a standard file descriptor is a positive integer), the file node type (here, a regular file), device number, file size/offset into the file, node number, and the filename. Because under UNIX, files and directories are very similar (though not identical), you can use "directory " for "file" in the above text.

The lsof output is sent into grep (which searches for patterns in the text input to it) which searches for the string "mmc2" which should be sufficient to uniquely identify those programs that either have a file on /media/mmc2 open or else have it as the current working directory (cwd).

Incidentally, the pipe character above (the "|" character) is critical to good unix command-line usage, although hard to find use on the nokia tablets thus far (tmk; I really only have an n810). You must either use the on-screen keyboard (Enable the "stylus input methods" if you've not already, close the hardware keyboard, and then tap into the xterm to bring out the on-screen keyboard. From there, tap on the symbols button ("&!é"), then the "Symbols" tab. The pipe is between the integral sign and Pi.) or else set it as a toolbar shortcut (Menu -> Settings ->Toolbar Shortcut->New; title="Pipe" Value="bar" (lower case)).

The (filtered) lsof output will tell you which processes (and process IDs) are keeping the device in use, and let you shut them down. If you're not certain which window to close (if any), you can use the kill command kill <pid>. If the program is wedged, you may need to kill it hard with kill -9 <pid>.

HTH.
__________________
--
Umm, what?
 

The Following User Says Thank You to solarion For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 12:21.