New NAS - Cant mount/see HDD drives [SOLVED]

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

Postby nelz » Mon May 20, 2013 11:36 pm

You certainly don't need smbfs tomount nfs shares, what do you get it you run

Code: Select all
sudo mount /mnt/video_share/video
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8469
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby Ram » Tue May 21, 2013 7:57 pm

GeordieJedi wrote:Hi there nelz.

I've changed the hostname of my NAS now (as it's a lot easier to type).

I've tried a few quick experiments with the FSTAB and I did manage to get some mount points created by adding
this line to the FSTAB file =

Code: Select all
Hoth:/volume1/photo /mnt/photo_share/photo nfs nouser,atime,auto,rw,dev,exec,suid 0 0


So the mount points showed up on the mnt dir, but they were owned by root
I then tried a chown to my username but then bash said that the dirs did not exist !


Can you actual ping the NAS by hostname

Code: Select all
 ping Hoth

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
User avatar
Ram
LXF regular
 
Posts: 1675
Joined: Thu Apr 07, 2005 9:44 pm
Location: Guisborough

Postby GeordieJedi » Tue May 21, 2013 9:14 pm

Nelz -

Command =
Code: Select all
sudo mount /mnt/video_share/video



This is the result =
Code: Select all
mount: wrong fs type, bad option, bad superblock on Hoth:/volume1/video,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so



Ram -

Command =
Code: Select all
ping Hoth


Result =
Code: Select all
ping: unknown host Hoth
User avatar
GeordieJedi
LXF regular
 
Posts: 335
Joined: Thu Jun 14, 2007 10:36 pm
Location: North East England

Postby Ram » Tue May 21, 2013 10:22 pm

You need to either edit your fstab and replace Hoth with its IP or put a line in your /etc/hosts file mapping the IP to the hostname.

192.168.xxx.xxx Hoth

Looking at the spec of the NAS I don't see NFS as option, unless you have set it up on the NAS.

In your browser try

smb://192.168.xxx.xxx or smb://Hoth

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
User avatar
Ram
LXF regular
 
Posts: 1675
Joined: Thu Apr 07, 2005 9:44 pm
Location: Guisborough

Postby GeordieJedi » Sun May 26, 2013 9:19 pm

