LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-06-2012, 09:14 PM   #1
tomg120
LQ Newbie
 
Registered: Apr 2008
Location: Chicago, Illinois
Distribution: Slackware
Posts: 4

Rep: Reputation: 0
mounting a usb device


Hi All,
How does one mount a usb device when you have sata/scsi drives in use. Thanks.
tomg120
 
Old 02-06-2012, 09:41 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,340
Blog Entries: 12

Rep: Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730
At the risk of sounding cute, exactly as you would if you had IDE drives in use. The only difference is likely to be the third letter, the one after the sd.

If the USB device does not show up in your file manager automatically, which most of them do in contemporary Linux distros, you can run dmesg (likely you will have to run it as root) to find out how the computer is seeing the particular device.

For a better answer, please provide information about what type of device you are trying to mount, and how dmesg sees that device (please post only the relevant portion of the output from dmesg and surround it in "code" tags which become available when you click the "Go Advanced" button at the bottom of the quick reply window).

Last edited by frankbell; 02-06-2012 at 09:43 PM.
 
Old 02-06-2012, 09:48 PM   #3
Ion Silverbolt
Member
 
Registered: Sep 2004
Distribution: Gentoo/Xfce, Manjaro/Xfce, SolydXK
Posts: 194

Rep: Reputation: 36
Most distros will automount it when you plug it in. Usually to a mount point in the /media folder.

If you need it to mount at boot to somewhere, you can put an entry for it in your fstab. If your devices have a bad habit of being assigned to other device locations, you can use the drives UUID and mount it that way.

Code:
blkid
/dev/sda1: UUID="920f7032-d17a-4f52-8b9b-32b3ccd21fd8" TYPE="ext2" 
/dev/sda3: LABEL="System Reserved" UUID="28509A2C509A012C" TYPE="ntfs" 
/dev/sda4: UUID="AC8CB78C8CB75016" TYPE="ntfs" 
/dev/sda5: UUID="8689ac05-beeb-4442-bc01-bd3d4092c993" TYPE="swap" 
/dev/sda6: UUID="ee0e0695-5cd2-4a46-a494-3fbccba718d7" TYPE="ext4" 
/dev/sda7: UUID="76444e6c-9b3e-4144-8219-31c804814da0" TYPE="ext4" 
/dev/sdb1: UUID="bfe42e9f-e4fe-4e23-ad5e-3c8a3b105188" SEC_TYPE="ext2" TYPE="ext3" 
/dev/sr0: LABEL="BRIDGE" TYPE="iso9660"
In this example, my usb drive is /dev/sdb1. I have my fstab mount it to /mnt/usb at boot. The entry looks like this:
Code:
UUID=bfe42e9f-e4fe-4e23-ad5e-3c8a3b105188       /mnt/usb        ext3    noatime         0 1
You can also just manually mount it.
Code:
mount -U bfe42e9f-e4fe-4e23-ad5e-3c8a3b105188 /mnt/usb or
mount /dev/sdb1 /mnt/usb
Sometimes the device may be different. Especially if you have been plugging flash drives in. The UUID method is surefire.
 
Old 02-06-2012, 10:05 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,374

Rep: Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198
Almost all modern distro's access drives as scsi no matter the type. As Frank says it would be normally how the bios sees them.

SDA1 would tend to be the first bootable drive and then the mounted order follows so that a usb might be mounted as sdd or such.

Simple mount command with no options may show it is mounted. Distro's tend to put usb mounts under /media but I don't know about slackware.
 
Old 02-07-2012, 12:17 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Try
Code:
cat /etc/mtab
before and after attaching usb; you should see an extra entry if it automounts, as most modern distros/HW will.
 
Old 02-07-2012, 09:04 PM   #6
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,340
Blog Entries: 12

Rep: Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730
Oddly enough, I had to add a USB device to /etc/fstab today because it wasn't mounting with Slackware 13.37 on an older computer. The system say it, but, when I tried to open it, Konqueror threw a "Unable to mount [device]" message.

I did exactly as chrism_01 suggested. I looked at the /etc/mtab (Mount TABle file), then entered it in /etc/fstab (File System Table) file. I made two changes from the mtab entry: I set the mount to "auto" and the owner to "users."

Here is one of the clearest explanations of fstab that I've found on the net:
 
Old 02-08-2012, 08:23 AM   #7
clocker
Member
 
Registered: Sep 2011
Distribution: fedora, redhat, mint
Posts: 87

Rep: Reputation: Disabled
Is the usb device a modem or storage device? Classically all devices must be mounted on the /mnt directory, although these days they are mounted in the /media directory.

To view mounted devices
Quote:
#fdisk -l
To specify the ntfs file system
Quote:
#fdisk -l |grep NTFS
So you will be able to see the drive and its partitions as sda, sdb or hda what ever so write this. Don't forget to mkdir where you will mount the partitions.
Quote:
mount /dev/sdb1/ /mnt/dir_name
 
Old 02-08-2012, 12:56 PM   #8
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Quote:
Originally Posted by clocker View Post
Is the usb device a modem or storage device? Classically all devices must be mounted on the /mnt directory, although these days they are mounted in the /media directory.
There have been various conventions used for mountpoints, but the choice has always been arbitrary. You are free to choose whatever mountpoints you find appropriate.

I tend to have all sorts of drives and devices that I mount and unmount as needs and wants dictate. The system I like is to create a list of directories under /mnt that contains names like 'sda1, sda2, sda3 ... sdg1, sdg2, sdg3, etc. Then, I just mount devices on mountpoint directories that reflect their device names.

To view mounted drives, simply run 'mount' with no arguments. fdisk -l will show all known block devices and their partitions, irrespective of their mount status.

--- rod.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
USB device not mounting crimbo Linux - Hardware 3 02-05-2007 08:42 PM
Mounting a USB device siochain Linux - Hardware 5 08-20-2006 08:47 AM
mounting a USB device issey *BSD 6 03-01-2006 04:16 AM
Mounting a USB device jaakkop Linux - Hardware 4 05-29-2005 06:50 AM
Mounting USB device Valhalla Linux - Hardware 17 12-11-2004 03:19 PM


All times are GMT -5. The time now is 06:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration