You are not logged in.

#1 2013-10-28 17:03:15

wdirksen
Member
From: New Zealand
Registered: 2012-02-23
Posts: 105

Setting up quota on ZFS raidz system [SOLVED]

Hi Archers,

I've tried to google this one but I'm coming up empty. I recently setup a ZFS raidz pool with 6 drives and so far happy and working fine:

[root@server server]# zpool status
  pool: storage
 state: ONLINE
  scan: scrub repaired 43.5M in 17h40m with 0 errors on Thu Oct 24 18:18:55 2013
config:

	NAME        STATE     READ WRITE CKSUM
	storage     ONLINE       0     0     0
	  raidz1-0  ONLINE       0     0     0
	    sda1    ONLINE       0     0     0
	    sdb     ONLINE       0     0     0
	    sdc     ONLINE       0     0     0
	    sdd     ONLINE       0     0     0
	    sde     ONLINE       0     0     0
	    sdf     ONLINE       0     0     0

errors: No known data errors

The pool "storage" is mounted on /media/storage

Enter mythtv which offers no internal method to limit the amount of disk space it will use except with physical drive capacity limits or setting a quota for the recordings directory.
I ran accross a few ZFS sites which explain the quota function built into ZFS. It is supposed to allow a quota on directories within the raidz array. Alas, I get the following:

root@server server]# zfs set quota=3T storage/recordings
cannot open 'storage/recordings': dataset does not exist

and

root@server server]# zfs set quota=3T storage/media/storage/recordings
cannot open 'storage/media/storage/recordings': dataset does not exist

I have been relying mostly on this site:
http://www.tech-recipes.com/rx/1404/zfs … tem-quota/

So my question would be: Does anyone know how to make this work?
Otherwise there is a generic linux quota that uses fstab but I'm not sure if that will work on a directory in a ZFS pool. Also fstab is not used to mount a ZFS pool.

Thank-you!

Last edited by wdirksen (2013-11-07 14:35:07)


Research | Trial | Make Mistakes | Ask questions | Learn | Repeat

Offline

#2 2013-10-28 19:30:17

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Setting up quota on ZFS raidz system [SOLVED]

Seems like you haven't defined a dataset in the pool, but rather a directory in the pool.  There is a difference.

 # zfs create storage/recordings

Now you can apply a quota to it (I think).

Last edited by graysky (2013-10-28 19:33:15)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2013-10-29 06:18:11

wdirksen
Member
From: New Zealand
Registered: 2012-02-23
Posts: 105

Re: Setting up quota on ZFS raidz system [SOLVED]

Thanks Graysky. It accepts the quota command now. I'm assuming the 3T quota will work now.
I'm wondering if the ArchWiki for ZFS should discuss this dataset thing.

EDIT: After a reboot, the ZFS will no longer mount.

[server@server ~]$ sudo systemctl status zfs.service
zfs.service - Zettabyte File System (ZFS)
   Loaded: loaded (/etc/systemd/system/zfs.service; enabled)
   Active: failed (Result: exit-code) since Tue 2013-10-29 08:38:34 CET; 8min ago
     Docs: man:zfs(8)
           man:zpool(8)
  Process: 9764 ExecStart=/usr/bin/zfs mount -a (code=exited, status=1/FAILURE)
  Process: 9761 ExecStart=/usr/bin/zpool import -c /etc/zfs/zpool.cache -aN (code=exited, status=0/SUCCESS)
  Process: 9759 ExecStart=/sbin/modprobe zfs (code=exited, status=0/SUCCESS)
 Main PID: 9764 (code=exited, status=1/FAILURE)

