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-13-2014, 11:08 AM   #1
Ryanms3030
Member
 
Registered: Jan 2014
Distribution: Debian, Mint, CentOS, Ubuntu
Posts: 261

Rep: Reputation: Disabled
How do I automount usb drives on server?


I'm trying to use usb drives for samba shares on my server. Having lots of problems but I feel like it's because the drives aren't mounting. This is on Centos 6.5. I just logged onto the gui and one drive popped up eventually and the other I had to mount through disk management. They both mount to /media and that's the path I'm using in my smb.conf and I can't connect to the shares but I feel like this is the problem that they are not mounted unless I log onto the server and then they auto mount after a long delay or I manually mount them. When the server is idle with no log on I imagine the drives are not mounted. Can I just edit fstab to add them?
 
Old 02-13-2014, 04:22 PM   #2
Ryanms3030
Member
 
Registered: Jan 2014
Distribution: Debian, Mint, CentOS, Ubuntu
Posts: 261

Original Poster
Rep: Reputation: Disabled
How do I determine if the mount issue is my problem? When I mount a drive in the gui it is mounted /media/backup. I can access the drive through the gui and it's fine.

Now I am ssh into the server. I
Code:
cd /media
and then ls and I see backup listed. I can cd again to /backup but when I ls at this point I get no results. That makes me assume that the volume is not really mounted. I should be able to see the contents of the drive when I ls , correct?

I tried
Code:
mount /media/backup
and get:

Code:
[mntent]: line 6 in /etc/fstab is bad
mount: can't find /media/backup in /etc/fstab or /etc/mtab
If i try to mount the smb share on my laptop using Nautulis it gives me this prompt (see attachment). I enter my password which I set on the server by doing

Code:
smbpasswd -a ryan
when I enter the password in Natuilus , I get:


Unhandled error message: Failed to mount Windows share: Permission denied


My smb config looks like this:


[backup]
path = /media/backup
valid users = ryan
read only = No
guest ok = Yes
available = yes
browsable = yes
create mask = 0777
directory mask = 0777


The frustrating thing is I had this working before with the same drive and same settings on this server. I have since reintalled the OS to start from scratch but set everything up the same
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2014-02-13 13:17:07.png
Views:	8
Size:	24.5 KB
ID:	14754  
 
Old 02-13-2014, 04:32 PM   #3
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,170
Blog Entries: 10

Rep: Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979
Check out my 1 blog entry for NTFS-related issue/help.
 
Old 02-13-2014, 04:33 PM   #4
Ryanms3030
Member
 
Registered: Jan 2014
Distribution: Debian, Mint, CentOS, Ubuntu
Posts: 261

Original Poster
Rep: Reputation: Disabled
quick update. I am using samba swat to manage the shares to make it as easy as possible. I just added myself to the admin group for the shares and I can mount the share but the folder is empty.

That leads me back to believing that the actually usb drive is not mounted properly on the server.
 
Old 02-13-2014, 04:34 PM   #5
Ryanms3030
Member
 
Registered: Jan 2014
Distribution: Debian, Mint, CentOS, Ubuntu
Posts: 261

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Habitual View Post
Check out my 1 blog entry for NTFS-related issue/help.
I will check it out. The usb drives in question are actually formated ext4
 
Old 02-13-2014, 05:02 PM   #6
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,170
Blog Entries: 10

Rep: Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979
Sorry about "that". I assumed NTFS for "some reason".

Make a
Code:
sudo /media/some_directory
and try mounting it manually first with
Code:
sudo mount -t auto /dev/sdXn    /media/some_directory
or possibly (not default)
Code:
sudo mount -t ext4 /dev/sdXn    /media/some_directory
if that works, then
Code:
/dev/sdXn        /media/some_directory           ext4        defaults         1   2
would be the /etc/fstab entry.
if you mounted it manually already

in terminal as root (or sudo) you can test the /etc/fstab using
Code:
sudo umount /media/some_directory
and then
Code:
sudo mount -a
/dev/sdXn <-- yours will be different.
Do you know how to find that out?

Let us know!

