Forums »
  Tutorial And Guides Forums And Topics Discussions For Help »
    How To Mount Connect USB External Drive Pendrive In Linux Shell Command

How To Mount Connect USB External Drive Pendrive In Linux Shell Command

Description: this tutorial will show you how to mount your usb pen drive into a linux computer and get the files from the drive so you can copy or transfer
Tags: how ,to ,mount ,connect ,usb ,external ,drive ,pendrive ,in ,linux ,shell ,command
Posted On Sat Jan 13, 2007 By unix In Tutorial And Guides Forums And Topics Discussions For Help Forums
How To Connect Mount USB Pen Drive In Linux Unix Shell Command Tutorial
ok, today i wanted to transfer some files from my portable pin drive into my linux server. when i was using windows xp, the system would automatically recognize the usb device and would install it. but in linux, things are different.so to help anyone outhere who wants to know how to mount or connect their USB device into linux this is how you do it.

USB Drive

Login is root and send this command:
ls /dev
After you send this command, you will see something like this:

adsp      fd0u360     lp0       ram12       systty  tty28  tty49  ttyS3
agpgart   fd0u720     MAKEDEV   ram13       tty     tty29  tty5   urandom
apm_bios  fd0u800     mapper    ram14       tty0    tty3   tty50  vcs
audio     fd0u820     md0       ram15       tty1    tty30  tty51  vcs1
bus       fd0u830     mem       ram2        tty10   tty31  tty52  vcs2
console   floppy-fd0  mixer     ram3        tty11   tty32  tty53  vcs3
core      full        net       ram4        tty12   tty33  tty54  vcs4
disk      gpmctl      null      ram5        tty13   tty34  tty55  vcs5
dm-0      hda         nvram     ram6        tty14   tty35  tty56  vcs6
dm-1      hda1        par0      ram7        tty15   tty36  tty57  vcsa
dmfm      hda2        parport0  ram8        tty16   tty37  tty58  vcsa1
dsp       initctl     parport1  ram9        tty17   tty38  tty59  vcsa2
fd        input       parport2  ramdisk     tty18   tty39  tty6   vcsa3
fd0       kmsg        parport3  random      tty19   tty4   tty60  vcsa4
fd0u1040  log         port      root        tty2    tty40  tty61  vcsa5
fd0u1120  loop0       ppp       rtc         tty20   tty41  tty62  vcsa6
fd0u1440  loop1       ptmx      sequencer   tty21   tty42  tty63  VolGroup00
fd0u1680  loop2       pts       sequencer2  tty22   tty43  tty7   X0R
fd0u1722  loop3       ram       shm         tty23   tty44  tty8   zero
fd0u1743  loop4       ram0      snd         tty24   tty45  tty9
fd0u1760  loop5       ram1      stderr      tty25   tty46  ttyS0
fd0u1840  loop6       ram10     stdin       tty26   tty47  ttyS1
fd0u1920  loop7       ram11     stdout      tty27   tty48  ttyS2




Now connect your USB pendrive, wait a like 15 seconds while your system recognizes the drive, then execute again this command:
ls /dev


Then it will display all the devices in your system

adsp      fd0u360     lp0       ram12       stderr  tty25  tty46  ttyS0
agpgart   fd0u720     MAKEDEV   ram13       stdin   tty26  tty47  ttyS1
apm_bios  fd0u800     mapper    ram14       stdout  tty27  tty48  ttyS2
audio     fd0u820     md0       ram15       systty  tty28  tty49  ttyS3
bus       fd0u830     mem       ram2        tty     tty29  tty5   urandom
console   floppy-fd0  mixer     ram3        tty0    tty3   tty50  vcs
core      full        net       ram4        tty1    tty30  tty51  vcs1
disk      gpmctl      null      ram5        tty10   tty31  tty52  vcs2
dm-0      hda         nvram     ram6        tty11   tty32  tty53  vcs3
dm-1      hda1        par0      ram7        tty12   tty33  tty54  vcs4
dmfm      hda2        parport0  ram8        tty13   tty34  tty55  vcs5
dsp       initctl     parport1  ram9        tty14   tty35  tty56  vcs6
fd        input       parport2  ramdisk     tty15   tty36  tty57  vcsa
fd0       kmsg        parport3  random      tty16   tty37  tty58  vcsa1
fd0u1040  log         port      root        tty17   tty38  tty59  vcsa2
fd0u1120  loop0       ppp       rtc         tty18   tty39  tty6   vcsa3
fd0u1440  loop1       ptmx      sda         tty19   tty4   tty60  vcsa4
fd0u1680  loop2       pts       sda1        tty2    tty40  tty61  vcsa5
fd0u1722  loop3       ram       sequencer   tty20   tty41  tty62  vcsa6
fd0u1743  loop4       ram0      sequencer2  tty21   tty42  tty63  VolGroup00
fd0u1760  loop5       ram1      sg0         tty22   tty43  tty7   X0R
fd0u1840  loop6       ram10     shm         tty23   tty44  tty8   zero
fd0u1920  loop7       ram11     snd         tty24   tty45  tty9




Notice the difference, now I see sda and sda1, so now i can mount the sda1 device which is my pin drive. but first i want to make sure i have a directory where i can mount the sda1. so execute this command next:
ls /mnt

Most likely you wont see a USB or anything that you can mount the usb drive. asuming you don't have a USB directory, which is my case, i will create a directory called "usb" so to that send this command:
mkdir /mnt/usb

Now that you have created the usb directory its time to mount your device, so send this command:
mount -t auto /dev/sda1 /mnt/usb

Ok, you have have mounted the usb device, nos list all the files in the /mnt/usb with this command:
ls /mnt/usb

REMEMBER, don't remove (disconnect) your pendrive until you have unmounted the usb device, so to unmount it send this command:
umount /mnt/usb

ALSO: if you try to unmount the device and you get something like this:
[root@host usb]# umount /mnt/usb umount: /mnt/usb: device is busy umount: /mnt/usb: device is busy

Send this command if you get a "device is busy" message:
cd /

and try to unmount it again. If it failed it was because you were in the /mnt/usb directory so you needed to get out before you unmount it.
also note that i used this same procedure to mount an external drive i bought at my electronics store. I bought a Wolverine (Wolvorine) 100GB USB 2.0 External Drive and it worked great to back up some files i had.
wolverine usb drive
Hope this helps - thanks to the fold at www.webune.com for their support on this question.

hope this helps

hakeem Sun May 13, 2012
thanks a lot for information...k that work going..
Dhruvak Sun Feb 26, 2012
Thanks for nice explanation.
suba Mon Dec 26, 2011
Thanks a lot! This article is very useful to me.
nikhil Sun Aug 28, 2011
really this is very usefull ideaaaaa,mind blowinggggg
toogol Mon Nov 29, 2010
Thank you for your clear explanation on the fs type "auto". I had been stumped during this stage of the mount. This resolved things for me.
Sourabh Tue Apr 20, 2010
thanks for ur tutorial but my problem is somewhat different actually i am working on rhel 5.0 as an virtual machine means on vmware nd my base platform is windows server on wich this vmware is working on.
now when i connect usb pendrive with system it mounts on windows not on linux.
"tell me the way by which i can connect usbpendrive on linux virtual machine"""

it will b great honor for me to meet the person who solve this problemof mine....
thanks for listening....
gangadhar Tue Nov 03, 2009
sir, i want to copy my files into my pendrive, under linux o/s.
when i m trying to copy it, it shows read only.
siva Fri Oct 30, 2009
i got my usb connected to system, it was visible as /dev/sdb1 from fdisk -l.
i created /mnt/usb and tried to mount it using mount -t usbfs /dev/sdb1 /mnt/usb
and it got mounted also. when i get into /mnt/usb folder, it shows 001 002 .. folders and devices file and could not see the exact contents of the usb drive. can you help.
jagdeep Sun Oct 11, 2009
it really helpfull information for me
thanks for it
shaik Mon Aug 17, 2009
please send me common iptables using linux administrator
Bharath Thu Apr 23, 2009
i have some problem with my pen drive.it cannot be mounted on linux.it is coming like /dev/sda1/ canoot read superblock.also on windows it is showing the file or the directory is corrupted and unreadable.please send me a soln.....
Ken Fri Mar 20, 2009
very useful.... thanks again.
Anil Sat Mar 07, 2009
excellent step-by-step procedure to mount a usb device in unix.
thanks
sanish Mon Feb 16, 2009
16-714-ronaldo.jpg
this is very helpful to me.thanks
USP Sun Feb 08, 2009
thanks a lot.thank you very very much, needed something of this sort desperately.
ganesh Sun Nov 23, 2008
thank you. it sure helps a lot.
happylife Tue Nov 11, 2008
thank you so much for your abovedetailed explanations!!! actually i'm really new to linux so your post here is really helpful.

thanks!!!
unix Thu Nov 06, 2008
**************** attention ***************

mine was not sda1 it was sdb1

***********************
Sameer Thu Oct 23, 2008
how to connect usb in unix os ???
noname Thu Oct 09, 2008
really helpful
MJ Sat Oct 04, 2008
thanks a lot. served me well. =)
sarvajeet Thu Oct 02, 2008
very good guidance
John Wed Sep 10, 2008
thanks very much that helped me get access to my hd
Shashidhara Fri Sep 05, 2008
good explanation.
deepak Wed Aug 27, 2008
it is fantastic support.
thanks a lot
neetin Wed Jul 09, 2008
it is ok that have solved my problem. but somebody suggest the mount drive with option -o loop why? .after that i can copy files but unmount is fails. why? can you answer.
lary Tue Jun 24, 2008
warning.

be sure to compare the before and after, because sda1 is not gonna always be the sub device you just connected on your usb port. today i followed this tutorial but i ignored comparing the before and after and i mounted sda1 but that was not my usb drive. so i compared them and found out that actually its sdb1.

thanks for showing how to do this. it show me exactly what to do and imple to follow instructions
nilesh Mon May 19, 2008
its very helpfull comand for me and the command deatils are so simple
abhay Sun Apr 13, 2008
thanku it works ...
but can u tell me why to use "dmesg" command to mount the pen drive..............
sureshkumar Tue Jan 29, 2008
i don't how can mount the usb device in the linux os but real i thinks you it working ....got of thanks
Dingo Fri Nov 16, 2007
to the last commenter: you can mount ntfs, and with many options (as long as your kernel supports it of course). search for ntfs3g, fuse, fusermount, etc etc. there are numerous good resources for ntfs+linux. i deal with ntfs drives on linux on a daily basis with perfect results. typically any new linux distro supports this natively from a vanilla install.
unix Wed Sep 12, 2007
ntfs is for windows only, you're pendrive is formatted in windows, so it won't work in a linux computer. when the pendrive was formated, it was formated with ntfs partition, if the partition was fat or fat32, linux would be able to see it, but since its ntfs, you won't be able to get to to work on a linux computer. - sorry.
vikas Wed Sep 12, 2007
thanx dear.
i found this info. very usefull but i faced problem while executing
mount -t auto/dev/sda1 /mnt/usb
error message was
mount:fs type ntfs not supported by kernel
pls give me some guidelines so i can mount my usb pendrive
webune Sun Jul 01, 2007
i followed your steps, but on my machine it was sdb and sbd1. so if you are trying and sda1 doesn't work, try sdb1
ceylot Mon Apr 30, 2007
Great tutorial. Really helped me!
Thanks
Information
Title: How To Mount Connect USB External Drive Pendrive In Linux Shell Command
Info: This Post Has Been Viewed 0 Times Since
Date: Sat Jan 13, 2007
Author unix Received 39 Replies #1410
Related Sites
Add Your Website
Share
wallpaperama | Wallpapers | Forums | Terms Of Service

copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Tue Jun 18, 2013 (-8 GMT)
Powered by: Webune Forums V5