How to Mount a USB Flash Drive

Vinay Krishna, June 2007

These steps for mounting a pen drive are applicable to the Solaris 8, and 9 OS. This tip should also work with Linux (kernel version 2.5 and above).

USB flash drives are named sda1, sda2, and so on, and they are mounted by default in /dev. If sda1 is not the name for your drive, use some type of hardware browser to find the name. Let's assume sda1 needs to be mounted.

To do this the quick way, type this in the terminal window:

mount -t auto /dev/sda1 /mnt

This command automatically determines the file system and mounts the device sda1 in the folder /mnt. Just point a file browser at that folder to see the contents of the USB drive.

You need to edit the /etc/fstab file to make future mountings quick and easy. Use an editor of your choice.

Add this line to the fstab file, and then save the file.

/dev/sda1 /mnt/flashdrive auto defaults,users,noauto 00

If you can't save the file due to lack of permissions, use the following command (all on one line) in the terminal window:

chmod u=rwx /etc/fstab
/dev/sda1 /mnt/flashdrive auto defaults,users,noauto 00

Where:

  • /dev/sda1 tells the computer what device to mount.
  • /mnt/flashdrive tells the computer where to mount the device. In this case, you would have to use the mkdir command to create the flashdrive folder.
  • auto tells the computer to automatically determine the file system.
  • defaults,users,noauto tells the computer to manage the USB drive in the usual fashion, make it available to all users of the computer, and not automatically mount the drive on startup (because it might not be plugged in).

Now, in the terminal window, use the following command:

mount -a

This command automatically mounts everything listed in the fstab file that isn't already mounted. If you want to unmount something, use the following command:

umount /dev/sda1

If a message says the device is busy, use the following command, which makes the device unmount as soon as it is not busy.

umount -l /dev/sda1

Unmounting a USB storage device is a necessity. If you do not unmount the device, changes (such as any new files you added to the device) are not saved.

You can put an icon for the flash drive on your desktop. Just right-click and select New->Device->USB storage. (You should probably be able to figure that one out.)

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 里歐 的頭像
    里歐

    里歐's 布拉格

    里歐 發表在 痞客邦 留言(0) 人氣()