Embedded RISC » OnRISC

ID #1050

How to bound USB mass storage device to some specific mounting point?

To achieve this you'll need to add udev rule to /etc/udev/rules.d/custom.rules. For example bound USB stick with name "DataTraveler 2.0" to /dev/mobilex add following rule:

 

BUS=="scsi", SYSFS{model}=="DataTraveler 2.0", NAME{all_partitions}="mobile"

 

This will create a bunch of /dev/mobilex files instead of /dev/sdx files:

 

brw-rw---- 1 root floppy 8, 5 Jul 28 16:06 /dev/mobile

brw-rw---- 1 root floppy 8, 1 Jul 28 16:06 /dev/mobile1

brw-rw---- 1 root floppy 8, 10 Jul 28 15:44 /dev/mobile10

brw-rw---- 1 root floppy 8, 11 Jul 28 15:44 /dev/mobile11

brw-rw---- 1 root floppy 8, 12 Jul 28 15:44 /dev/mobile12

brw-rw---- 1 root floppy 8, 13 Jul 28 15:44 /dev/mobile13

brw-rw---- 1 root floppy 8, 14 Jul 28 15:44 /dev/mobile14

brw-rw---- 1 root floppy 8, 15 Jul 28 15:44 /dev/mobile15

brw-rw---- 1 root floppy 8, 2 Jul 28 16:06 /dev/mobile2

brw-rw---- 1 root floppy 8, 3 Jul 28 15:44 /dev/mobile3

brw-rw---- 1 root floppy 8, 4 Jul 28 15:44 /dev/mobile4

brw-rw---- 1 root floppy 8, 5 Jul 28 16:06 /dev/mobile5

brw-rw---- 1 root floppy 8, 6 Jul 28 15:44 /dev/mobile6

brw-rw---- 1 root floppy 8, 7 Jul 28 15:44 /dev/mobile7

brw-rw---- 1 root floppy 8, 8 Jul 28 15:44 /dev/mobile8

brw-rw---- 1 root floppy 8, 9 Jul 28 15:44 /dev/mobile9

 

Now you can mount the first partition to /mnt:

 

mount /dev/mobile1 /mnt

 

For further information please refer to http://en.wikipedia.org/wiki/Udev

Tags: -

Related entries:

Last update: 2010-12-20 12:19
Author: Support
Revision: 1.2

Digg it! Print this record Send to a friend Show this as PDF file
Please rate this entry:

Average rating: 0 out of 5 (0 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry