Mounting a Flash Drive in Unix
Most modern Unix (and Linux) systems have the ability to automount a USB flash drive when it is inserted into the USB slot. However, if the automount utility does not work, you will have to mount (make available for use) the device manually. It is important to check that the device is recognized by the system before attempting to mount the drive. Once the device is mounted, you can access it as you would access any other external device.
Instructions
-
-
1
Insert the flash drive in to the USB slot on the computer.
-
2
Open a terminal window. This is where you will type the following commands.
-
-
3
Type the command "lsusb" to ensure that your flash drive has been recognized by the computer. The output of the command will show the name of the flash drive next to the "Bus" and "Device" information.
-
4
Type the command "fdisk -l" to discover the device name for the flash drive. The device name will something similiar to "/dev/sda2".
-
5
Type the command "mkdir /mnt/usbdrive" to create a mount point for your flash drive. This is where you will access the files after the device is mounted.
-
6
Type the command "id username" to locate your "uid: (user id) and "gid" (group id) for the next command. Replace "username" with your Unix username.
-
7
Type the command "# mount -t v auto -o rw, uid=500,gid=500,umask=077, /dev/sda2 /mnt/usbdrive" to mount the flash drive. Replace the values for "uid" and "gid" with the values found in Step 6. Replace "/dev/sda2" with the device name located in Step 4.
-
1
References
- Photo Credit flash drive image by AndreyPS from Fotolia.com