2009-07-22 02:25:03     USB Mount Issue

Document created by Aaronwu Employee on Aug 16, 2013
Version 1Show Document
  • View in full screen mode

2009-07-22 02:25:03     USB Mount Issue

rohi sivaswamy (INDIA)

Message: 77814   

 

Hi All,

 

is there a way to manually assign what each USB

 

Storage Device will be recognized as?

 

if i use different storage devices with sda,sda1,sdb.

 

how to know it and mount the same in specific location??

 

please provide your suggestions in this regard.

 

thanks in advance.

QuoteReplyEditDelete

 

 

2009-07-22 02:33:45     Re: USB Mount Issue

Mike Frysinger (UNITED STATES)

Message: 77815   

 

you can use hotplug to do whatever you want:

  docs.blackfin.uclinux.org/doku.php?id=linux-kernel:hotplug

QuoteReplyEditDelete

 

 

2009-07-22 04:20:34     Re: USB Mount Issue

rohi sivaswamy (INDIA)

Message: 77853   

 

Hi Mike,

 

echo $DEVPATH | grep sda

if [ $? -ne 0 ]

then

exit 0

fi

echo "Hotplug Script" > $output

echo $ACTION > $output

if [ "${ACTION}" = "add" ] ;then

echo "USB Inserted" > $output

mount -t vfat /dev/sda /mnt

 

this is the command im using.

 

if the USB storage decive recognizes sda then it is not a problem.

 

some of the Storage device recognizing both sda and sda1. And it has to be mounted in sda1.

 

in that case what i can do???

 

please see the following command.

 

can i mount /unmount all the device?

 

is this solution is advisable to use??

 

echo $DEVPATH | grep sda

if [ $? -ne 0 ]

then

exit 0

fi

echo "Hotplug Script" > $output

echo $ACTION > $output

if [ "${ACTION}" = "add" ] ;then

echo "USB Inserted" > $output

mount -t vfat /dev/sda /mnt

mount -t vfat /dev/sda1 /mnt

mount -t vfat /dev/sdb /mnt

mount -t vfat /dev/sdb1 /mnt

 

if not provide me a better solution.

QuoteReplyEditDelete

 

 

2009-07-22 04:35:38     Re: USB Mount Issue

Mike Frysinger (UNITED STATES)

Message: 77855   

 

you already given the device name in the hotplug script, so use that instead of hardcoding random paths in the script

QuoteReplyEditDelete

 

 

2009-07-22 04:51:54     Re: USB Mount Issue

rohi sivaswamy (INDIA)

Message: 77856   

 

Hi Mike,

 

ya.... but  if USD Storage device recognizes sda1.

 

then how can i mount the specified location.

 

Becoz im using "mount -t vfat /dev/sda /mnt" alone.

 

 

 

 

 

QuoteReplyEditDelete

 

 

2009-07-22 05:02:42     Re: USB Mount Issue

Mike Frysinger (UNITED STATES)

Message: 77857   

 

i already told you -- you're given the device name via a variable.  use that instead of hardcoding paths.

QuoteReplyEditDelete

 

 

2009-07-22 07:52:46     Re: USB Mount Issue

rohi sivaswamy (INDIA)

Message: 77864   

 

Hi Mike,

 

instead of using "/dev/sda",

 

we can use $DEVPATH directly.

 

i.e

 

mount -t vfat  $DEVPATH  /mnt

 

is this correct?

 

if not please tell me clearly.

QuoteReplyEditDelete

 

 

2009-07-22 12:45:53     Re: USB Mount Issue

Mike Frysinger (UNITED STATES)

Message: 77883   

 

considering it's such a simple test, why dont you try it

Attachments

    Outcomes