This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!



I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!

zfs set quota not reflected in windows share

Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
chris.shelton
Starter
Starter
Posts: 36
Joined: 08 May 2015 12:01
Status: Offline

zfs set quota not reflected in windows share

Post by chris.shelton »

Hi all,

I have managed to set quotas for all of my users by using the command:

zfs set userquota@username=1G pool1/data

and this quota does work because it won't let me transfer anything larger than 1GB onto the share. However, the quota does not seem to have affected the free space information on the share.

It says 14.2GB free of 14.3GB, I thought it would say something along the lines of 0.9GB free of 1.0GB.
How do I get the quota to reflect the free space on the network location once mapped?

Thanks

User avatar
b0ssman
Forum Moderator
Forum Moderator
Posts: 2438
Joined: 14 Feb 2013 08:34
Location: Munich, Germany
Status: Offline

Re: zfs set quota not reflected in windows share

Post by b0ssman »

no the default tells you how much free space the filesystem has,

if you want you will have to write your own script to report the size
and call it in samba via "dfree command =" option
Nas4Free 11.1.0.4.4517. Supermicro X10SLL-F, 16gb ECC, i3 4130, IBM M1015 with IT firmware. 4x 3tb WD Red, 4x 2TB Samsung F4, both GEOM AES 256 encrypted.

chris.shelton
Starter
Starter
Posts: 36
Joined: 08 May 2015 12:01
Status: Offline

Re: zfs set quota not reflected in windows share

Post by chris.shelton »

b0ssman wrote:no the default tells you how much free space the filesystem has,

if you want you will have to write your own script to report the size
and call it in samba via "dfree command =" option
Hmm okay thanks for the info. I'm fairly new to this so do you have an example what such a script would look like? Or do you know of any resources that could help me?

Thanks

User avatar
b0ssman
Forum Moderator
Forum Moderator
Posts: 2438
Joined: 14 Feb 2013 08:34
Location: Munich, Germany
Status: Offline

Re: zfs set quota not reflected in windows share

Post by b0ssman »

Nas4Free 11.1.0.4.4517. Supermicro X10SLL-F, 16gb ECC, i3 4130, IBM M1015 with IT firmware. 4x 3tb WD Red, 4x 2TB Samsung F4, both GEOM AES 256 encrypted.

chris.shelton
Starter
Starter
Posts: 36
Joined: 08 May 2015 12:01
Status: Offline

Re: zfs set quota not reflected in windows share

Post by chris.shelton »

Great thanks a lot. This looks to do what I am after, I will try it when back in the office tomorrow and post back the result.

Thanks again

chris.shelton
Starter
Starter
Posts: 36
Joined: 08 May 2015 12:01
Status: Offline

Re: zfs set quota not reflected in windows share

Post by chris.shelton »

Are you able to provide me with a brief explanation as to what the following is actually getting?

df $1 | tail -1 | awk '{print $2" "$4}'

Thanks, Chris.

User avatar
b0ssman
Forum Moderator
Forum Moderator
Posts: 2438
Joined: 14 Feb 2013 08:34
Location: Munich, Germany
Status: Offline

Re: zfs set quota not reflected in windows share

Post by b0ssman »

Nas4Free 11.1.0.4.4517. Supermicro X10SLL-F, 16gb ECC, i3 4130, IBM M1015 with IT firmware. 4x 3tb WD Red, 4x 2TB Samsung F4, both GEOM AES 256 encrypted.

chris.shelton
Starter
Starter
Posts: 36
Joined: 08 May 2015 12:01
Status: Offline

Re: zfs set quota not reflected in windows share

Post by chris.shelton »

Okay at the moment I have something like this:

#!/bin/bash
zfs get userquota@%U pool1/data | awk '{print $3}'

I realise this won't give me exactly what I want and I am unsure whether the %U will work here to show each individual how much they have left.
Is what I'm trying to get actually possible?

chris.shelton
Starter
Starter
Posts: 36
Joined: 08 May 2015 12:01
Status: Offline

Re: zfs set quota not reflected in windows share

Post by chris.shelton »

zfs userspace pool1/data gives me a list of exactly what I need to be displaying - USED and QUOTA. But I don't know how to display the correct figures for each user...

User avatar
b0ssman
Forum Moderator
Forum Moderator
Posts: 2438
Joined: 14 Feb 2013 08:34
Location: Munich, Germany
Status: Offline

Re: zfs set quota not reflected in windows share

Post by b0ssman »

well this is where you have to start scripting.

the command is passed an argument which contains the path that is queried.
from this path you have to somehow arrive at the username which you then have to grep this list with.
and finally convert the values to the values that samba needs.
if a share with no quota is queries then the default free size has to be returned.
Nas4Free 11.1.0.4.4517. Supermicro X10SLL-F, 16gb ECC, i3 4130, IBM M1015 with IT firmware. 4x 3tb WD Red, 4x 2TB Samsung F4, both GEOM AES 256 encrypted.

Post Reply

Return to “ZFS (only!)”