ls: reading directory 'nas': Input/output error on Ubuntu 20

caleb87

Cadet
Joined
Jan 19, 2021
Messages
4
I setup a new NAS. I mounted it on Windows 10 first, and it went well and everything works. I copied files etc.

I'm now trying to get it going on Ubuntu 20 server. Any time i try to list files in the NAS, I keep getting the error:
Code:
ls: reading directory 'nas': Input/output error on Ubuntu 20


I installed nfs-common. After I created a Unix Share (NFS), the mount failed until I enabled NFS and NFSv4. The NFS service is up and running. I tried turning it off/on. I also tried creating a dataset with default options, then put all permissions to 777, and remounted to it.

I used the following variations to mount the NAS:
Code:
sudo mount "192.168.1.108:/mnt/pool/dataset" /home/user/nas
sudo mount -t nsf "192.168.1.108:/mnt/pool/dataset" /home/user/nas
sudo mount -t nsf "192.168.1.108:/mnt/pool" /home/user/nas



I tried providing options for username/password when mounting, but that also throws a different error:
Code:
sudo mount -t nsf -o username=myUser,password=securePass123 "192.168.1.108:/mnt/pool/dataset" /home/user/nas
mount.nfs: an incorrect mount option was specified



Since it works fine on Windows, its an issue with configuring unix/truenas to work. Any ideas?



Version:
TrueNAS-12.0-U1
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
List your NFS exports by posting the output of this command in the TrueNAS shell: "cat /etc/exports". That i/o error can mean you're trying to mount the wrong path. Using NFSv3 only in the TrueNAS NFS server settings is still OK, otherwise choosing NFSv4 with NFSv3 style security is easier to use than NFSv4 alone.

The dataset you want to share must be created with a "generic" share type. You need to sort out the correct syntax for NFS mounts in Ubuntu, your last example muddles CIFS and NFS synatax. .
 
Last edited:

caleb87

Cadet
Joined
Jan 19, 2021
Messages
4
Code:
V4: / -sec=sys
/mnt/M2 Pool/Caleb -alldirs
/mnt/M2 Pool/Caleb2 -alldirs


I'm using those actual mount paths, not /mnt/pool as in my example. I have tried both mount paths. Windows 10 mounted to M2 Pool but required my username/pass. I haven't seen a way to provide that with Ubuntu. I tried NSF3 first but it kept failing, so I tried to NSF4 and worked without an error, but the list command fails (so maybe it didn't mount correct).

With NFS3, I get the following error while mounting:
Code:
mount.nfs: access denied by server while mounting 192.168.1.108:/mnt/M2 Pool/


The actual mount is:
Code:
sudo mount -t nfs "192.168.1.108:/mnt/M2 Pool/" /home/caleb/m2nas


I used Generic share type on the datasets. On a side note, Windows was able to open up the pool itself and I can see all datasets as folders. Is that not possible on unix?
 

caleb87

Cadet
Joined
Jan 19, 2021
Messages
4
I resolved the issue. It's because the pool cannot have a space in the name. It may be good for TrueNAS to restrict pool names so that spaces cannot be in it. Even though it's typical to not use spaces in naming, it would just make it easier in case someone tries it.
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
So its was effectively a wrong path causing the i/o error. Perhaps use underscore instead of a space character. With the space in the path name the server thinks the client is asking to mount a NFS export of /mnt/M2, which clearly does not exist.

I used Generic share type on the datasets. On a side note, Windows was able to open up the pool itself and I can see all datasets as folders. Is that not possible on unix?

Not with NFSv4. The "-alldirs" flag doesn't do what you probably think it does as each dataset is a separate filesystem ( see: https://www.freebsd.org/cgi/man.cgi?exports(5)). So if you had four datasets in a pool each would have to have an NFS share reflected in the contents of the /etc/exports file and each would require a separate mount in Ubuntu.
 
Last edited:
Top