Oct 29 08:38:33 server zpool[9761]: no pools available to import
Oct 29 08:38:34 server zfs[9764]: cannot mount '/media/storage/music': directory is not empty
Oct 29 08:38:34 server zfs[9764]: cannot mount '/media/storage/pictures': directory is not empty
Oct 29 08:38:34 server zfs[9764]: cannot mount '/media/storage/recordings': directory is not empty
Oct 29 08:38:34 server zfs[9764]: cannot mount '/media/storage/unshared': directory is not empty
Oct 29 08:38:34 server zfs[9764]: cannot mount '/media/storage/users': directory is not empty
Oct 29 08:38:34 server zfs[9764]: cannot mount '/media/storage/videos': directory is not empty
Oct 29 08:38:34 server systemd[1]: zfs.service: main process exited, code=exited, status=1/FAILURE
Oct 29 08:38:34 server systemd[1]: Failed to start Zettabyte File System (ZFS).
Oct 29 08:38:34 server systemd[1]: Unit zfs.service entered failed state.

Last edited by wdirksen (2013-10-29 07:58:05)


Research | Trial | Make Mistakes | Ask questions | Learn | Repeat

Offline

#4 2013-10-29 08:59:47

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Setting up quota on ZFS raidz system [SOLVED]

I take it you made the 6 datasets in the error log?  Not sure why that would cause it to not boot or for there to be no zpools... Is the output of 'pool stauts' that same?  I assume you did not destroy the main zpool with the corresponding command.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2013-10-29 10:31:37

wdirksen
Member
From: New Zealand
Registered: 2012-02-23
Posts: 105

Re: Setting up quota on ZFS raidz system [SOLVED]

The pooled array is back online by running: (a bit scary hitting the Enter key)

zfs destroy storage/recordings

I'll keep looking on this as your advice did in theory work. I have something to go on now.


Research | Trial | Make Mistakes | Ask questions | Learn | Repeat

Offline

#6 2013-10-29 13:30:12

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Setting up quota on ZFS raidz system [SOLVED]

I do not understand why that brought your pool back online.  The overall process is:

1) make a pool.
2) make individual spdatasets if you want to apply snapshots, quotas, etc to them.
3) optional depending on if your have data in the pool, but not in the datasets: move the data into the data sets.

I do not understand when you rebooted and were unable to mount the pool.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#7 2013-10-29 16:12:39

wdirksen
Member
From: New Zealand
Registered: 2012-02-23
Posts: 105

Re: Setting up quota on ZFS raidz system [SOLVED]

Grayski,
Could it be that it went wrong with your #3 comment. I never transferred anything after making the datasets. The datasets I created were based on the folders which were pre-existant and non-empty as they were filled after the zpool was created following the ArchWiki. After the reboot (with datasets created) the folders were there but they were empty.


Research | Trial | Make Mistakes | Ask questions | Learn | Repeat

Offline

#8 2013-10-29 18:55:42

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Setting up quota on ZFS raidz system [SOLVED]

You never want to create a dataset named the same as an existing folder on the zpool... rename the existing folder to something else, create the dataset, then rsync or mv the contents in the renamed folder to the new dataset.  Did you lose any data in the process?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#9 2013-10-29 19:16:26

wdirksen
Member
From: New Zealand
Registered: 2012-02-23
Posts: 105

Re: Setting up quota on ZFS raidz system [SOLVED]

No data was lost but it would have been a true disaster to lose the data. Thanks for the input. I'll give it a try but will also do some research beforehand.
Do you think the ZFS Archwiki is adequate? It mentions nothing about datasets etc.


Research | Trial | Make Mistakes | Ask questions | Learn | Repeat

Offline

#10 2013-10-29 20:02:29

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Setting up quota on ZFS raidz system [SOLVED]

That's the beauty of the wiki, anyone can contribute.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#11 2013-11-07 14:34:41

wdirksen
Member
From: New Zealand
Registered: 2012-02-23
Posts: 105

Re: Setting up quota on ZFS raidz system [SOLVED]

Thanks for helping with this Graysky. It is solved.

I have added a segment over creating datasets and setting attributes to datasets to the ZFS Arch-wiki. I wouldn't want this to happen to someone else.


Research | Trial | Make Mistakes | Ask questions | Learn | Repeat

Offline

Board footer

Powered by FluxBB