Easy mounting in linux

From wiki.gp2x.org

Assuming you have UDEV support compiled into your PC's kernel (and most modern kernels do !) The the first handy trick is to make an alias for the gp2x so no matter what order its plugged in then it will always have the same entry in /dev

look in /etc/udev/rules.d and see if you have a file called 10-local.rules (if you dont, just create it) add the following line to the file

 BUS="usb", SYSFS{serial}="3035204A756E", KERNEL="sd?1", NAME="%k", SYMLINK="gp2x"

you might need to check the devices SYSFS serial matches your machine (does my MKII have a different serial to a MKI ?)


make sure that the gp2x is the only mass storage device plugged in and initiate mass storage mode (USB in settings menu) and execute the following command

 udevinfo -a -p /block/sda


if you have a hub or anything else you'll have to wade through loads of verbage till you see somthing like this:

 looking at device '/devices/pci0000:00/0000:00:11.2/usb1/1-2/1-2.4':
   ID=="1-2.4"
   BUS=="usb"
   DRIVER=="usb"
   SYSFS{configuration}==""
   SYSFS{serial}=="3035204A756E"
   SYSFS{product}=="GP2X Storage Driver"
   SYSFS{manufacturer}=="Linux 2.4.25 with net2272"

An alternative setting is to add the following line to your udev rules file:

 KERNEL=="sd?1", ATTRS{idVendor}=="0525", ATTRS{idProduct}=="a4a5", MODE="0777", GROUP="plugdev", SYMLINK="gp2x"


Double check the serial for the line in 10-local.rules once you've edited the file update udev

 udevcontrol reload_rules


for extra ease add a line to /etc/fstab so normal users can mount the gp2x

 /dev/gp2x               /mnt/gp2x       vfat            auto,users      0 0


make a mount point

 sudo mkdir /mnt/gp2x

now (with a user account) to mount the device just do

 mount /mnt/gp2x

but don't forget always do

 umount /mnt/gp2x

before stopping usb mode on the gp2x!!!


hope you found this useful... (ChrisC)

See Also: FormatSD

Personal tools