Hi,
I've set up a FreeBSD box using RootOnZFS.
I always liked the idea of having different filesystems before I used ZFS to prevent some stupid process filling up my complete harddisk by writing junk into /tmp.
With the standard configuration this seems to be possible in ZFS as all partitions are sharing the same pool so each "partition" can fill up the whole pool leaving no space to the other partitions:
Now I searched a bit on the internet and found the quota parameter for ZFS and used it:
But now, It would be still possible to write junk into my root partition and the free space would go away from the other partitions as well.
I'm not able to apply a quota of 1G to the root partition itself:
I also found out, that there is a reservation setting to just reservate the space for a partition so it could not be used by any other partition. But then the filesystem would appear as "full" in df when I wanted to reservate the size of the filesystem for the filesystem (check http://docs.huihoo.com/opensolaris/solaris-zfs-administration-guide/html/ch05s06.html)
Does a way exist to add a quota to the root filesystem as well So I would have a quota to every filesystem so that if the sum of each "avail" column of the df listing (=quota) is below the overall space of the zpool, it is guaranteed that this space is available to the partition whatever happens on another partition?!
I've set up a FreeBSD box using RootOnZFS.
I always liked the idea of having different filesystems before I used ZFS to prevent some stupid process filling up my complete harddisk by writing junk into /tmp.
With the standard configuration this seems to be possible in ZFS as all partitions are sharing the same pool so each "partition" can fill up the whole pool leaving no space to the other partitions:
Code:
nudel# df -h
Filesystem Size Used Avail Capacity Mounted on
zroot 904G 332M 903G 0% /
devfs 1.0k 1.0k 0B 100% /dev
zroot/tmp 903G 36k 903G 0% /tmp
zroot/usr 904G 1G 903G 0% /usr
zroot/usr/ports 904G 717M 903G 0% /usr/ports
zroot/var 903G 370k 903G 0% /var
/dev/ufs/files 2.7T 576G 1.9T 23% /mnt/files
Now I searched a bit on the internet and found the quota parameter for ZFS and used it:
Code:
nudel# zfs set quota=512M zroot/tmp
nudel# zfs set quota=512M zroot/var
nudel# zfs set quota=20G zroot/usr/ports
nudel# zfs set quota=200G zroot/usr
dnudel# df -h
Filesystem Size Used Avail Capacity Mounted on
zroot 904G 332M 903G 0% /
devfs 1.0k 1.0k 0B 100% /dev
zroot/tmp 512M 70k 512M 0% /tmp
zroot/usr 199G 1G 198G 0% /usr
zroot/usr/ports 20G 717M 19G 4% /usr/ports
zroot/var 512M 450k 511M 0% /var
/dev/ufs/files 2.7T 576G 1.9T 23% /mnt/files
But now, It would be still possible to write junk into my root partition and the free space would go away from the other partitions as well.
I'm not able to apply a quota of 1G to the root partition itself:
Code:
nudel# zfs set quota=1G zroot
cannot set property for 'zroot': size is less than current used or reserved space
I also found out, that there is a reservation setting to just reservate the space for a partition so it could not be used by any other partition. But then the filesystem would appear as "full" in df when I wanted to reservate the size of the filesystem for the filesystem (check http://docs.huihoo.com/opensolaris/solaris-zfs-administration-guide/html/ch05s06.html)
Does a way exist to add a quota to the root filesystem as well So I would have a quota to every filesystem so that if the sum of each "avail" column of the df listing (=quota) is below the overall space of the zpool, it is guaranteed that this space is available to the partition whatever happens on another partition?!