dirty but fully functional card reader mounting script

Joined
Aug 3, 2008
Messages
11
Reaction score
0
First of all sorry for my english, I'm spanish and i'll make many mistakes on my writing.

What I did is a very dirty and simple script to mount my SDcard reader (expansion or multi, but not both at the same time) after suspending my AAO or just not having the card inside when booting.

Please read each comment of the script to change values depending of your system or preferences.

Firs of all make sure you have gksu installed on your system:
Code:
sudo apt-get install gksu

then open a console and create the script with your favorite editor (nano in my case)
Code:
nano /home/username/mountcardreader

now we'll paste the following script changing the values as comments suggest

Code:
#!/bin/bash

setpci -d 197b:2381 AE=47

device=`ls /dev/mmcblk* | grep -E *p1`

##change the mountpoint to your favorite path for the SD mount
mpoint=/media/sdcard

mkdir $mpoint

##if your sd's card file system is NTFS write ntfs-3g instead of vfat, for fat32 or fat16 don't edit.
##change the X on uid option to your UID number (see /etc/passwd to check it)
mount -t vfat $device $mpoint -o uid=10XX

Now open a menu entry on your desktop menu and create a option called as you want, with the following code to be executed: (ask me if you don't know how to do that)
Code:
gksu sh /home/username/mountcardreader

Permission problems with UID parameter are solved, now just open the directory with your file browser and that's it!


P.S. Checked that after several mounts (about 10) cardreader stops to be mounted
 
you can pass options to mount, telling it to mount it as user X .
see man mount.
 

Latest threads

Back
Top