You are not logged in.

#1 2022-07-18 07:29:03

Rabid3east
Member
Registered: 2021-10-31
Posts: 37

[SOLVED] NFS mounting as read only

I'm running Scale in proxmox and prefer it over core as it offers apps if I want to quickly setup something then burn it. Everything is passed through with PCI-e card and zero issues until I want to run an NFS. My SMB runs fine but it won't allow my arch linux to rsync for backups, thus adding an NFS.

Problem, is that even with open ACL, Datasets and NFS share, it still assumes I only have read only access. I've been unable to get NFS3 working but NFS4 is fine minus the read only issue. I've tried chmod 777 and chown on the arch linux machine to the directory. I've searched high and low if this was supposed to be inside truenas terminal or on my computer?

cat /etc/exports
"/mnt/tank/exile"\
*(sec=sys,rw,anonuid=1000,anongid=1003,no_subtree_check)

# Fstab

192.168.88.156:/mnt/tank/ /mnt/seykota nfs rw,hard,timeo=900,retrans=5,_netdev 0 0


ls -l

drwxr-xr-x 5 root root 5 Jul 17 21:15 seykota

Obviously I need to have my name there rather than root:root.

Please help, I'm at a complete loss and have devoured hours searching google and forums to find the solution. Archlinux forums is the best!

Last edited by Rabid3east (2022-07-21 15:13:14)

Offline

#2 2022-07-18 12:11:34

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: [SOLVED] NFS mounting as read only

