OESF Portables Forum

Model Specific Forums => Sharp Zaurus => Zaurus - pdaXrom => Topic started by: AmigaFalcon on February 24, 2008, 04:11:55 pm

Title: How To Control Mount? (sd/cf/wifi)
Post by: AmigaFalcon 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!
Title: How To Control Mount? (sd/cf/wifi)
Post by: Capn_Fish 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.
Title: How To Control Mount? (sd/cf/wifi)
Post by: InSearchOf 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
Title: How To Control Mount? (sd/cf/wifi)
Post by: AmigaFalcon 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!  
Title: How To Control Mount? (sd/cf/wifi)
Post by: speculatrix 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.
Title: How To Control Mount? (sd/cf/wifi)
Post by: InSearchOf 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
Title: How To Control Mount? (sd/cf/wifi)
Post by: sdjf 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 (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
Title: How To Control Mount? (sd/cf/wifi)
Post by: kkazakov13 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.
Title: How To Control Mount? (sd/cf/wifi)
Post by: sdjf 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