Hi again
(I've edited my 1st post to include my distro and DE).

I have also installed the package "nfs-common".
Do I also need to install "nfs-kernel-server" ?

I'm happy to try and add the IP address to the etc/hosts address.
However It's already changed once.
(I don't have a static IP address. My ISP is Virgin).
But am I right in thinking that I can (kind of) assign myself a static IP
address (within my own network, for my NAS box ?)


@ Ram -
I double checked, the NAS does support SMB and NFS.
I have enabled NFS on the NAS box.


@ Nelz

Is it worth me adding this line -
Code: Select all
rsize=8192,wsize=8192,soft  0 0

to by FSTAB insted of what I have there already ?


I was following this guide here for my FSTAB options.
User avatar
GeordieJedi
LXF regular
 
Posts: 335
Joined: Thu Jun 14, 2007 10:36 pm
Location: North East England

Postby Ram » Sun May 26, 2013 10:27 pm

Your IP supplies your External address your NAS is on the Internal (NAT) address, usually the 192.168.*.* address. The 192.168.*.* comes from your router.

You can't ping by hostname on your internal network, hence
Code: Select all
ping: unknown host Hoth


So you'll either have to edit your /etc/hosts file or put the IP address of the NAS in the fstab file though if you switch off your router you might get a new IP assigned to the NAS when the router is powered back up.

You should be able to in your router setup, set a static IP for the NAS - I'm a VM customer but I don't have their router so not sure on how to do that.

Yes, you will need to install nfs-common on your client (kde desktop)

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
User avatar
Ram
LXF regular
 
Posts: 1675
Joined: Thu Apr 07, 2005 9:44 pm
Location: Guisborough

Postby GeordieJedi » Sun May 26, 2013 10:47 pm

Hi Ram.
Yeah, I'm using a router (and a switch too, which connects my PC's and NAS box together. Which is situated upstairs in my office).



So when I ping =
Code: Select all
192.168.x.x:xxxx (where xxxx = port number)


Response =
Code: Select all
unknown host 192.168.x.x:xxxx


However when I ping
Code: Select all
192.168.x.x


I get the response =
Code: Select all
64 bytes from 192.168.x.x: icmp_req=1 ttl=64 time=0.168 ms
64 bytes from 192.168.x.x: icmp_req=2 ttl=64 time=0.150 ms
64 bytes from 192.168.x.x: icmp_req=3 ttl=64 time=0.165 ms
64 bytes from 192.168.x.x: icmp_req=4 ttl=64 time=0.159 ms
64 bytes from 192.168.x.x: icmp_req=5 ttl=64 time=0.158 ms
64 bytes from 192.168.x.x: icmp_req=6 ttl=64 time=0.157 ms

Which keeps on going, and going and going......
User avatar
GeordieJedi
LXF regular
 
Posts: 335
Joined: Thu Jun 14, 2007 10:36 pm
Location: North East England

Postby Ram » Sun May 26, 2013 11:04 pm

You can't ping ip:port only the ip. You shouldn't need a port number.
The port number is probably for the NAS's web interface.

Your fstab should look something like this

192.168.*.*:/srv/logs /mnt/logs nfs nouser,defaults,atime,auto,rw,dev,exec,suid 0 0


rsize=8192,wsize=8192 can be added later once working.

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
User avatar
Ram
LXF regular
 
Posts: 1675
Joined: Thu Apr 07, 2005 9:44 pm
Location: Guisborough

Postby GeordieJedi » Wed May 29, 2013 9:29 pm

Ok I've tried a little experiment.

I've made 2 amendments to my FSTAB.

1. I've changed the mount points to the /media dir rather than the std /mnt dir.
(I realise /mnt is convention however Im using Ubuntu 12.04 and I've always had
better luck putting my normal HDD mounted partitions in this dir).

2. Added the IP address as you suggested on one of the lines

FSTAB =
Code: Select all
192.168.x.x:/volume1/video /media/video_share/video nfs nouser,atime,auto,rw,dev,exec,suid 0 0
#
Hoth:/volume1/photo /media/photo_share/photo nfs nouser,atime,auto,rw,dev,exec,suid 0 0
#
Hoth:/volume1/music /media/music_share/music nfs nouser,atime,auto,rw,dev,exec,suid 0 0


Error messages =
Code: Select all
mount.nfs: access denied by server while mounting 192.168.x.x:/volume1/video
mount.nfs: Failed to resolve server Hoth: Name or service not known
mount.nfs: Failed to resolve server Hoth: Name or service not known


The first line in the error message seems interesting.....

So, why can't I ping Hoth ?
I can access the NAS via a web browser.

I can see that it has an IP address if I log into my routers advanced settings page
User avatar
GeordieJedi
LXF regular
 
Posts: 335
Joined: Thu Jun 14, 2007 10:36 pm
Location: North East England

Postby paulm » Wed May 29, 2013 10:07 pm

GeordieJedi wrote:Ok I've tried a little experiment.

I've made 2 amendments to my FSTAB.

1. I've changed the mount points to the /media dir rather than the std /mnt dir.
(I realise /mnt is convention however Im using Ubuntu 12.04 and I've always had
better luck putting my normal HDD mounted partitions in this dir).


Can't see that changing the mount directory would make the slightest difference - you can set a mount directory to whatever you like - the NAS won't care, nor will you machine, so long as the mount point is a valid and writeable resource.

2. Added the IP address as you suggested on one of the lines

FSTAB =
Code: Select all
192.168.x.x:/volume1/video /media/video_share/video nfs nouser,atime,auto,rw,dev,exec,suid 0 0
#
Hoth:/volume1/photo /media/photo_share/photo nfs nouser,atime,auto,rw,dev,exec,suid 0 0
#
Hoth:/volume1/music /media/music_share/music nfs nouser,atime,auto,rw,dev,exec,suid 0 0


Error messages =
Code: Select all
mount.nfs: access denied by server while mounting 192.168.x.x:/volume1/video
mount.nfs: Failed to resolve server Hoth: Name or service not known
mount.nfs: Failed to resolve server Hoth: Name or service not known


The first line in the error message seems interesting.....


Have you got rpcbind (or portmapper) running? By default, NFS uses file locking, which requires one of the other of those two services to be running on the client. Otherwise, you need to specify no lock - on a manual mount, that would be

Code: Select all
 -o nolock


but I'm not sure what you'd use in fstab - I always mount my NFS shares using a script, so I'm not that familiar with what's needed in fstab.

So, why can't I ping Hoth ?
I can access the NAS via a web browser.

I can see that it has an IP address if I log into my routers advanced settings page


Some routers provide local DNS services, but many do not. Without local DNS support in the router, you need to add entries to the /etc/host files on all machines which might access the NAS linking its name to its IP (assuming you either have it set to use a static IP or you have your router set to assign it a constant IP, using the NAS's MAC).

Any network resource of that sort should be on a constant IP so other things on the network know where to find it. I have a small server (which also doubles as a NAS) which does this - it provides both DHCP and DNS support for my local network using Dnsmasq. I prefer to record the MAC numbers of anything that I want on a constant IP and use the server to make sure they that always get that same IP, but if your router doesn't have that sort of capablity, you may need to set the NAS with a static IP instead.

Paul.
paulm
LXF regular
 
Posts: 242
Joined: Mon Apr 03, 2006 4:53 am
Location: Oxfordshire, UK

Postby Ram » Wed May 29, 2013 10:43 pm

Just to make sure you have the correct permissions on the mount point run

Code: Select all
 ls -l /mnt


When using the your browser are using Hoth or the IP ?

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
User avatar
Ram
LXF regular
 
Posts: 1675
Joined: Thu Apr 07, 2005 9:44 pm
Location: Guisborough

Postby GeordieJedi » Wed May 29, 2013 11:08 pm

Ok.

I've created a static/reserved IP address in the VM routers advanced settings page.

I've looked in the etc dir and I don't seem to have a etc/hosts file.
I can see "hosts.conf" file. Is this the same thing ?
Otherwise do I just create a text file called hosts ?


The permissions are correct in the original mnt dir,
but not in the media dir (as I haven't changed them yet).
User avatar
GeordieJedi
LXF regular
 
Posts: 335
Joined: Thu Jun 14, 2007 10:36 pm
Location: North East England

Postby paulm » Wed May 29, 2013 11:45 pm

GeordieJedi wrote:I've created a static/reserved IP address in the VM routers advanced settings page.


Good. That means that the IP will remain constant, which will at least mean that you can be confident of addressing the NAS by IP if nothing else.

I've looked in the etc dir and I don't seem to have a etc/hosts file.
I can see "hosts.conf" file. Is this the same thing ?
Otherwise do I just create a text file called hosts ?


Strange. Even Windows usually has a hosts file. This is the one generated by my (rather buggy) Xubuntu 13.04 installation:

Code: Select all
127.0.0.1       localhost
127.0.1.1       t400

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters


:) I really don't understand IPv6 addresses, but the bit that makes a difference to you is in the first couple of lines. You can add something like:

Code: Select all
192.168.x.x <NAS-name>


to it so that your machine will know where to look when you address the NAS by name.


The permissions are correct in the original mnt dir,
but not in the media dir (as I haven't changed them yet).


As I said, it should make absolutely no difference where to put the mount point. You will need to check whether rpcbind (or portmapper) is running - the permission denied error could well be due to lack of file locking. I'm not in Xubuntu at the moment, so I can't recall what the package name was - will have a look later if someone else can't tell you.

You can check whether it is running using something like this:

Code: Select all
ps ax | grep rpcbind


If its not running, you will need to either modify your fstab commands, or get it and install it. While it shouldn't make a lot of difference if only one machine is going to be accessing the NAS, its still a good precaution to have file locking enabled.

Its possible you may have portmapper instead of rpcbind, but so far as I know, any recent distro will be using rpcbind, not portmapper.

Edit: Sorry, just noticed from one of your earlier posts that you've installed nfs-common, which most likely does include rpcbind or portmapper. Use ps to check that it is running - if it is, the permission error may be down to the permissions on the NFS share you've created on the NAS.

Looking at my Icy Box NAS, I've got the permissions on the NFS share set like this:

Code: Select all
drwxrwxrwx    4 root     root            30 Nov  3  2012 stor


showmount -e gives me this:

Code: Select all
root@OpenWrt:/mnt/sda2# showmount -e
Export list for OpenWrt:
/mnt/sda2/stor 192.168.1.0/255.255.255.0


Permissions on my server NFS share are set the same, and showmount -e gives me this:

Code: Select all
root@sms:/home/files/data-1# showmount -e
Export list for sms:
/home/files/data-1/stor 192.168.1.0/255.255.255.0


/etc/exports for the sms box is as follows:

Code: Select all
/home/files/data-1/stor   192.168.1.0/255.255.255.0(no_root_squash,rw)


Paul.
paulm
LXF regular
 
Posts: 242
Joined: Mon Apr 03, 2006 4:53 am
Location: Oxfordshire, UK

Postby Ram » Thu May 30, 2013 12:01 am

Sorry my mistake it was meant to be in the media directory.

Code: Select all
ls -l /media


Yes you can create a hosts file. I use vi

Code: Select all
 sudo vi /etc/hosts

xxx.xxx.xxx.xxx Hoth



Replace the xxx with the IP.

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
User avatar
Ram
LXF regular
 
Posts: 1675
Joined: Thu Apr 07, 2005 9:44 pm
Location: Guisborough

Postby nelz » Thu May 30, 2013 8:55 am

Permissions are not the issue, the error message is "access denied" which comes from the server. There is too much going on here and you are getting bogged down in network configuration, mount points, permissions, fstab options and far too much more. Keep it simple, especially as you now have a fixed IP address for the NAS.

Code: Select all
sudo mount 192.168.x.x:/path/to/export -t nfs /mnt/mountpoint


Note down any errors and try to investigate them one at a time instead of jumping around like a fart in a wicker chair.

If you get an access denied error, SSH into the NAS and check its logs, you won't get anything useful from the client. If you don't have SSH to the NAS working yet, sort that out first, you'll be flailing in the dark without it.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8469
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

PreviousNext

Return to Help!

Who is online

Users browsing this forum: No registered users and 4 guests