 |
 |
 |
 |
| Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc. |

16th May 2012, 02:48 AM
|
|
Registered User
|
|
Join Date: Jul 2011
Posts: 8

|
|
How to Auto Mount Network Attached Storage (NAS) at Boot?
I am quite new to Fedora.
[What I am trying to do]
On Fedora 16 (Gnome 3), I am trying to mount network drives at boot automatically. What I have done is adding lines like below in /etc/fstab.
Code:
192.168.1.11:/shared_folder /media/nas cifs username=yep,password=yep,iocharset=utf8,noperm 0 0
I also tried nfs option instead of cifs option.
[Symptoms] - It does not auto mount //192.168.1.11/share at boot.
- Manual mounting ("sudo mount -a" from the terminal) does not work either. Responds no error message.
- However, I sometimes observe the system mounts network drives all of sudden far after the boot. Strange...
[Questions] - Is syntax in /etc/fstab correct?
- What are other possible reasons that prevent auto mount? SELinux, firewall, etc...
|

16th May 2012, 03:26 AM
|
 |
Registered User
|
|
Join Date: May 2009
Location: Manorville, New York, USA
Posts: 1,581

|
|
|
Re: How to Auto Mount Network Attached Storage (NAS) at Boot?
I have a Synology NAS, which, I still haven't set up to auto mount at boot, mainly, because I access it through my browser, but, I had to open ports 9997-9999 in the firewall in order for the desktop to see it. You have to add these ports in the "Other Ports" section in the Firewall Configuration application. Check and see if your NAS requires addition ports to be open.
I run SELinux enabled and it didn't cause me any problems accessing the NAS.
If you search the forum for "NAS" and/or "cifs" and/or "nfs" you'll find other threads dealing with your problem. I've seen other threads with similar questions. It won't hurt to take a look. I'm sure others will chime in also.
__________________
Registered Linux User #348347
Have you been seduced by siduction? http://siduction.org/index.php
Running Fedora 17/18, siduction and openSUSE Tumbleweed with KDE
|

16th May 2012, 10:50 AM
|
 |
"Shells" (of a sub world)
|
|
Join Date: May 2011
Location: Helvetic Federation (Swissh)
Age: 33
Posts: 2,608

|
|
|
Re: How to Auto Mount Network Attached Storage (NAS) at Boot?
I have not written 'support' for fstab, but an easy to use script:
http://forums.fedoraforum.org/showth...ight=samba+nas
Do you have changed the workgroup (domain), and device (network) name in smb.conf to those settings you had set on the nas?
Further, did you enable browsing in the [ HOME ] section (pretty much lowest) ?
hth
__________________
Fedora Manual: http://docs.fedoraproject.org
Script-Tools: https://sourceforge.net/projects/script-tools/
sudo st tweak repo toggle fedora-rawhide ; st iso dl-fed -respin && st iso usb
|

17th May 2012, 02:04 AM
|
|
Registered User
|
|
Join Date: Jul 2011
Posts: 8

|
|
Re: How to Auto Mount Network Attached Storage (NAS) at Boot?
Thank you guys for replies.
I am getting closer to the solution, but still there is a problem.
[What I have changed] - I changed the fstab entry to something like:
Code:
//192.168.1.11/share /media/terastation cifs username="",password="",iocharset=utf8,noperm 0 0
//192.168.1.102/sdb /media/sdb cifs username=XXXX,password=XXXX,iocharset=utf8 0 0
The 1st line is for a network storage that does not require login credentials,
and the 2nd line is for a samba share on another linux machine that requires username & password.
- Cut off the firewall. I am not sure which port is relevant to nfs/cifs protocols, so cut off everything.
[New Problem]
The machine started prompting root password login at boot. I entered the password as requested, but mounting failed.
I can mount drives manually by "sudo mount -a" on the terminal after the boot (before making above changes, I could not even mount manually).
I am wondering what makes it requiring root password at boot....
---------- Post added at 10:04 AM ---------- Previous post was at 05:59 AM ----------
Howdy,
I googled to find a clue for the root password prompt at boot, then found this.
http://blag.wiki.aktivix.org/Fstab
Some excerpts from the article are:
SMBFS
Problem with mounting shares is that without suid-ing it, only root can use mount. Also if root mounts something the default way, unprivileged users will only have read-only access to the mountpoint. CIFS
Users of BLAG 50000 will find that using smbfs at the command line on in the fstab now gives an 'unknown file system' error. It has been replaced by cifs, instead. The mounting verbiage in the fstab has changed, as well. The older dmask=777, etc. has been updated to dir_mode=0777.....
To grant read/write access to regular users enter this line in the fstab:
//server/share /home/mountdirectory cifs username=smbusername,password=smbpassword,nocase,n operm,file_mode=0777,dir_mode=0777 0 0 As I am using CIFS now, it may be irrelevant to the SMBFS problem, that is, only root can use mount. However, this might give a hint...
|

