Help - Search - Members - Calendar
Full Version: How To Control Mount? (sd/cf/wifi)
OESF Forums > Distros, Development, and Model Specific Forums > Distro Support and Discussion > pdaXrom
AmigaFalcon
Hi, I'm trying to prevent SD/CF from automatically mounting when I plug them in. I have had a look in fstab but from my limited knowledge it is not obvious exactly how to prevent devices/filesytems from automatically mounting themselves. I assumed the fstab "noauto" mount option would do the trick, but it doesn't appear to prevent auto detect/mount. Perhaps there is some other process included with the pdaXrom distro (seperate from fstab system) which is monitoring interface ports and mounting??? I'm not sure...

for example, I would like to be able to plug my wifi adapter or SD card in but NOT have it automatically mount, so that I can CHOOSE exactly when I need it mounted and so save a little battery power for the moments when they are actually used. At the moment, whenever I plug my wifi card, I have to unmount it with OpenBox's SD/CF/USB monitor plugin (pdaxrom taskbar). I sometimes forget it has been automatically mounted by which time a large portion of my battery has been used unnecessarily!!

I'm a linux noob, but I'm sure if someone points me in the right direction I can figure the rest out. I'm just not sure where to begin.

thank you!
Capn_Fish
I think the card monitor itself may be mounting the cards. You could try simply removing them from /etc/fstab (which would hopefully stop the automounting), then making a script to mount it:

CODE
#!/bin/sh
mount /dev/mmcblk0p1 /mnt/card


then chmod it to executable:

CODE
chmod a+x SCRIPTNAME


then stick it in your PATH:

CODE
cp SCRIPTNAME /usr/local/bin/


It's most likely not the best way to do it, but it should work.

EDIT: /dev/mmcblk0p1 may not be the SD card with the 2.4.x kernel. It'll be something like /dev/disc/disc0/part1.

What version of pdaX are you running? You may want to put it in your sig.
InSearchOf
In 2.6.x it is udev that is causing the devices to mount.

check out /etc/udev/rules.d/udev.rules

In there is this a long list of devices that when detected it runs a script.

Hint: Lines 243-244 for block devices (SD/CF)

Late
AmigaFalcon
QUOTE(InSearchOf @ Feb 25 2008, 01:57 AM) *
In 2.6.x it is udev that is causing the devices to mount.

check out /etc/udev/rules.d/udev.rules

In there is this a long list of devices that when detected it runs a script.

Hint: Lines 243-244 for block devices (SD/CF)

Late


Hi guys, thanks for the tips. I believe pdaxii13 uses the 2.4.x kernel, and I can't find an /etc/udev/ dir, so i guess it's not that.

Capn_Fish: I tried commenting out ("#") the fstab entries for CF/SD mounting and then rebooting. It didn't seem to stop the cards from being mounted. So I'm guessing it is definitely something "external" to fstab which is controlling the mounts. Another process/daemon. What exactly? I'm not sure... smile.gif

I will keep searching for a soulution, but if anyone has any other ideas then pls post. thank you!

"linux is the most powerful and flexible OS"...*IF* you can figure out WHERE you need to look to make the changes you want! wink.gif
speculatrix
on 2.4 based machines, isn't there stuff in /etc/pcmcia for automounting memory cards on insert?

sharp/cacko also used something, er, some sort of sd card manager which had its own config files, erm, sdmgr?

sorry to be vague.
InSearchOf
I'm just trying to remember back to the beta1/3 days... It will come to me soon :-)

Late
sdjf
As a temporary fix, although not so easy, you could write a bash script to detect if it's been mounted, and maybe have it trigger an opie-sh pop-up asking you if you want to unmount it or leave it in. Complicated, but I think it can be done.

Has opie-sh been ported for pdaX roms? It's pretty cool to use. My page about it from experience with Sharp ROM:

http://sdjf.esmartdesign.com/ipks/opiesh.html

Monitoring scripts can be tricky...I have one I'm still debugging that tests for the presence of an /var/spool/at job of a specific type, and gives me a popup if there isn't one. You could query every 10 minutes to see if SD is plugged in, give you a popup if it is, and then have it 'umount' the card if you give a certain answer. Maybe set a flag so it won't ask again during current session. Maybe too much work, but it's another possible workaround if the ideal solution doesn't appear.

sdjf
kkazakov13
This works on plain beta 3 - should work on pdaxii13:

edit /etc/sdcard/sd_mem_ctrl

find the line

mount $FSTYPE /dev/$DEVICE $MOUNT_POINT

and simply comment it.

It was tested here without problems. I don't know after reboot, but the mount command is gone ... so it should be ok ... I tested it only with inserting the sd card, not rebooting.
sdjf
QUOTE(kkazakov13 @ Feb 26 2008, 10:03 PM) *
This works on plain beta 3 - should work on pdaxii13:

edit /etc/sdcard/sd_mem_ctrl

find the line

mount $FSTYPE /dev/$DEVICE $MOUNT_POINT

and simply comment it.


In case you don't know, "comment it" means put a pound sign (#) at the beginning of the line of code.
sdjf
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.