Problems auto-mounting samba/cifs share with fstab
I think your box is having difficulty resolving the IP of freenas via wins/netbios. Sometimes it is very difficult to resolve.
In your
/etc/fstab
, use ip address instead of hostname like following//192.168.1.100/Server
In your
/etc/hosts
, add following line192.168.1.100 freenas
/etc/fstab
, use credential//freenas/Media /home/charles/Server cifs defaults,uid=1000,username=<user>,password=<pass> 0 0
Related videos on Youtube
charels88
Updated on September 18, 2022Comments
-
charels88 over 1 year
I have been following the same tutorial that everyone else is referencing. My
fstab
entry is exactly like in the tutorial with changes to actual location. I keep getting the errormount: only root can mount //freenas/Server on /media/Server
This is the most irritating thing I run into time and time again with running Ubuntu. I have had a freeNAS box with a single hard drive in it for almost 4 years. I had my server mounted correctly a month ago but I started from scratch again.
The server is functioning normally as I have another Ubuntu box running XBMC perfectly fine.
I am running Ubuntu 12.10 but get the same message with 12.04.
I have installed
cifs-utils
andsmbnetfs
from terminal after installing samba from the software center. This is how I got it running last time.The workgroup in samba matches my network workgroup.
I don't have any credentials to check with the share as it is setup as guest.
I can't browse the network as it keeps giving me a timeout error. I also can't open my share from Nautilus by hitting Ctrl+L and manually typing my server share (
//freenas/Server
).Edit 1: I'm able to browse my network but still am getting the error message?
Edit 2: I'm able to mount the share after testing the individual options one my one. It seems that using
codepage=unicode
was causing the problem. My fstab entry now looks like://freenas/Media /home/charles/Server cifs guest,iocharset=utf8,uid=1000 0 0
Edit 3: I can only mount using only "guest" for options? Last time I ran into an issue of not being able to open files on other computers that originated from my Ubuntu machine?
Last Edit: I had to force my freeNAS server(Version: 0.7.2.5543) to have the same permissions as Ubuntu,
GID=1000
foruid=1000
. Also freeNAS by default creates a guest user accountftp
with a null password. With these three items and adding my freeNAS IP address to/etc/hosts
I'm up and running. Sorry for the super long delay closing this question but I greatly appreciate the help!fstab entry:
//freenas/Media /home/charles/Server cifs username=ftp,password=,uid=1000 0 0
-
Bruno Pereira over 11 yearsStart by actually showing the line you are using to mount the share with fstab and the output of
ls -l
in/media
. -
charels88 over 11 years//freenas/Media /media/Server cifs guest,uid=1000,iocharset=utf8,codepage=unicode,unicode 0 0
-
John Siu about 11 yearsIn your edit 2, is
uid1000
a typo here or a typo in your actual fstab? It should beuid=1000
. -
charels88 about 11 yearsIt was just a typo here John I will fix it, Thanks.
-
-
charels88 over 11 yearsI'm out of town but will try this when I get back.
-
charels88 about 11 yearsI have tried both options John but have had no success. From a stroke of luck I'm able to now browse my network and can see and use my server. Any other suggestions to auto-mount the share?
-
John Siu about 11 yearsIf you are trying to mount from Nautilus, maybe try comment/remove the line from
/etc/fstab
. -
charels88 about 11 yearsI'm trying to auto-mount using fstab but can mount only if I have "guest" for options
-
John Siu about 11 yearsDid you setup your freenas with guest only access? Or you want to connect with credential? Check (3).
-
charels88 about 11 yearsFreeNAS is set up to give anonomyous(guest) access. I'm having an issue that files I upload can be read but not changed even from the desktop I uploaded them with??? I thing that this is because I have only guest as options. I can't make heads or tails from the man pages on how to properly configure fstab. If you know of a good tutorial or another reference that better explains the mount configurations please share.
-
John Siu about 11 yearsI believe we will have to solve the issue from the freenas side. Is it possible you change the share directory owner on freenas to a uid=1000?
-
charels88 about 11 yearsThis is where it gets muddy, my freenas box is a lga755 pentium 4 and has an outdated version of freenas that I'm unable to update due to compatability. I'm not that great with the server side of things as I can set up the box for samba but the advanced settings are lost on me. The only thing on the freenas side I can tell that might help is that the default guest account name is "ftp". I will try removing the "guest" option in fstab to replace with "user=ftp,password=". I will continue to research how to set "uid=1000" on the server side.