You are not logged in.

#1 2014-12-17 13:37:22

mouseman
Member
From: Outta nowhere
Registered: 2014-04-04
Posts: 291

All files and dirs owned by root on NFS share

I shared a directory from my PC for the laptop to use. I followed the wiki and in the past this has always worked without issues. I had to reinstall the laptop. However, this time around all dirs on the mounted share shows as owned by root:root, while in reality they are owned by my own account. I'm logged in as myself, I made sure UID and GID match on both pc's. I've set domain in /etc/idmapd.conf. Services have been enabled and started as per the wiki. The share mounts and shows the first level of dirs but all owned by root. When I enter one of the dirs, no files are shown.

The dir is shared with the following options in /etc/exportfs: 192.168.1.0/24(rw,async,no_root_squash,no_subtree_check).

What am I doing wrong?

Thanks!

Offline

#2 2014-12-17 14:06:27

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,416

Re: All files and dirs owned by root on NFS share

How you mount it matters, as well as the no_root_squash may also be of interest.  Possibly using uid and gid in your options of mounting and/or exports may correct the situation.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#3 2014-12-17 15:00:07

mouseman
Member
From: Outta nowhere
Registered: 2014-04-04
Posts: 291

Re: All files and dirs owned by root on NFS share

Thanks, but I don't think those are the solutions I am looking for.

I am using no_root_squash because I want to be able to access the share using root account. But I am not doing that now, I am accessing the share with the same account as the owner of the files that I am listing.

When UID and GID matches between server and workstation, I simply need to see the correct user and groupnames when I list the contents of a share. I understand I can override that using mount or exports options but that's not what I want to do.

Offline

#4 2014-12-17 15:11:42

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,416

Re: All files and dirs owned by root on NFS share

You might try sshfs, but it gets really technical on who mounted it.  Root can't run through it, if it is mounted by some other user.  You can still mount multiple instances of it.

Last edited by nomorewindows (2014-12-17 15:12:28)


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#5 2014-12-17 15:44:04

mouseman
Member
From: Outta nowhere
Registered: 2014-04-04
Posts: 291

Re: All files and dirs owned by root on NFS share

I've always used NFS and it has always worked correctly until I had to reinstall the laptop. I rather solve that instead of using other options.

Thanks for suggesting it though.

Offline

#6 2014-12-21 13:15:18

Painless
Member
Registered: 2006-02-06
Posts: 234

Re: All files and dirs owned by root on NFS share

Hi,

I have a few thoughts/suggestions:

  1. First thing that springs to mind is a config problem with idmapd.  Please recheck client and server.

  2. That is a typo in your first post where you mention /etc/exportfs instead of /etc/exports, isn't it?

  3. Please try using the nohide for your share in /etc/exports.

Regards,

Rob

Offline

#7 2014-12-21 13:44:40

mouseman
Member
From: Outta nowhere
Registered: 2014-04-04
Posts: 291

Re: All files and dirs owned by root on NFS share

Thanks Rob, appreciate the help.

1. I double checked, idmapd.conf is correct. I checked hosts file too, resolv.conf, everywhere the domain is setup identically. I can ping FQDN's from both.

2. That is indeed a typo. if it werent I wouldn't be able to mount it smile. Sharp eye though wink.

3. I added nohide, did an exportfs and it printed the share. Looks fine.

No game though, its still showing all dirs and files owned by root.

This is driving me nuts.

I resorted to Samba (was already setup on the server for HTPC running Windows) but I still rather use NFS on the clients.

Thanks!

Offline

#8 2014-12-21 14:27:09

Painless
Member
Registered: 2006-02-06
Posts: 234

Re: All files and dirs owned by root on NFS share

Hi,

Just out of interest, what is the entry for the share in /etc/mtab?

Rob

Offline

#9 2014-12-21 14:39:14

mouseman
Member
From: Outta nowhere
Registered: 2014-04-04
Posts: 291

Re: All files and dirs owned by root on NFS share

I asume on the client where I mount the share ...

server:/mnt/Data /mnt/Data nfs4 rw,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.155,local_lock=none,addr=192.168.1.241 0 0

Offline

#10 2014-12-21 15:49:27

Painless
Member
Registered: 2006-02-06
Posts: 234

Re: All files and dirs owned by root on NFS share

Hi,

It's not something to do with ownership of the /mnt/Data mountpoint is it?

Rob

Offline

#11 2014-12-21 16:26:49

mouseman
Member
From: Outta nowhere
Registered: 2014-04-04
Posts: 291

Re: All files and dirs owned by root on NFS share

Permissions are good but I did change something. /mnt and /mnt/Data on the server were owned by group users. I changed it to my own group. I restarted nfs-server and remounted the share. It is now only showing 1 subdir (?) but at least its showing the correct ownership.

I know I am late mentioning this (sorry) ... the share is a ZFS volume, the subdirs are ZFS subvolumes. I'm not using ZFS to share them though, I made sure ZFS sharing is turned off.

Offline

Board footer

Powered by FluxBB