You're exporting /mnt/tank/exile but mounting /mnt/tank ?
Who does the filesystem belong to on the host ("stat /mnt/tank", assuming that's what you end up mounting) - and what if you change the ownership there?
Alternatively, look at "man exports" for all_squash

Offline

#3 2022-07-18 14:06:33

Rabid3east
Member
Registered: 2021-10-31
Posts: 37

Re: [SOLVED] NFS mounting as read only

I've changed the fstab as you've pointed out.

Truenas Shell: drwxrwxrwx+ 3 justin tribe 3 Jul 17 19:00 /mnt/tank/exile(that's the user and group i created)

The user and group uid / gid all match up perfectly as I thought the same thing. uid is 1000 and gid is 1003.

On arch linux: $ ls -l
$ drwxrwxrwx 3 justin users 3 Jul 18 09:42 seykota

It seems like it should have all been fixed. I'm now running rsync command and getting the error msg back 'rsync: [generator] chown "/mnt/seykota/backups/fullbackup/." failed: Operation not permitted (1)'

here's my command in .bashrc:
alias fullbackup='sudo rsync -av --delete --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","/fileswap/*","/home/justin/.gvfs","/home/justin/storage/*","/home/justin/.cache/*"} / /mnt/seykota/backups/fullbackup'

Offline

#4 2022-07-18 14:52:36

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: [SOLVED] NFS mounting as read only

You're trying to rsync the root directory ("/") in archive mode, ie. also preserving ownership.
But the root belongs to UID0 ("stat /") what effectively means that an unprivileged user (you) tries to create directories and files that belong to the root - and that's not gonna happen.
You'll *have* to sudo that.

… Apparently you *are* running that as root?

mount | grep "mnt/seykota"
stat /mnt/seykota/backups/fullbackup
getfacl /mnt/seykota/backups/fullbackup

Last edited by seth (2022-07-18 14:57:42)

Offline

#5 2022-07-19 04:32:39

Rabid3east
Member
Registered: 2021-10-31
Posts: 37

Re: [SOLVED] NFS mounting as read only

$ stat /mnt/seykota/
  File: /mnt/seykota/
  Size: 3             Blocks: 1          IO Block: 1048576 directory
Device: 0,47    Inode: 34          Links: 3
Access: (0777/drwxrwxrwx)  Uid: ( 1000/  justin)   Gid: ( 1003/   users)
Access: 2022-07-17 21:15:06.744000000 -0400
Modify: 2022-07-18 09:42:47.772000000 -0400
Change: 2022-07-18 10:15:22.120000000 -0400
Birth: -
[justin@fibonacci ~]$ cd /mnt/seykota/
[justin@fibonacci seykota]$ ls

similar with:
seykota]$ stat backups/
  File: backups/
  Size: 3             Blocks: 1          IO Block: 1048576 directory
Device: 0,47    Inode: 260         Links: 3
Access: (0770/drwxrwx---)  Uid: ( 1000/  justin)   Gid: ( 1003/   users)
Access: 2022-07-18 09:42:47.772000000 -0400
Modify: 2022-07-18 10:25:01.700000000 -0400
Change: 2022-07-18 10:25:01.700000000 -0400
Birth: -

Inside truenas I was able to setup root:root which created the root_squash and with rsync trying to sync files as root as well it does work. I guess now my question is. Is this viable as a single user backup that would help me migrate my setup to other machines such as a vm? I was trying to setup the no_root_squash that you suggested, but apparently truenas scale has a lot of issues/bugs around that area right now. It did allow me to setup nobody:nogroup but no_root_squash setting never appeared in /etc/exports. It didn't allow me to select nobody:nobody which apparently worked in previous versions.

$ mount | grep "mnt/seykota"
192.168.88.156:/mnt/tank/exile on /mnt/seykota type nfs4 (rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=900,retrans=5,sec=sys,clientaddr=192.168.88.249,local_lock=none,addr=192.168.88.156,_netdev)

$ stat /mnt/seykota/backups/fullbackup
  File: /mnt/seykota/backups/fullbackup
  Size: 22            Blocks: 17         IO Block: 1048576 directory
Device: 0,47    Inode: 1113        Links: 17
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2022-07-18 10:25:01.700000000 -0400
Modify: 2021-12-09 20:16:09.534058856 -0500
Change: 2022-07-18 10:28:41.024000000 -0400
Birth: -

$ getfacl /mnt/seykota/backups/fullbackup
getfacl: Removing leading '/' from absolute path names
# file: mnt/seykota/backups/fullbackup
# owner: root
# group: root
user::rwx
group::r-x
other::r-x

Offline

#6 2022-07-19 04:33:54

Rabid3east
Member
Registered: 2021-10-31
Posts: 37

Re: [SOLVED] NFS mounting as read only

Another issue I've noticed is that during a reboot. It hangs up at user login for 2+ minutes then does give a brief message 'fail...' Maybe my fstab settings are missing something

Offline

#7 2022-07-19 20:49:13

Rabid3east
Member
Registered: 2021-10-31
Posts: 37

Re: [SOLVED] NFS mounting as read only

bump

Offline

#8 2022-07-21 07:20:31

Rabid3east
Member
Registered: 2021-10-31
Posts: 37

Re: [SOLVED] NFS mounting as read only

bump

Offline

#9 2022-07-21 08:23:52

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: [SOLVED] NFS mounting as read only

Don't bump.
The last two days it was simply to fucking hot to make sense out of your text.

So let's try my luck now.

Inside truenas I was able to setup root:root which created the root_squash

I know nothing about truenas, but that doesn't really make any sense - what do you mean by "setup root:root"?

Is this viable as a single user backup that would help me migrate my setup to other machines such as a vm?

No. root_squash maps U/GID 0 to the anonymouns U/GID so the files that should™ belong to the root user now belong to the anon user in your backup.

However:
-------------

I was trying to setup the no_root_squash that you suggested

From https://bbs.archlinux.org/viewtopic.php?id=278257 it seems that you succeded on that and that hopefully the ownership of your backup gets preserved - which is the critical part

stat /mnt/seykota/backups/fullbackup/etc/shadow

As for the boot delay, see https://wiki.archlinux.org/title/NFS#Mo … th_systemd - it's not related to this problem, though.

Offline

#10 2022-07-21 15:21:06

Rabid3east
Member
Registered: 2021-10-31
Posts: 37

Re: [SOLVED] NFS mounting as read only

I did succeed on backing up as sudo rsync but I was under the impression that's not the ideal way to run rsync so took a step back from no_root_squash in the NFS share advanced option in Truenas. Mounting with system.md actually solved both the issues being unable to write to the NFS share as user and the boot delay. I have matching UID and GID with my arch machine and the Truenas users. And my fstab is pretty much identical to the arch wiki. Not sure why it didn't work the first go around, but glad to have jumped over this hurtle. Spent way too much time trying to solve it, but you've been a great help Seth. Sorry about bumping the post. I was pretty frustrated with trying different settings always having to (test) the machine and (wait out the delayed boot).

Offline

Board footer

Powered by FluxBB