e-mail   
 Menu
  Home
  Download
  Top 10 Downloads
  Last 15 New Files
  Web Links
  Tips
  Last 15 New Tips
  NLM Programming
  Admins Club





SUPLA System
Internet of Things




Installation and Administration






Polish Forum SUSE


 
Who's Online

 There are currently,
35 guest(s)
that is (are) online.
 


Technical Information

Back to List of Categories

Technical Information about
  A Little YaST Magic
  A Slideshow for Your KDE Wallpaper
  Add Novell Support to Your Firefox Search Engine
  Adding To The Panels In Gnome.
  Akregator - RSS News Reader
  An Introduction to WBEM and OpenWBEM in SUSE LINUX
  Authenticating SUSE LINUX to eDirectory via LDAP
  Basic Mounting Differences between Windows and Linux
  Beginner's Guide to Using Novell SUSE LINUX's Build Utility
  Browsing Files
  Card Readers on SUSE LINUX 9.2 Professional?
  Changing the Default Browser in Gnome
  Developing Perl CGI scripts on SUSE LINUX
  Do I Have Permission?
  Double SYNC -- Using RSYNC Simultaneously With and Without Branch Office for Data Backup
  Dumb Question: Mounting Linux CDs
  Easy Command-Line Introduction
  Easy Way to Debug SSL Connections
  Enabling an Interactive Startup in Novell/SUSE LINUX
  Exploring MySQL 4.1 and PHP 5 on SUSE LINUX
  Extend Your Panels Using Gnome Drawers.
  Firefox Speed Tip
  Fix Java Errors With ConsoleOne On Linux
  Fix Your Mouse Wheel...
  Gimp -- Closing In on Photoshop...
  Gimp Tips Part 1: Resizing Images
  Gimp Tips Part 2: Rounding Corners
  Gimp Tips Part 3: Fading Photography Edges
  Gimp Tips Part 4: Selective Colorization
  Gimp Tips Part 5: Plugins a Plenty - Adding Light
  Gimp Tips Part 6: Using The Clone Tool
  Google Auto-fill Replica for Linux
  How a Corrupted USB Drive Was Saved by GNU/Linux
  How to Implement Login Scripts into a Pure Linux Environment
  How to install and connect an External Modem on a Linux PC
  How to Install the Novell Client for Linux on SUSE Linux 10.0
  How to launch applications at login in Gnome
  How to Remote Control Linux
  How to setup a Linux application to automatically startup when you login.
  How to share Files and Printers Between Linux and MS Windows with Samba
  How to uninstall the Novell Client for Linux
  How to upgrade the Novell Client for Linux
  How to use SMB without turning off the firewall
  How's the Weather?
  HTML Development Tools in Linux
  Informative Bash Prompt
  Install and Use QEMU on SUSE 9.2
  Install Linux Frequently, Without the Hassle
  Installing Apache, PHP, and MySQL on SUSE LINUX Professional
  Installing RPM Files
  Integrating Novell Linux Desktop into a Novell NetWare network
  Introduction to Oracle 10g R1 (10.1.0.3) on SUSE LINUX Professional 9.3
  iPrint Printers on Novell Linux Desktop
  Linux Scheduling Priorities Explained
  Make a Misbehaving Program Quit
  Manually Mounting a USB Flash Drive in Linux
  Migrating To Linux, Advantages Over Windows 9.x And XP
  Minimize Your Maximizing with Multiple Desktops
  Mounting NetWare Volumes On NLD Illustrated
  Move Your /home to Another Computer
  Mozilla Mail Review
  Need a Backup?
  Novell Client Settings with Windows Terminal Server
  Novell Linux Desktop Equivalents of Windows Software - New and Improved
  Novell Linux Desktop System Upgrade How-To
  Partitioning Hard Drive for Linux Install
  Perform Remote SuSE Installations With Virtual Network Computing
  Quick Intro to Klipper
  Quick Shortcuts in The Gimp
  Reset Your Lost Root Password
  Resizing Your Gnome / KDE Panels
  Runlevels in SUSE LINUX
  Running Existing Win32 Applications on SUSE LINUX
  Service Command in /etc/init.d/
  Setting Shortcut Keys
  Setting up a Linux NFS Install Source for Your LAN
  Should I choose Novell Linux Desktop or SUSE LINUX Professional as my desktop?
  Starting Services From the Command Line On SuSE LINUX
  Sticky Notes for Gnome
  SUSE LINUX 9.3 Professional Review
  Sync Up The Taskbar and the Desktop in Gnome
  System Upgrade How-To
  Taking Screenshots in Linux
  The Basics of Messaging in the Cross-Platform GroupWise Client
  The Novell Client for Linux (beta).
  Transparent Panels in Gnome
  Trick Out Your KDE Desktop
  Understanding the YAST Software Module Options
  Updating Your Software with Red Carpet
  Using dsbk on Linux and Unix
  Using iFolder to Synchronize Firefox Bookmarks
  Using Multiple Swap Partitions In 2.4
  Using openSSH to Securely Access Remote Systems
  What FTP client should I use on Linux?
  What Is Logical Volume Management?
  What is so great about Firefox?
  Which Graphic Formats For What?
  Windows Shortcuts for Firefox Tabs on Linux
  Windows to Linux: A Beginner's Guide
  Windows Users Can Feel at Home Exploring Files in Linux
  WLAN interface as the Default
  Work With User Selection Icons In KDM
  YAST Online Update De-Mystified

Technical Information
 Manually Mounting a USB Flash Drive in Linux

Printer-friendly version

Posted: 16 Feb 2005

*note* Before you begin trying to do this manually, make sure Linux has not all ready mounted your drive to your Desktop automatically.

There are two ways to manually mount your flash drive in Linux.

The first way we'll describe should be used if you are going to rarely mount your drive, or only mount it once.

The second way we'll explain should be used if you plan on using your flash drive on a more regular basis.

procedure to manually mount drive once

Plug in the flash drive into one of the USB ports on your computer.

These usually are found on the back-side of your computer. Some newer models also have some ports on the front panel.

After you've plugged it in, you'll want to open a terminal window and become the "root" user. This user is the only one which can access the commands to manually mount your drive. To become the root user, type in the following commands.

[jason@linux:~> su
Password:
linux:/home/jason #


When it asks for your password, enter the root password. (You won't see any typing on the screen when you enter your password. This is normal, and makes your computer more secure.)

After you've become root, enter the following command into the same terminal window to see if your computer has recognized the flash drive you plugged in.

linux:/home/jason # lsusb
Bus 002 Device 003: ID 08ec:0010 M-Systems Flash Disk Pioneers DiskOnKey
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
linux:/home/jason #


This information tells me that the system recognized one USB device named "M-Systems Flash Disk Pioneers DiskOnKey" That is good. Yours will most likely have a different name, so look for the name of your flash disk's manufacturer in the output.

*note* My system only has one USB device plugged in. If you have multiple devices plugged in, it will recognize them as well as your flash device, so your output will most likely look very differently than mine.

If your output doesn't list anything that looks like your flash drive, I'd recommend trying different USB ports on your computer to see if it can get listed. You must get your computer to recognize your flash drive in order to continue with this tutorial.

After successful recognition of your USB drive, you'll want to create a directory where your USB drive will be mounted. I entered the following commands into the same terminal window to do this.

linux:/home/jason # cd Desktop/
linux:/home/jason/Desktop # mkdir flash
linux:/home/jason/Desktop #
  • The "cd Desktop" command tells the computer to go into the Desktop directory (this is where I want to make the directory, so I can access the flash drive directly from my Desktop)
  • The "mkdir flash" command makes a directory named "flash" which we're going to use to mount the flash drive.
With that done, we need to get the appropriate device which is attached to your flash drive.

To do this, simply issue the following command in the same terminal window.

dmesg | grep -i "SCSI device"

linux:/home/jason/Desktop # dmesg | grep -i "SCSI device"
SCSI device sda: 31520 512-byte hdwr sectors (16 MB)
SCSI device sda: 31520 512-byte hdwr sectors (16 MB)
SCSI device sda: 31520 512-byte hdwr sectors (16 MB)
linux:/home/jason/Desktop #


As you can see, there are three lines of output, but they are all the same. The information we're interested in is the output immediately after "SCSI device". On my machine it's sda.

This is the device we're looking for. On most machines this will be the case. If you've got a newer machine with an SATA drive or a SCSI drive in it, the output will most likely be quite different. The words you'll be looking for will probably be sdb or sdc. To make sure you select the correct device, simply look for some information that describes your flash drive. For example, my flash drive has 16 megabytes of storage on it. On the output, the words (16 MB) would be a good indicator of that being my flash drive.

When you've found the correct device (sda, sdb, sdc, etc...) enter the following command into the same terminal window:

linux:/home/jason/Desktop # pwd
/home/jason/Desktop
linux:/home/jason/Desktop # mount -t vfat -o uid=jason,gid=users /dev/sda /home/jason/Desktop/flash
linux:/home/jason/Desktop #


There's quite a bit there, so let's break it down.
  • "pwd" is used to see where the path is to your Desktop, so we can accurately mount the flash drive. You'll use the line after it later.
  • The next command is the command to mount your flash drive to the flash directory. Let's break that down so we can understand it.
    • "mount" is the command used.
    • "-t vfat" tells the command to mount the "vfat" filesystem (which most flash drives are).
    • "-o uid=jason,gid=users" makes the mount accessible by the "jason" user. You'll want to change this to the user with which you use to log in. Example: if you use the username "jhamilton" to log in, you'd use "-o uid=jhamilton,gid=users" instead.
    • "/dev/sda" points to the correct device. Make sure you use the same device you found earlier. Example: If you found your correct device to be "sdc" earlier, you'd use "/dev/sdc" instead.
    • "/home/jason/Desktop/flash" is the directory to which you want the device to be mounted. You'll want to use the results of the "pwd" command here. Example: If the line after the "pwd" command was "/home/jhamilton/Desktop" you'd use "/home/jhamilton/Desktop/flash" instead.
Your flash drive is now mounted and ready to use. If you followed the instructions exactly, there is a new folder on your desktop named "flash" which can be used to put files, images, music, or anything else you want!

When you're done copying, simply pop out the drive and you're on your way.

procedure to manually mount drive for repeated use

This is the way you should mount your drive if you plan on using it often.

Plug in the flash drive into one of the USB ports on your computer.

These usually are found on the back-side of your computer. Some newer models also have some ports on the front panel.

After you've plugged it in, you'll want to open a terminal window and become the "root" user. This user is the only one which can access the commands to manually mount your drive. To become the root user, type in the following commands.

[jason@linux:~> su
Password:
linux:/home/jason #


When it asks for your password, enter the root password. (You won't see any typing on the screen when you enter your password. This is normal, and makes your computer more secure.)

After you've become root, enter the following command into the same terminal window to see if your computer has recognized the flash drive you plugged in.

linux:/home/jason # lsusb
Bus 002 Device 003: ID 08ec:0010 M-Systems Flash Disk Pioneers DiskOnKey
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
linux:/home/jason #


This information tells me that the system recognized one USB device named "M-Systems Flash Disk Pioneers DiskOnKey" That is good. Yours will most likely have a different name, so look for the name of your flash disk's manufacturer or name in the output.

*note* My system only has one USB device plugged in. If you have multiple devices plugged in, it will recognize them as well as your flash device, so your output will most likely look very differently than mine.

If your output doesn't list anything that looks like your flash drive, I'd recommend trying different USB ports on your computer to see if it can get listed. You must get your computer to recognize your flash drive in order to continue with this tutorial.

After successful recognition of your USB drive, you'll want to create a directory where your USB drive will be mounted. I entered the following commands into the same terminal window to do this.

linux:/home/jason # cd Desktop/
linux:/home/jason/Desktop # mkdir flash
linux:/home/jason/Desktop #
  • The "cd Desktop" command tells the computer to go into the Desktop directory (this is where I want to make the directory, so I can access the flash drive directly from my Desktop)
  • The "mkdir flash" command makes a directory named "flash" which we're going to use to mount the flash drive.
With that done, we need to get the appropriate device which is attached to your flash drive.

To do this, simply issue the following command in the same terminal window.

dmesg | grep -i "SCSI device"

linux:/home/jason/Desktop # dmesg | grep -i "SCSI device"
SCSI device sda: 31520 512-byte hdwr sectors (16 MB)
SCSI device sda: 31520 512-byte hdwr sectors (16 MB)
SCSI device sda: 31520 512-byte hdwr sectors (16 MB)
linux:/home/jason/Desktop #


As you can see, there are three lines of output, but they are all the same. The information we're interested in is the output immediately after "SCSI device". On my machine it's sda.

This is the device we're looking for. On most machines this will be the case. If you've got a newer machine with an SATA drive or a SCSI drive in it, the output will most likely be quite different. The words you'll be looking for will probably be sdb or sdc. To make sure you select the correct device, simply look for some information that describes your flash drive. For example, my flash drive has 16 megabytes of storage on it. On the output, the words (16 MB) would be a good indicator of that being my flash drive.

Now, enter the simple command as follows:

linux:/home/jason/Desktop # pwd
/home/jason/Desktop
linux:/home/jason/Desktop #


This command is simply to tell us what the path is to your Desktop. We'll be using this later.

After that is done, the first thing to do is make a backup of a *very* important file named "/etc/fstab" by issuing the following command:

linux:/home/jason # cp /etc/fstab /etc/fstab.bak
linux:/home/jason #


Now, we're going to need to tell your computer to set itself up to mount your flash drive every time your computer is turned on. To do this you'll need to add something like the following line to the "/etc/fstab" file. (yours might vary a little bit depending on the information you've received previously)

/dev/sda /home/jason/Desktop/flash vfat users,noauto,uid=jason,gid=users 0 0

Some of the information might be different for you. If you didn't find sda for your device before, you'll have to enter the appropriate device. Example: If you found "sdc" for your device, you would change the "/dev/sda" line to "/dev/sdc".

You will also change the /home/jason/Desktop/flash line to the appropriate directory. Example: If the line after the "pwd" command was "/home/jhamilton/Desktop" you'd use "/home/jhamilton/Desktop/flash" instead of "/home/jason/Desktop/flash".

Also, you'll need to change the "uid=jason" line to reflect the username you enter when you start Linux. Example: If you type in "JHamilton" when you log into NLD, you'll want to change "uid=jason" to "uid=JHamilton".

With that, you should be good to go.

Now we're gonna enter the command to alter the /etc/fstab file. To do this issue the following command in your terminal window:

*note* Be sure to use your own info from above!

linux:/home/jason/Desktop # echo "/dev/sda /home/jason/Desktop/flash vfat users,noauto,uid=jason,gid=users 0 0" >> /etc/fstab
linux:/home/jason/Desktop #


Now your /etc/fstab file has been altered, and you're ready to mount your flash drive.

to do so, simply enter the following commands:

linux:/home/jason/Desktop # exit
linux:/home/jason/Desktop # mount flash
linux:/home/jason/Desktop #


And your flash drive should be mounted! You can now drag 'n' drop things into your "flash" folder on your Desktop!

When you turn your computer off, in order to mount it again, simply go to your Desktop directory in a new terminal by typing "cd Desktop" and then type in "mount flash" and it'll be mounted again.






Since 2003

Portal posiada akceptację firmy Novell Polska
Wszystkie materiały dotyczące produktów firmy Novell umieszczono za zgodą Novell Polska
Portal has been accepted by the Novell Polska
All materials concerning products of Novell firm are placed with Novell Polska consent.
NetWare is a registered trademark of Novell Inc. in the United States and other countries.
Windows is a trademark or a registered trademark of Microsoft Corporation in the United States and other countries.
Sybase is a registered trademark of Sybase Inc. in the United States of America.
Other company and product names are trademarks or registered trademarks of their respective owners.