LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Auto Mount 2 Hard Drives attached by USB to Router (https://www.linuxquestions.org/questions/linux-newbie-8/auto-mount-2-hard-drives-attached-by-usb-to-router-4175542090/)

vcandy 05-09-2015 04:54 PM

Auto Mount 2 Hard Drives attached by USB to Router
 
Hi all. My first time post and very new to linux.
I am using linux Mint Debian version.

My goal is to auto mount 2 external harddrives (Each hard drive is 2TB) attached to the 2 usb ports on my asus wireless router model rt-n56r.

I have succeeded in auto mounting my first drive HDD1 by configuring fstab file:

//192.168.1.1/HDD1 /media/public cifs username=**,password=**,rw,nounix,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

At boot this partition is mounted without issue.

In attempting to mount the second hard drive HDD2 I added another entry in fstab as follows:

//192.168.1.1/HDD2 /media/public cifs username=**,password=**,rw,nounix,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

It appears that both HDD1 and HDD2 mount however, when entering the partition only files and directories of the second hard drive appear.

So I changed the mount point in the second hard drive to reflect /media1/public1 and after the configuration neither hard drive appears to have mounted.

I tried using UUID instead of path to partition but cannot get even 1 attached hard drive to mount.

I appreciate in advance the help and assistance to my query.

zhjim 05-11-2015 02:07 AM

The second field in an fstab line is the place where things get mounted into the existing filesystem. And as you noticed correctly if you mount two things in the same place you only see the last added one. So you need a second directory for the second hdd. Did you make the directory /media1/public1 allready?

I don't think that UUID will help much here due to you mounting network drives.
To see why things fail you have to take a look at the /var/log/syslog file or the message file. Or hit dmesg|less and search for smb, samba or cifs errors. Or try to mount them by hand and see what it errors out. Or have a second terminal with tail -f /var/log/messages.

pan64 05-11-2015 02:10 AM

you can try to mount by hand:
mount /media/public1
mount /media/public
and also you can try to umount them.
Please check if that works and post the output.

vcandy 05-11-2015 08:02 AM

Solved
 
Thanks Zhjim... you are correct in the behavior of the mount point being the same - the last mount only shows as mounted as you said. I also did make the directory /media1/public1 for the second mount and prior to testing assumed it would work, but oddly it did not and neither drive mounted.

At any rate I did get it working. For me, the problem seemed to be the area in the filesystem in which I placed the mount point. After trying various scenarios any place I placed the mount points before my /home directory I could only get one drive to mount, even when setting up 2 separate directories in the case of /media/public and /media1/public1 I couldn't get any to mount.

I changed my mount points to the Public folder in my home directory /home/vcandy/Public/HDD1 and /home/vcandy/Public/HDD2 and it resolved the issue.

I wouldn't be surprised if this is a permissions issue, for the small amount of time I have been tinkering with Linux many of the issues seem to stem from my ignorance of permissions.

I am learning... Appreciate the support.

vcandy

zhjim 05-11-2015 09:28 AM

Great you have it solved. Please mark thread as appropiate.

I'd wonder if the culprit really is the mount point within the filesystem hierachry but if the new path suites all should be good.
Normaly all binds that happen due to /etc/fstab are done with root permission so there should be no problem. At least when it comes to mounting. User access sure uses the permissions of the according directories.

If you have some time, maybe dig into logs some more to see what might be the error with the old mount path


All times are GMT -5. The time now is 10:51 PM.