Last edited by Habitual; 02-13-2014 at 05:05 PM.
 
Old 02-13-2014, 05:05 PM   #7
Ryanms3030
Member
 
Registered: Jan 2014
Distribution: Debian, Mint, CentOS, Ubuntu
Posts: 261

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Habitual View Post
/dev/sdXn <-- yours will be different.
Do you know how to find that out?

Let us know!
I don't know how to find that out. I know I can browse /dev but other then that I'm not sure. I know my usb drive should show up as sdb or sdc or something like that but I'm not sure how to determine which drive is which
 
Old 02-13-2014, 05:06 PM   #8
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,170
Blog Entries: 10

Rep: Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979
Plug the drive in (automount is ok if it does this)
and open terminal and type
Code:
mount | grep sd
or mount through disk management then "mount | grep sd"

show us the output.

John

Last edited by Habitual; 02-13-2014 at 05:08 PM.
 
Old 02-13-2014, 05:31 PM   #9
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,170
Blog Entries: 10

Rep: Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979
My "/media/some_directory" example is "/media/backup" in your case.
 
Old 02-13-2014, 05:37 PM   #10
Ryanms3030
Member
 
Registered: Jan 2014
Distribution: Debian, Mint, CentOS, Ubuntu
Posts: 261

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Habitual View Post
My "/media/some_directory" example is "/media/backup" in your case.
I figured out that much ;-) thanks for the help!
 
Old 02-13-2014, 06:26 PM   #11
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,170
Blog Entries: 10

Rep: Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979
Is it now working?
 
Old 02-13-2014, 07:03 PM   #12
Ryanms3030
Member
 
Registered: Jan 2014
Distribution: Debian, Mint, CentOS, Ubuntu
Posts: 261

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Habitual View Post
Is it now working?
I'm at work now so I don't have access to my server to test. I will report back once I am able to test
 
Old 02-13-2014, 07:06 PM   #13
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,170
Blog Entries: 10

Rep: Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979
sure thing!

Subscribed with interest....
 
Old 02-13-2014, 10:55 PM   #14
Ryanms3030
Member
 
Registered: Jan 2014
Distribution: Debian, Mint, CentOS, Ubuntu
Posts: 261

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Habitual View Post
Plug the drive in (automount is ok if it does this)
and open terminal and type
Code:
mount | grep sd
or mount through disk management then "mount | grep sd"

show us the output.

John
When I run this command I get:

Code:
/dev/sdc1 on /boot type ext4 (rw)
I have 2 usb drives connected and I am guessing sdc1 is the internal boot drive on the computer.

When I :
Code:
lsusb
it returns:

Code:
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 005: ID 152d:2329 JMicron Technology Corp. / JMicron USA Technology Corp. JM20329 SATA Bridge
Bus 002 Device 006: ID 1058:0704 Western Digital Technologies, Inc. Passport External HDD
I know the last two devices are the usb drives. Can I mount them with any of that info?
 
Old 02-13-2014, 11:44 PM   #15
Tadaen
Member
 
Registered: Sep 2005
Distribution: Arch
Posts: 207

Rep: Reputation: 39
Code:
lsblk
ls -l /dev/disk/by-uuid
would be more appropriate. it will tell you everything plugged in and its /dev/locations. if they aren't mounting automatically then /etc/fstab is the way to go. do it by uuid though, just today i restarted my computer and my flash drive and usb hdd swapped /dev locations. uuid that can't happen.

Last edited by Tadaen; 02-13-2014 at 11:46 PM.
 
  


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
How to automount usb flash drives in Thunar (openbox) iamthat Linux - Newbie 1 05-12-2010 01:56 AM
Automount USB drives in KDE Xeratul Linux - Software 5 05-21-2007 05:03 PM
automount dvd-rw, usb drives? darkangel29 Linux - Hardware 0 02-26-2007 02:08 AM
USB drives don't automount Ashrack Linux - Hardware 2 02-13-2007 02:22 PM
Automount usb drives in specific path g0ng Linux - Hardware 1 02-12-2007 08:26 AM


All times are GMT -5. The time now is 03:57 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