Linux NFS mount, but input/output error trying to access

strangeintp

Cadet
Joined
Jan 1, 2021
Messages
7
TLDR: I can mount a nfs share at my client Linux machine, but don't seem to be able to access it: ls -l /mnt/entertainment returns ls: reading directory 'entertainment': Input/output error

Not new to Linux (I can do most of the fundamentals, but am by no means an expert, or even journeyman), but new to both TrueNAS and working with NFS. Not sure if my issue is w/ TrueNAS setup or something I need to do on my client machine.

I followed the docs directions for setting up a pool and a dataset.

I have five 2 TB drives set up as RAIDZ2.

I configured datasets as follows:
Code:
/mnt/Family Media and Data
/mnt/Family Media and Data/Entertainment
/mnt/Family Media and Data/Private


I added a group "Family" and user "vince" (me).

The Family Media and Data is just a parent for Entertainment and Private.

I then set up a NFS Share for Entertainment. I'd like to rip our optical disk collection to the NAS and [eventually] serve it up to an HTPC (running Linux) via PLEX for the family to enjoy.

For now, I'd at least like to move some of the media that I've ripped on my local [Linux Mint 20] machine to the NAS, but I'm stuck.
Initially I had "access denied" problems with mount but I fixed that by enabling NFSv4 in the service options (a tip that's not in the docs, btw).
Here's some console output:
Code:
vince@workstation-Mint20:~$ sudo mount -t nfs 192.168.68.61:"/mnt/Family Media and Data/Entertainment Media" /mnt/entertainment
[sudo] password for vince:           
vince@workstation-Mint20:~$ ls /mnt
backup  entertainment
vince@workstation-Mint20:~$ ls -l /mnt
total 5
drwxr-xr-x 7 root   root       4096 Dec 31 19:35 backup
drwx--x--x 2 nobody 4294967294    2 Jan  1 13:17 entertainment
vince@workstation-Mint20:~$ ls -l /mnt/entertainment
ls: reading directory '/mnt/entertainment': Input/output error
total 0


I notice that entertainment directory is owned by nobody:<random numbers group>, which I'm thinking is related to this I/O error.

What I've done to troubleshoot:
- verified that uid:gid match on both the NAS and my client. (not sure why they need to but saw that somewhere on the net)
- edited NAS dataset Entertainment Media permissions to allow myself full control, and group Family traverse permissions.
- added a NFS share for the parent folder Family Media and Data. Not sure it was necessary, but tried it.

I've tweaked everything that seemed like obvious places to look/try on the NAS, nothing seems to work.
I saw some stuff about "/etc/export" files in discussion forums on the web but frankly the discussion was over my head, looked like a next level of expertise, and/or required a more step by step guide - not something I wanted to start trying/fiddling with blindly.

I thought this was going to be relatively easy to get working but already this is starting to look like a lot of fiddling and my hope is fading. Am I missing something simple, or should I give up now? Is this accessible to someone who is a mere acolyte and not a Linux networking guru? I haven't got time for lots of fiddling and steep learning curves anymore. ...obviously I've done web searches (and this forum) but have been at this for a few hours now and decided to ask for help.

I tried to provide minimum info I thought necessary for others to help, let me know if there's more info I should provide.
(is there a shell command to easily grab basic system info like "inxi" in Mint?)
 

strangeintp

Cadet
Joined
Jan 1, 2021
Messages
7
Ok, I just went into Services>NFS Configure and also checked "NFSv3 ownership model for NFSv4" and remounted, and at least now it's showing "vince:vince" as user:group owner, but it's still giving the "input/output" error when I try to ls or copy a file in.
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
@strangeintp A NFS share seems the natural choice for a linux client, but there are pitfalls. You've actually listed the TrueNAS mount points of the datasets you've setup. To be clear it would useful to post the output of these commands at the TrueNAS shell: (a) zpool status and (b) zfs list. Alternatively a screen grab of the "Storage/Pools" page of the webui.

If you've not transferred any data to your NAS yet, it might be easier to delete some datasets rather than trying to unpick some of those changes to dataset permissions you've made.

It looks like your Pool is named "Family Media and Data". Names without spaces are easier to use and most people find it useful to choose a name that includes the word "pool", such as "FamilyPool", when you create your pool. Doing so will remind you not to try to share or change the default permission set on the pool which can cause problems. You can then concentrate on the properties on datasets like "Entertainment" and "Private" and how they are shared.

If you use NFS, I'd suggest sticking to NFSv3. For a NFS share, you must pick "generic" as the share type when you create the dataset.

It might seem not the obvious choice, but using SMB shares might be a better choice, even in linux. For a SMB, you should pick "smb" as the share type when you create the dataset.
 

strangeintp

Cadet
Joined
Jan 1, 2021
Messages
7
@KrisBee Thank you for responding - sometimes just getting any response at all helps lower the frustration level.

Re: NFSv, I initially left it on the default, but I wasn't able to mount the NFS. It mounted after I enabled NFSv4. I did pick generic as the share type. My intention was to use generic+NFS for the "entertainment" data set, with media served to HTPC by PLEX (which only I need permissions to for administering and setting up the HTPC), and SMB for the "Private" data, which I'm expecting other family members to access directly (some access will be from Windows). I'm happy to use SMB for the entertainment media if the other tools/plugins will work seamlessly with it.

I have not moved any data to the pool yet (because I have not been able to access it at client machine), so I don't mind deleting/re-creating and can play around with it to get it right.

Result of zpool status:
Code:
root@truenas[~]# zpool status
  pool: Family Media and Data
 state: ONLINE
config:

        NAME                                            STATE     READ WRITE CKSUM
        Family Media and Data                      ONLINE       0     0 0
          raidz2-0                                      ONLINE       0     0 0
            gptid/5e537e00-4c5b-11eb-acb3-54bef73984e3  ONLINE       0     0 0
            gptid/5f03f3c3-4c5b-11eb-acb3-54bef73984e3  ONLINE       0     0 0
            gptid/5eeca30a-4c5b-11eb-acb3-54bef73984e3  ONLINE       0     0 0
            gptid/5f532855-4c5b-11eb-acb3-54bef73984e3  ONLINE       0     0 0
            gptid/5fdf77e7-4c5b-11eb-acb3-54bef73984e3  ONLINE       0     0 0

errors: No known data errors

  pool: boot-pool
 state: ONLINE
config:
[I can't seem to copy and paste the rest of this result in]


<sigh> It won't even let me copy and paste correctly, it's like it won't clear the copy/paste buffer. No matter what I highlight and <ctrl><Ins>, it keeps pasting this:
Code:
  pool: boot-pool
 state: ONLINE
config:

        NAME        STATE     READ WRITE CKSUM

Is this a bug with the webgui or something inherent to freeBSD? Or maybe it's a problem on my client OS because I just tried copying from a webgui using a different browser and it's pasting the same thing as above.

Result of zfs list:
Code:
      
        boot-pool   ONLINE       0     0     0
          ada5p2    ONLINE       0     0     0

errors: No known data errors
root@truenas[~]# zfs list
NAME                                                                          USED  AVAIL     REFER  MOUNTPOINT
Family Media and Data                                                   21.5M  5.20T      185K  /mnt/Family Media and Data
Family Media and Data/.system                                           17.4M  5.20T      199K  legacy
Family Media and Data/.system/configs-17a88b624aa64e01b68939563b5fcb8c   277K  5.20T      277K  legacy
Family Media and Data/.system/cores                                      170K  1024M      170K  legacy
Family Media and Data/.system/rrd-17a88b624aa64e01b68939563b5fcb8c      15.7M  5.20T     15.7M  legacy
Family Media and Data/.system/samba4                                     440K  5.20T      440K  legacy
Family Media and Data/.system/services                                   170K  5.20T      170K  legacy
Family Media and Data/.system/syslog-17a88b624aa64e01b68939563b5fcb8c    348K  5.20T      348K  legacy
Family Media and Data/.system/webui                                      170K  5.20T      170K  legacy
Family Media and Data/Entertainment Media                                170K  5.20T      170K  /mnt/Family Media and Data/Entertainment Media
Family Media and Data/Family Private                                327K  5.20T      327K  /mnt/Family Media and Data/Family Private
boot-pool                                                                    1.06G  97.8G       24K  none
boot-pool/ROOT     
      


.... well that's weird, it appended the end of the results of my previous copy and paste into this one. I don't know what's going on.

Anyways, I note that my parent data set Family Media and Data is READ/WRITE 0/0. Is that my issue, and if so how do I fix?
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
Your original mount error looks to be a combo of using NFSv4 without configuring idmapping on the Mint client - hence the strange "nobody 4294967294" in the dir/file listing - and sharing the wrong path when creating the NFSv4 share. ( See this post for a similar error: https://www.truenas.com/community/t...r-when-accessing-nfs-share.63852/#post-520735 )

Hence, I'd say stick with NFSv3 for simplicity. I'd still advise re-considering you naming scheme and avoid using spaces in names. Share datasets not your pool. (Technically although a dataset, what you've called the "parent data set" is far better thought of as your main pool and named as such. ) For example:

Code:
root@freenas[~]# zfs list | grep Npool
Npool                                                   25.2G  66.8G    96K  /mnt/Npool
Npool/.system                                           12.5M  66.8G    96K  legacy
Npool/.system/configs-ae1f6b9a44d94d15a639a40c1e91b328    88K  66.8G    88K  legacy
Npool/.system/cores                                      568K  66.8G   568K  legacy
Npool/.system/rrd-ae1f6b9a44d94d15a639a40c1e91b328      7.91M  66.8G  7.91M  legacy
Npool/.system/samba4                                     420K  66.8G   216K  legacy
Npool/.system/syslog-ae1f6b9a44d94d15a639a40c1e91b328   3.33M  66.8G  3.33M  legacy
Npool/.system/webui                                       88K  66.8G    88K  legacy
Npool/VM                                                19.8G  66.8G    88K  /mnt/Npool/VM
Npool/VM/deb10test-e1c4j                                10.2G  74.7G  2.27G  -
Npool/VM/deb10vm-5pw8ld                                 9.69G  74.9G  1.58G  -
Npool/home                                               370M  66.8G    88K  /mnt/Npool/home
Npool/home/chris                                         370M  66.8G   370M  /mnt/Npool/home/chris
Npool/iocage                                            4.96G  66.8G  7.77M  /mnt/Npool/iocage
Npool/iocage/download                                    592M  66.8G    88K  /mnt/Npool/iocage/download
Npool/iocage/download/11.3-RELEASE                       287M  66.8G   287M  /mnt/Npool/iocage/download/11.3-RELEASE
Npool/iocage/download/11.4-RELEASE                       305M  66.8G   305M  /mnt/Npool/iocage/download/11.4-RELEASE
Npool/iocage/images                                      753M  66.8G   753M  /mnt/Npool/iocage/images
Npool/iocage/jails                                      1.37G  66.8G    88K  /mnt/Npool/iocage/jails
Npool/iocage/jails/LMS2                                 1.37G  66.8G    96K  /mnt/Npool/iocage/jails/LMS2
Npool/iocage/jails/LMS2/root                            1.37G  66.8G  1.36G  /mnt/Npool/iocage/jails/LMS2/root
Npool/iocage/log                                          92K  66.8G    92K  /mnt/Npool/iocage/log
Npool/iocage/releases                                   2.27G  66.8G    88K  /mnt/Npool/iocage/releases
Npool/iocage/releases/11.3-RELEASE                      1.08G  66.8G    88K  /mnt/Npool/iocage/releases/11.3-RELEASE
Npool/iocage/releases/11.3-RELEASE/root                 1.08G  66.8G  1.08G  /mnt/Npool/iocage/releases/11.3-RELEASE/root
Npool/iocage/releases/11.4-RELEASE                      1.19G  66.8G    88K  /mnt/Npool/iocage/releases/11.4-RELEASE
Npool/iocage/releases/11.4-RELEASE/root                 1.19G  66.8G  1.19G  /mnt/Npool/iocage/releases/11.4-RELEASE/root
Npool/iocage/templates                                    88K  66.8G    88K  /mnt/Npool/iocage/templates
Npool/mdata                                               88K  66.8G    88K  /mnt/Npool/mdata
Npool/parent                                             264K  66.8G    88K  /mnt/Npool/parent
Npool/parent/child1                                       88K  66.8G    88K  /mnt/Npool/parent/child1
Npool/parent/child2                                       88K  66.8G    88K  /mnt/Npool/parent/child2
root@freenas[~]# 


In your case, deleting and re-creating your pool and then creating new datasets will allow you to start afresh.

For a NFSv3 share, just use the default NFS service settings. Create dataset with share type "generic". Edit the dataset permissons to set user/group to the appropriate TrueNAS account ( add a Truenas account with uid/gid that matches your linux client account as necessary), set access mode as wanted, and save.

Add a NFSv3 share with the path of the data set ( my FreeNAS version doesn't allow spaces in names) Use advanced mode to enter the "authorized network" and decide if you want to maproot user/group or mapall to the user/group of the dataset owner. After saving the NFS share config, you can check the export with cat /etc/exports at the TrueNAS shell.

In this example I've shared the Npool/parent dataset:

Code:
root@freenas[~]# cat /etc/exports
/mnt/Npool/parent -alldirs -maproot="root":"wheel" -network 192.168.0.0/24
root@freenas[~]#
 

strangeintp

Cadet
Joined
Jan 1, 2021
Messages
7
@KrisBee thanks. I think I followed most of that... In your example "Npool" is just the initial dataset you created for your pool, which you're saying is really just a handle for the pool itself - did I follow that correctly? So if I do something similar, I create "FamilyPool" as the initial dataset/handle for the pool, and really don't ever do anything with it except create and manage children to it. This is effectively what I did the first time around... I only ever created a NFS share for it as a troubleshooting step for accessing the "Entertainment" child.

However, you lost me at "Use advanced mode to enter the "authorized network" and decide if you want to maproot user/group or mapall to the user/group of the dataset owner." Not sure what the advanced mode is (you mean under "system" in the webgui?) or how to enter the "authorized network". As far as mapall/maproot, the docs don't really explain much more than the tooltips, which *seem* self-explanatory enough, but not sure why or if I need to? Effectively, I'll be the only one ever accessing this [NFS] dataset - even for the HTPC, it will be my account logged in. Should I then just "chown" the dataset and maproot/mapall to my user:group?

In the meantime, I'll wipe my pool/datasets and start over following your guidance (to the best I understand it).
 

strangeintp

Cadet
Joined
Jan 1, 2021
Messages
7
Ah just realized I'd forgotten all the steps I'd taken initially. At pool creation, I must have called it "Family Media and Data"... that was not a separate dataset that I created.
 

strangeintp

Cadet
Joined
Jan 1, 2021
Messages
7
Eh I also just realized what you meant by "advanced mode"... just the advanced options when creating the NFS share, which is where the maproot/mapall options are. Still not sure I need them? I'm going to leave them alone for now and see how it works out.
 

strangeintp

Cadet
Joined
Jan 1, 2021
Messages
7
@KrisBee it seems to be working now. I am not sure where I failed in my initial setup... probably it was due to some confusion around the pool/"root dataset". I copied a test text file into the mounted nfs and verified in the shell that it showed up. Thanks for your help.
 
Top