Author Topic: How To Control Mount? (sd/cf/wifi)  (Read 5200 times)

AmigaFalcon

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • http://
How To Control Mount? (sd/cf/wifi)
« on: February 24, 2008, 04:11:55 pm »
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!
- Zaurus C3200
- Sandisk ULTRA II 8GB CF internal "harddrive"
- AmbiCom Wifi card
- Sony PSP power adapter ;)
- PdaXii13(v1) FULL install with Harddrive pivot

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
How To Control Mount? (sd/cf/wifi)
« Reply #1 on: February 24, 2008, 05:33:33 pm »
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: [Select]
#!/bin/sh
mount /dev/mmcblk0p1 /mnt/card

then chmod it to executable:

Code: [Select]
chmod a+x SCRIPTNAME
then stick it in your PATH:

Code: [Select]
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.
« Last Edit: February 24, 2008, 05:34:59 pm by Capn_Fish »
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

InSearchOf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1144
    • View Profile
    • http://
How To Control Mount? (sd/cf/wifi)
« Reply #2 on: February 24, 2008, 08:57:08 pm »
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
Sharp Zaurus SL-C3100 and SL-6000L
pdaXrom Developer
Please visit pdaXrom.org for updates
My Blog
IRC #pdaxrom @ FreeNode

AmigaFalcon

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • http://
How To Control Mount? (sd/cf/wifi)
« Reply #3 on: February 25, 2008, 12:51:24 pm »
Quote from: 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

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...

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!  
« Last Edit: February 25, 2008, 01:11:03 pm by AmigaFalcon »
- Zaurus C3200
- Sandisk ULTRA II 8GB CF internal "harddrive"
- AmbiCom Wifi card
- Sony PSP power adapter ;)
- PdaXii13(v1) FULL install with Harddrive pivot

speculatrix

  • Administrator
  • Hero Member
  • *****
  • Posts: 3707
    • View Profile
How To Control Mount? (sd/cf/wifi)
« Reply #4 on: February 25, 2008, 05:45:57 pm »
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.
« Last Edit: February 25, 2008, 05:46:12 pm by speculatrix »
Gemini 4G/Wi-Fi owner, formerly zaurus C3100 and 860 owner; also owner of an HTC Doubleshot, a Zaurus-like phone.

InSearchOf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1144
    • View Profile
    • http://
How To Control Mount? (sd/cf/wifi)
« Reply #5 on: February 25, 2008, 07:12:04 pm »
I'm just trying to remember back to the beta1/3 days... It will come to me soon :-)

Late
Sharp Zaurus SL-C3100 and SL-6000L
pdaXrom Developer
Please visit pdaXrom.org for updates
My Blog
IRC #pdaxrom @ FreeNode

sdjf

  • Sr. Member
  • ****
  • Posts: 447
    • View Profile
    • http://www.sdjf.wordpress.com and http://www.sdjf.esmartdesign.com
How To Control Mount? (sd/cf/wifi)
« Reply #6 on: February 26, 2008, 02:12:30 am »
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
http://www.sdjf.esmartdesign.com
http://www.sdjf.wordpress.com
-----------------
sl5500 running Sharp ROM 2.38 (dead batteries)
sl6000L running Sharp ROM 1.12 (still working)
Opera 7.25 and 7.30
Socket CF 56k modem
3Com USB Ethernet Adapter
Toshiba, Lexar and Kingston SD cards
Lexar, Kingston and Transcend CF cards

kkazakov13

  • Sr. Member
  • ****
  • Posts: 408
    • View Profile
How To Control Mount? (sd/cf/wifi)
« Reply #7 on: February 27, 2008, 01:03:43 am »
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.
SL-C3200 ** FOR SALE :( **
https://www.oesf.org/forum/index.php?showtopic=25969

Canon K30225 CF wireless card
Taxan iTax-LAN10 wired card
My packages for customized pdaXrom beta 3

sdjf

  • Sr. Member
  • ****
  • Posts: 447
    • View Profile
    • http://www.sdjf.wordpress.com and http://www.sdjf.esmartdesign.com
How To Control Mount? (sd/cf/wifi)
« Reply #8 on: March 02, 2008, 03:47:25 am »
Quote from: 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.

In case you don't know, "comment it" means put a pound sign (#) at the beginning of the line of code.
sdjf
http://www.sdjf.esmartdesign.com
http://www.sdjf.wordpress.com
-----------------
sl5500 running Sharp ROM 2.38 (dead batteries)
sl6000L running Sharp ROM 1.12 (still working)
Opera 7.25 and 7.30
Socket CF 56k modem
3Com USB Ethernet Adapter
Toshiba, Lexar and Kingston SD cards
Lexar, Kingston and Transcend CF cards