SOLVED is there anyway to block going over 80% usage on zfs pool?

Status
Not open for further replies.

skimon

Dabbler
Joined
Jun 3, 2012
Messages
37
I read the ZFS primer , and forum posts, on the the dangers of going beyond 80% usage on a zpool. Previously I encountered a situation on a UFS mirror drive when a users time machine backup went insane and just kept adding to its backup until it filled most of my remaining available .

I was wondering if there is a way to absolutely prevent the a zpool from going over 80% , ie behave like disk is full at 80%? Is the way to do that by creating datasets and making sure the sum of the quotas of all datasets < 80% of zpool space ? Is that foolproof , or is there some other better way?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
using quota's on a dataset and limiting a users size to be smaller will prevent that single user from filling things up to far. But remember you have multiple datasets to deal with so you can't stop everyone from filling things up.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
Keep in mind that even if you use quotas to prevent a pool from filling more than 80% full, you'll actually have problems (like the inability to delete files) if you hit a pool that has no more disk space to write the next transaction.

The best (and in my opinion only) way to handle your pool is to actually manage it appropriately by monitoring your pool's usage.
 

skimon

Dabbler
Joined
Jun 3, 2012
Messages
37
Keep in mind that even if you use quotas to prevent a pool from filling more than 80% full, you'll actually have problems (like the inability to delete files) if you hit a pool that has no more disk space to write the next transaction.

The best (and in my opinion only) way to handle your pool is to actually manage it appropriately by monitoring your pool's usage.


Sorry I didn't follow that, could you clarify. If you create 2 datasets on a zpool each with 40% of the max zpool size, would it be possible for there to be no disk space for the next transaction if both datasets are full?

Im assuming that snapshots can still eat the zpool which cant be controlled with quotas though right?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
I'll explain it like this....

ZFS is a Copy-On-Write file system. That means that if you want to delete something, space must be used to perform the actual delete command. If no space is available in that file system, then the delete operation will fail.

I'll leave it to you to take this information and apply it to whatever given scenario you want to consider. Just keep in mind that once a file system is full it takes special actions by the admin to by-pass the basic limitation I just mentioned. ;)
 

skimon

Dabbler
Joined
Jun 3, 2012
Messages
37
I'll explain it like this....

ZFS is a Copy-On-Write file system. That means that if you want to delete something, space must be used to perform the actual delete command. If no space is available in that file system, then the delete operation will fail.

I'll leave it to you to take this information and apply it to whatever given scenario you want to consider. Just keep in mind that once a file system is full it takes special actions by the admin to by-pass the basic limitation I just mentioned. ;)

Ah. i assumed that it needs space for delete because its CoW but i didnt realize it needs space in that particular dataset which i guess makes sense. So there would be no way to delete something without first raising the quota i guess which i dont know if thats possible or not.

Ill read more on datasets

Thanks
 
L

L

Guest
The best way to do this is to create a dataset called something like reserve, then set a quota and reservation on it to 20% of the whole. Also setup notifications
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
Status
Not open for further replies.
Top