[SOLVED] Basic setup for simple Home-Server (where to store the data)

Still no luck. At this moment I am even too annoyed to just give up. Let me walk you through the process, hopefully it helps me and others.

Setup is a server with two hard-disk (/dev/sda /dev/sdb) and a network interface eth0 connected to a router. Commands are kept short. On a real system further tuning might be necessary (e.g. set right -ashift for ZFS)

First steps on the host (Proxmox):
  1. Install Proxmox (V4.4) on a Server (/dev/sda is used here for the host system). Apply all updates.
  2. Install packages for nfs
  3. Add dummy entry to /etc/export to get the nfs-system running at start-up

  4. reboot
  5. Create ZFS system:

  6. Enable nfs-sharing to the 192.168.200.0 net for one of the file-systems

  7. Add a group for nfs and assign a zfs-filesystem to that group with rw-Rights
Guest creation and set-up (Ubuntu-Desktop 16.04):
Network device eth0 bridged to vmbr0 to connect to the internet
  1. Still on the proxmox node add a "Linux Bridge" (vmbr100) and assign 192.168.200.1 to it
  2. Create a VM and add a second "network device" with bridge=vmbr100
  3. Install Ubuntu and update
  4. Install packages for nfs
  5. Apply IP 192.168.200.2 to the network card bridget to vmbr100. The first one will get an IP from the router from a different sub-net.
  6. Add the same group with same gid and assign group to user
  7. reboot
  8. create mount points for the nfs-share
  9. Add entry to /etc/fstab
  10. reboot
After this I am still not able to create and files or folder is the /srv/tank/test folder. If I create a test file from within proxmox, I can see and open it, but cannot change anything. What did I miss?

On the host:
Code:
root@pve:~# ls -n /tank/
total 2
drwxr-xr-x 2 0    0 2 Jan  7 17:31 one
drwxrwxr-x 2 0 1300 2 Jan  7 17:31 test
drwxr-xr-x 2 0    0 2 Jan  7 17:31 two

On the guest:

Code:
ich@heimserver:~$ id
[...] 1300(nfs-share)

ich@heimserver:~$ ls -n /srv/tank/
insgesamt 1
drwxrwxr-x 2 0 1300 3 Jan  7 17:47 test

Trying to create a file does result in an error:

Code:
ich@heimserver:~$ touch /srv/tank/test/testfile.txt
touch: '/srv/tank/test/testfile.txt' kann nicht berührt werden: Keine Berechtigung


View attachment 4592

View attachment 4593
As written before:
On linux mount share with mount option noacl.
In ZFS add these acl options to the dataset:
zfs set aclmode=passthrough dataset
zfs set aclinherit=passthrough-x dataset
 
Make sure your mountpoint also has g+rw .

btw.

acltype=noacl | posixacl

Controls whether ACLs are enabled and if so what type of ACL to use. When a file system has the acltype property set to noacl (the default) then ACLs are disabled. Setting the
acltype property to posixacl indicates Posix ACLs should be used. Posix ACLs are specific to Linux and are not functional on other platforms. Posix ACLs are stored as an xattr and
therefore will not overwrite any existing ZFS/NFSv4 ACLs which may be set. Currently only posixacls are supported on Linux.

To obtain the best performance when setting posixacl users are strongly encouraged to set the xattr=sa property. This will result in the Posix ACL being stored more efficiently on
disk. But as a consequence of this all new xattrs will only be accessible from ZFS implementations which support the xattr=sa property. See the xattr property for more details.

I'm pretty sure this is not an ACL problem...
 
Last edited:
As written before:
On linux mount share with mount option noacl.
So that would mean:
192.168.200.1:/tank/test /srv/tank/test nfs rw,noacl 0 0


zfs set aclmode=passthrough dataset
root@pve:~# zfs set aclmode=passthrough tank/test
cannot set property for 'tank/test': invalid property 'aclmode'
aclmode is not available. acltype is available with {noacl, posixacl}


zfs set aclinherit=passthrough-x dataset
Ok, did that, but still no change in the behavior.



Make sure your mountpoint also has g+rw .

So, running before mounting the nfs-share on the guest?
sudo chmod -R g+rw /srv/tank


Any of the above still did not help me! WTF, what am I doing wrong?
 
Okay, you're not crazy :D I just copied your setup and got the exact same result!
I don't know what exactly is causing this but it's related to Ubuntu or the NFS version running on Ubuntu. It's simply ignoring the GID, it's only looking at the UID. Change the UID on both systems so they match and it works!!!

Edit:
On second thought. It's actually working as intended. Writing with UID X GID X on the guest system also translates to UID X and GID X on the host system. If UID X does not exist or is not a member of GID X you wont be able to write.

Sorry for giving you incomplete instructions earlier. UID/GID have to match on both systems.
 
Last edited:
:oops:

Awesome. That fixed it right away. I did not think of that.

  1. On the Host user with same gid ason the guest and assign to group:
    adduser --gid 1000 <localuser>
    usermod -aG nfs-share <localuser>
 
This subject will be forever actual ...
Yet I have some pve servers in function with openmediavault vm as file share/storage.
The disks for storage are passed in OMV. So there are the sotware raid defined, and I think there will be no problems with zfs.
The speed is better then I saw in a post before that is achived under nfs ...
On one machine where I had a RAID 5 defined in OMV i had a failed disk once, and I had no big problem to change it and to rebuild.
So, I think to pass disks to a VM is the best solution yet.

Sorry for recover this old post.

I'm trying to design a similar setup https://forum.proxmox.com/threads/proxmox-and-storage-option-for-a-homelab.40747/
My idea is to have ZFS created at proxmox level so data can be acceded by several VM (on a SSD out of the ZFS), as far as I can see the only solution seems to be use NFS or is there any alternative?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!