Results 1 to 5 of 5

Thread: how to recreate device file like plug in usb flash drive

  1. #1
    Join Date
    Mar 2006
    Beans
    194

    how to recreate device file like plug in usb flash drive

    We all know when plug in USB flash drive into USB port, OS will create device file such as /dev/sdb and /dev/sdbx for each partition.

    I sync my system onto usb flash drive when it is plug in and it succeed.

    Now I hope to go one step further to use cron to automatically this process.

    My question is:

    How I can recreate device file for usb flash drive just like we plug it into usb port.

    I think perhaps there is a daemon to be run again but I don't know. Any suggestion are greatly appreciated.

  2. #2
    Join Date
    Aug 2007
    Location
    Arvada, CO
    Beans
    275
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: how to recreate device file like plug in usb flash drive

    Quote Originally Posted by say2sky View Post
    We all know when plug in USB flash drive into USB port, OS will create device file such as /dev/sdb and /dev/sdbx for each partition.

    I sync my system onto usb flash drive when it is plug in and it succeed.

    Now I hope to go one step further to use cron to automatically this process.

    My question is:

    How I can recreate device file for usb flash drive just like we plug it into usb port.

    I think perhaps there is a daemon to be run again but I don't know. Any suggestion are greatly appreciated.
    I'm not entirely sure I understand what you're wanting to do. There me be a language barrier issue here, but it sounds like you're wanting to create a mounted device instance without actually mounting a device. Is this correct?

  3. #3
    Join Date
    Apr 2008
    Location
    Belgium
    Beans
    299
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: how to recreate device file like plug in usb flash drive

    Dunno about your problem, but always syncing a flash drive isn't that great, cause unlike a hard drive, flash memory can't be written on forever.

  4. #4
    Join Date
    Mar 2006
    Beans
    194

    Re: how to recreate device file like plug in usb flash drive

    Quote Originally Posted by Carl Hamlin View Post
    I'm not entirely sure I understand what you're wanting to do. There me be a language barrier issue here, but it sounds like you're wanting to create a mounted device instance without actually mounting a device. Is this correct?
    I add this code to file /etc/udev/rules.d/60-persistent-storage.rules

    Code:
    KERNEL=="sdb1",  ATTRS{vendor}=="xxx", ATTRS{model}=="xxx", RUN+="xxx.sh", GOTO="persistent_storage_end"
    so each time I plug in my usb flash drive, xxx.sh script will run and do the sync I want.

    now my question is
    how I can do this through cron at any time I want not just the time I plug in usb flash drive.

  5. #5
    Join Date
    Mar 2006
    Beans
    194

    Re: how to recreate device file like plug in usb flash drive

    anyone know how to use command line to emulate the action of pluging usb drive to recreate device file?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •