feed-image  Delivered by FeedBurner  ISSN 1836-5930





Visitors Online

We have 87 guests online

Poll

Which of following tutorials would you like to see on the Linuxconfig.org?
 
Partner Linux Sites
TuxMachines
DebianAdmin
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
FreeSoftwareLinux
Jam's Ubuntu Blog
All For Linux

Howto mount USB drive in Linux
Article Index
1. Example
2. Detecting USB hard drive
3. Creating mount point
4. Edit /etc/fstab

1. Example

2. Detecting USB hard drive

After you plug in your USB device to your USB port, linux will add new block device into /dev/ directory. At this stage you are not able to use this device as the USB filesystem needs to be mouted before you are able to retrieve any data. To find out what name your block device file have you can run fdisk command:

# fdisk -l 

You will get output similar to this:

Disk /dev/sdb: 60.0 GB, 60060155904 bytes
255 heads, 63 sectors/track, 7301 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000b2b03

Device Boot Start End Blocks Id System
/dev/sdb1 1 7301 58645251 b W95 FAT32


3. Creating mount point

Create directory where you want to mount your device:

mkdir /mnt/sdb1 

4. Edit /etc/fstab

To automate this process you can edit /etc/fstab file and add line similar to this:

/dev/sdb1       /mnt/sdb1           vfat    defaults        0       0 

Run mount command to mount all not yet mounted devices. Keep in mind that if you have more different USB devices in you system, device name can vary!!!

# mount -a 
Comments (5)
  • jonkwong  - sda/sda1

    Your mount point is /mnt/sda1
    and the device file is /dev/sda

    But the Edit /etc/fstab line is reversed.
    /dev/sda1 /mnt/sda

    jk

  • Lubos  - sda/sda1

    There was small problems with fstab and now it is corrected. Thanks for pointing that out !

    /dev/sda1 /mnt/sda vfat defaults 0 0

    changed to:

    /dev/sda1 /mnt/sda1 vfat defaults 0 0


    device returned with fdisk -l command is sda ( whole disk ) and the first partition which we want to mount is sda1

  • bashir ahmed  - THANKS

    I thanked to ur honour for producing an amazing and beautiful with detailed clearing conception as well as for a new user like me.

    Thanks again with the hope and looking for new tutorials.


    with best wishes

    bashir ahmed
    islamabad - Pakistan

  • savan ....  - how to mount usb drive in fedora

    HELLO ................

    ANY ONE CAN TELL
    how to mount usb drive in fedora

    IT'S 80 GB EXTERNAL DRIBVE

  • Anonymous


    How to mount partition with ntfs file system and read write access
    Linux Commands
    Vim Tutorial
    How to dual boot Windows XP and Ubuntu Linux
    Linux lvm - Logical Volume Manager
    HowTo configure NFS
    HowTo mount cdrom in linux

Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
Security
Please input the anti-spam code that you can read in the image.