HOW-TO: Mount USB Thumbdrives in Solaris

HOW-TO: Mount USB Thumbdrives in Solaris

USB thumbdrives have become mainstream. And most of the portable tools and utilities are stored in them. This is true for both Windows and Unix/Linux. But I recently was asked a question on how to mount USB thumbdrives in Solaris. Indeed, how is a thumbdrive mounted in Solaris?

Aside from the knowledge of mounting the USB thumbdrive, a more important question arises — where is it mounted? These questions presume that Solaris supports thumbdrives and indeed it does, as we shall see in a bit.

Mount the USB thumbdrive. USB thumbdrives are emulated as SCSI hot-plug devices. They are under the control of the Solaris Volume Management daemon "vold". The same daemon is responsible for the floppy and CD/DVD optical devices.

Plug the drive to the USB port. Become super-user (root) or a privileged user (via sudo). The rest of the commands need elevated privileges. To check if the USB thumbdrive is detected, use cfgadm.

    root@host # cfgadm
    …
    …
    usb0/2.0 usb-storage connected configured ok
    …
    …

The output above confirms that the USB thumbdrive is properly detected by the system.

The directory /rmdisk does not exist on a Solaris system by default. So it needs to be created.

    root@host # mkdir /rmdisk

With the /rmdisk directory existing vold needs to be restarted, if it is started.

    root@host # pkill -HUP vold

.. or started, if disabled.

    » for Solaris 10

    root@host # /etc/init.d/volmgt start

    » for older Solaris versions

    root@host # /etc/init.d/vold start

 

Verify that the device is found by vold.

    root@host # volcheck -v
    media was found

The USB thumbdrive is now mounted in /rmdisk/rmdisk0.

Unmount the USB thumbdrive. Just like in Windows, the thumbdrive needs to be unplugged or unmounted properly.

To unmount the thumbdrive, run the command below:

    root@host # volrmmount -e rmdisk0

Verify that the device is no longer detected by the system.

    root@host # volcheck -v
    no media was found

There you go, the mounting and unmounting of a USB thumbdrive in Solaris. I hope this post answers the questions you may have about thumbdrives in Solaris.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *