Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

listing USB devices

  • 22-09-2004 2:41pm
    #1
    Registered Users, Registered Users 2 Posts: 2,934 ✭✭✭


    Hi
    I am trying to write a script to locate mount points for usb devices.
    I'm using solaris.
    When i plug them in - stop & start vold they show up in /dev/rdsk
    I know it's them simply because of the time stamp.
    i'm looking for a way to get their identity like c3t0d0s2


Comments

  • Registered Users, Registered Users 2 Posts: 1,186 ✭✭✭davej


    Is 'eject -n' what you are looking for?

    davej


  • Registered Users, Registered Users 2 Posts: 2,934 ✭✭✭egan007


    nope fraid not


  • Registered Users, Registered Users 2 Posts: 1,186 ✭✭✭davej




  • Registered Users, Registered Users 2 Posts: 2,934 ✭✭✭egan007


    funny enough i was tryint his approach - but it was unsuccessfull -
    the path i'm on a the mo is

    cfgadm -v
    lists all usb devices - i'm hoping to extract something unique from there to match in an ls -all of /dev/rdsk


  • Registered Users, Registered Users 2 Posts: 2,934 ✭✭✭egan007


    for anyone that ever needs it here is the solution.....

    $identifier = ls -all /dev/usb | grep mass-storage |awk -F'/' '{print $4 "/" $5 "/" $6}' | awk -F':' '{print $1}'

    so ....
    $identifier = pci@0,0/pci147b,1407@10,4/storage@7

    ls -all /dev/rdsk/ | grep $identifier | grep s2 |awk -F'-' '{print $1}' | awk -F' ' '{print $NF}'

    returns c3t0d0s2


  • Advertisement
Advertisement