17th May 2012, 02:06 AM
|
|
Registered User
|
|
Join Date: Jun 2007
Location: Lake Mary, Florida
Age: 48
Posts: 1,082

|
|
|
Re: How to Auto Mount Network Attached Storage (NAS) at Boot?
Hello,
here is what I used to mount my NAS with fstab
nas:/media /export/NAS nfs rsize=8192,wsize=8192,timeo=14,intr,nodev
# grep nas /etc/hosts
192.168.1.90 NAS nas # Netgear NAS server
I do not have a password
|

17th May 2012, 01:52 PM
|
 |
"Shells" (of a sub world)
|
|
Join Date: May 2011
Location: Helvetic Federation (Swissh)
Age: 33
Posts: 2,608

|
|
|
Re: How to Auto Mount Network Attached Storage (NAS) at Boot?
If you dont want everyone accessing your NAS, the choose of a username and pw is a good way to achieve this.
However, alot easier to handle this is if you use a credentials file.
The first 2 quotes/codes of this post might help:
http://forums.fedoraforum.org/showpo...19&postcount=7
Its alot easier to paste the 'proper' code lines, without needing to remove the pw and user name for it.
That credentials file is also accessible for the fstab loading
I'm using cifs through smbclient, which works well.
Another thing, have you enabled the firewall ports for samba and sambaclient?
As well as edited the workrgroup (domain) in smb.conf?
__________________
Fedora Manual: http://docs.fedoraproject.org
Script-Tools: https://sourceforge.net/projects/script-tools/
sudo st tweak repo toggle fedora-rawhide ; st iso dl-fed -respin && st iso usb
|

17th May 2012, 07:29 PM
|
|
Registered User
|
|
Join Date: Jul 2011
Posts: 8

|
|
Re: How to Auto Mount Network Attached Storage (NAS) at Boot?
Thank you guys, I finally found the solution.
See the post #3 in this thread.
http://forums.fedoraforum.org/showthread.php?t=271764
The problem is that the system is trying to mount network drives before the network is established at boots (I think this is the classic issue on automounting by fstab, by the way). So I made the system wait for network to be up by:
Code:
systemctl enable NetworkManager-wait-online.service
Also, I found the root password prompt at boot is caused by another setting, which is the contact card syncing online with a google account. I stopped syncing my contact card, then it stopped asking the root password at boots.
Anyway, thanks for your help.
|

14th February 2013, 12:32 PM
|
|
Registered User
|
|
Join Date: Apr 2005
Posts: 23

|
|
|
Re: How to Auto Mount Network Attached Storage (NAS) at Boot?
I run F18 and for me it works this way (you need the cifs-utils installed):
As su:
mkdir /media/nas
and add to /etc/fstab:
//192.168.2.4/backup /media/nas cifs username=ping,password=pong,uid=1000,gid=1000,ioch arset=utf8 0 0
No problems at boot time the nas is ready.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 11:29 (Friday, 24-05-2013)
|
|
 |
 |
 |
 |
|
|