This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to mount USB storage auto on beagleboard-xm

Hello everyone,

I can mount the usb storage manual with the command mount -vfat /dev/block/sda1 /usb.

But we need to let the android auto mount the usb storage when the USB storage plug in.

I find vold could do that, but I can't find out which sysfs path should I add into the vold.conf.

Could anyone tell me how I can do?

 

Thanks,

Yanbin Yue

  • Hi Yabin,

     

    dev_mount sdcard <mount location> <partition number> <mmc entry><br>
    
    e.g. For data created at partition#3, one need to put following entry in /etc/vold.fstab<br>
    dev_mount sdcard /mnt/sdcard 3 /devices/platform/mmci-omap-hs.0/mmc_host/mmc0

  • Hi Satish Patel

    That command is mount mmc SD card. So throught the command has existed in the vold.conf, when I plug in my USB storage, I can't find the usb storage data in /mnt/sdcard .

    I think the sysfs path /devices/platform/mmci-omap-hs.0/mmc_host/mmc0 is not my usb storage sysfs path. So I need find the right usb storage sysfs path.

     

    Thanks,

    Yanbin Yue


  • Do remember that if you modify vold.fstab to point to USB storage, you will not be able to use the SD card for data storage except by manually mounting it, just like you may be doing currently for USB storage.

  • Hi Vishveshwar Bhat,

    I think it's OK, we have only USB solt,  so we don't use SD Card.

    Will the SD cdard which contained rootfs be recognized as vold SD card too?

     

    Now what we want to do is that we can use the USB solt which supported by beagleboard-xm  to use USB storage.

     

    Thanks.

    Yanbin Yue

  • yanbin yue said:

    Hi Vishveshwar Bhat,

    I think it's OK, we have only USB solt,  so we don't use SD Card.

    Will the SD cdard which contained rootfs be recognized as vold SD card too?

     

    Now what we want to do is that we can use the USB solt which supported by beagleboard-xm  to use USB storage.

     

    Thanks.

    Yanbin Yue

    vold.fstab supports only one entry, so you can use either SD card or USB but not both.

    As you want to use USB for data storage, you will need to modify vold.fstab to give the correct sysfs path for USB storage device. Unfortunately, I dont have a setup handy so I am not in a position to tell you what entry to make to point vold to USB.

    You can continue using SD card for the main android rootfs, it will not be detected by vold if you have modified it to use USB.

  • Hi Vishveshwar Bhat,

     

    It's enough for me to only use USB storage. Could you help me to find what the correct sysfs path for USB?

    I think there must be someone know how  to setup it in TI.

    Thans a lot.

     

    Yanbin Yue

     

  • Hi Yanbin,

    This is the sysfs entry you can add for usb deveice inserted at EHCI port

    /devices/platform/ehci-omap.0/usb1/1-2/1-2:1.0/host0

    But there is another generic entry present in /sys/block as well.

    Not remembering exactly.

    Regards,

    Arun

  • Hi Arun,

    The file list in the /devices/platform/ehci-omap.0/usb1/1-2/1-2:1.0/ of my system as following:

    --------------------------

    # cd /sys/devices/platform/ehci-omap.0/usb1/1-2/1-2:1.0/
    # ls
    uevent
    bInterfaceNumber
    bAlternateSetting
    bNumEndpoints
    bInterfaceClass
    bInterfaceSubClass
    bInterfaceProtocol
    modalias
    supports_autosuspend
    subsystem
    power
    driver
    ep_81

    ------------------------

    I can't find the file host0. Need I to do additional works for let the host0  present? When I plug in the USB, the file list will not change.

     

    Thanks,

    Yanbin Yue

     

  • Hi Yanbin,

    Can you try inserting to different EHCI ports of the board?

    Can you check whether any entry is created inside /sys/block ?

    Regards,

    Arun

  • Hi Arun,

    I tested the four EHCI port, the host0 file/path doen't reprent.

    I could see a node sda present in /sys/block.

    So that means I shoud use /sys/block/sda as the sysfs path? If this is right, there is another problem, the node sda may be sdb, sdc....or  should the sysfs path be /sys/block ?

     

    Thanks,

    Yanbin Yue

     

  • hi yanbin,

     

    Can you please try following steps.

     

    1. create a entry in vold.fstab like:-

    dev_mount usbdisk  /mnt/usb_host  auto  /devices/platform/ehci-omap

     

    2. create a separate  mount point for usb mass storage, edit root/init.omap.rc  script. Like

        # create sdcard mountpoint
        mkdir /mnt/sdcard 0000 system system
        symlink /mnt/sdcard /sdcard

      # create USB mountpoint
        mkdir /mnt/usb_host 0777 system system

    In that case USB mount will not hamper SDCARD mounting. At a time you can mount both devices, but for USB mount you will not get any notification. 

     

    Regards,

    Pankaj Pandey

     

  • Hi Pankaj

    It's very pleasure that you give me the right USB syspath. And we can mount both devices. But there is another problem. When we removed the USB we got  some words which likes "SD Card unmounted or not present" prompted on the SDCARD folder. We ues ES file Explorer to view files in the system.

    Could you help me how can I remove the prompt words?

    Thanks,

    Yanbin Yue

  • Hi Yanbin,

     

    Good to hear  that you can able to mount both USB  and SD card. I am not very sure why  "SD Card unmounted or not present"  is coming after removing the USB stick.

    Can you please try to un mount the USB stick  using command line "unmount /mnt/usb-host" and than check the SD card.

     

    Regards,

    Pankaj Pandey

  • Hi Pankaj,

        If i want to use two USB sticks (pendrives) or may increase no.of USB sticks dynamically ,Then how can we give  Lable name in dev_mont command in vold.fstab for all USB sticks dynamically.

     Can we auto mount 2 or more USB sticks (Pendrives) in android Jellybean using vold.fstab?