zfs quota question - FreeBSD

This is a discussion on zfs quota question - FreeBSD ; I create a zfs volume pool/lhm and give it quota 1M use "zfs set quota=1m pool/lhm" #zfs get all pool/lhm zfs get all pool/lhm [ttyp0][5:22:12pm] NAME PROPERTY VALUE SOURCE pool/lhm type filesystem - pool/lhm creation Tue Oct 7 17:14 2008 ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: zfs quota question

  1. zfs quota question

    I create a zfs volume pool/lhm and give it quota 1M use "zfs set
    quota=1m pool/lhm"

    #zfs get all pool/lhm
    zfs get all pool/lhm
    [ttyp0][5:22:12pm]
    NAME PROPERTY VALUE SOURCE
    pool/lhm type filesystem -
    pool/lhm creation Tue Oct 7 17:14 2008 -
    pool/lhm used 1.00M -
    pool/lhm available 0 -
    pool/lhm referenced 1.00M -
    pool/lhm compressratio 7.25x -
    pool/lhm mounted yes -
    pool/lhm quota 1M local
    pool/lhm reservation none default
    pool/lhm recordsize 128K default

    But I cp 10 files,per file size is 2.4M to pool/lhm
    #ll -h /pool/lhm
    total 1013
    -rw------- 1 root wheel 2.4M Oct 7 17:18 d
    -rw------- 1 root wheel 2.4M Oct 7 17:19 dd
    -rw------- 1 root wheel 2.4M Oct 7 17:19 ddd
    -rw------- 1 root wheel 2.4M Oct 7 17:19 dddd
    -rw------- 1 root wheel 2.4M Oct 7 17:19 ddddd
    -rw------- 1 root wheel 2.4M Oct 7 17:19 dddddd
    -rw------- 1 root wheel 2.4M Oct 7 17:19 dddddd2
    -rw------- 1 root wheel 2.4M Oct 7 17:19 dddddd24
    -rw------- 1 root wheel 2.1M Oct 7 17:19 dddddd247
    -rw------- 1 root wheel 2.4M Oct 7 17:18 kldstat.core

    #du -hs /pool/lhm
    1.0M .

    I am puzzled,the what's zfs quota mean?
    I understand is file quota,that can't put files which total size larger than 1M.
    But it seems my understanding is wrong.
    Anybody give a idea?
    _______________________________________________
    freebsd-stable@freebsd.org mailing list
    http://lists.freebsd.org/mailman/lis...freebsd-stable
    To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"


  2. Re: zfs quota question

    My system
    #uname -a
    FreeBSD bxzxfreebsd.slof.com 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #4:
    Mon Oct 6 15:02:42 CST 2008
    root@bxzxfreebsd.slof.com:/usr/obj/usr/src/sys/lhmwzy amd64

    zfs version:
    ZFS filesystem version 6
    ZFS storage pool version 6
    _______________________________________________
    freebsd-stable@freebsd.org mailing list
    http://lists.freebsd.org/mailman/lis...freebsd-stable
    To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"


  3. Re: zfs quota question

    On Tue, Oct 07, 2008 at 05:32:43PM +0800, lhmwzy wrote:
    > I create a zfs volume pool/lhm and give it quota 1M use "zfs set
    > quota=1m pool/lhm"
    >
    > #zfs get all pool/lhm
    > zfs get all pool/lhm
    > [ttyp0][5:22:12pm]
    > NAME PROPERTY VALUE SOURCE
    > pool/lhm type filesystem -
    > pool/lhm creation Tue Oct 7 17:14 2008 -
    > pool/lhm used 1.00M -
    > pool/lhm available 0 -
    > pool/lhm referenced 1.00M -
    > pool/lhm compressratio 7.25x -
    > pool/lhm mounted yes -
    > pool/lhm quota 1M local
    > pool/lhm reservation none default
    > pool/lhm recordsize 128K default
    >
    > But I cp 10 files,per file size is 2.4M to pool/lhm
    > #ll -h /pool/lhm
    > total 1013
    > -rw------- 1 root wheel 2.4M Oct 7 17:18 d
    > -rw------- 1 root wheel 2.4M Oct 7 17:19 dd
    > -rw------- 1 root wheel 2.4M Oct 7 17:19 ddd
    > -rw------- 1 root wheel 2.4M Oct 7 17:19 dddd
    > -rw------- 1 root wheel 2.4M Oct 7 17:19 ddddd
    > -rw------- 1 root wheel 2.4M Oct 7 17:19 dddddd
    > -rw------- 1 root wheel 2.4M Oct 7 17:19 dddddd2
    > -rw------- 1 root wheel 2.4M Oct 7 17:19 dddddd24
    > -rw------- 1 root wheel 2.1M Oct 7 17:19 dddddd247
    > -rw------- 1 root wheel 2.4M Oct 7 17:18 kldstat.core
    >
    > #du -hs /pool/lhm
    > 1.0M .
    >
    > I am puzzled,the what's zfs quota mean?
    > I understand is file quota,that can't put files which total size larger than 1M.
    > But it seems my understanding is wrong.
    > Anybody give a idea?


    I can confirm and reproduce what you're seeing.

    Based on all of the ZFS documentation and examples I've read, it appears
    to be a bug in FreeBSD ZFS.

    CC'ing pjd@, who maintains ZFS on FreeBSD.

    --
    | Jeremy Chadwick jdc at parodius.com |
    | Parodius Networking http://www.parodius.com/ |
    | UNIX Systems Administrator Mountain View, CA, USA |
    | Making life hard for others since 1977. PGP: 4BD6C0CB |

    _______________________________________________
    freebsd-stable@freebsd.org mailing list
    http://lists.freebsd.org/mailman/lis...freebsd-stable
    To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"


  4. Re: zfs quota question

    On Tue, Oct 07, 2008 at 12:07:26PM +0200, Holger Kipp wrote:
    > On Tue, Oct 07, 2008 at 02:54:37AM -0700, Jeremy Chadwick wrote:
    > > On Tue, Oct 07, 2008 at 05:32:43PM +0800, lhmwzy wrote:
    > > > I create a zfs volume pool/lhm and give it quota 1M use "zfs set
    > > > quota=1m pool/lhm"

    >
    > > I can confirm and reproduce what you're seeing.
    > >
    > > Based on all of the ZFS documentation and examples I've read, it appears
    > > to be a bug in FreeBSD ZFS.
    > >
    > > CC'ing pjd@, who maintains ZFS on FreeBSD.

    >
    > I can't confirm this on a recent 7-STABLE (yesterday):
    >
    > intserv2# zfs set quota=1m tank/test
    > intserv2# cp /usr/ports/distfiles/samba-3.0.32.tar.gz /tank/test/
    > cp: /tank/test/samba-3.0.32.tar.gz: Disc quota exceeded


    Interesting. The system I'm testing on:

    FreeBSD icarus.home.lan 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #0: Thu Oct 2 03:04:20 PDT 2008 root@icarus.home.lan:/usr/obj/usr/src/sys/PDSMI_PLUS_RELENG_7_amd64 amd64

    Can you provide the output from "zfs get all tank tank/test"?
    Below are mine.

    Note that for the testing, I set the quota on storage/home to 4G, and
    did "dd if=/dev/zero of=/home/filler bs=1g count=8". I've since
    set the quota back to 16G.

    NAME PROPERTY VALUE SOURCE
    storage type filesystem -
    storage creation Wed Sep 24 17:47 2008 -
    storage used 181G -
    storage available 1.16T -
    storage referenced 180G -
    storage compressratio 1.02x -
    storage mounted yes -
    storage quota none default
    storage reservation none default
    storage recordsize 128K default
    storage mountpoint /storage default
    storage sharenfs off default
    storage checksum on default
    storage compression on local
    storage atime on local
    storage devices on default
    storage exec on default
    storage setuid on default
    storage readonly off default
    storage jailed off default
    storage snapdir hidden default
    storage aclmode groupmask default
    storage aclinherit secure default
    storage canmount on default
    storage shareiscsi off default
    storage xattr off temporary
    storage copies 1 default

    storage/home type filesystem -
    storage/home creation Wed Sep 24 20:26 2008 -
    storage/home used 944M -
    storage/home available 14.1G -
    storage/home referenced 944M -
    storage/home compressratio 1.25x -
    storage/home mounted yes -
    storage/home quota 15G local
    storage/home reservation none default
    storage/home recordsize 128K default
    storage/home mountpoint /home local
    storage/home sharenfs off default
    storage/home checksum on default
    storage/home compression on inherited from storage
    storage/home atime on inherited from storage
    storage/home devices on default
    storage/home exec on default
    storage/home setuid on default
    storage/home readonly off default
    storage/home jailed off default
    storage/home snapdir hidden default
    storage/home aclmode groupmask default
    storage/home aclinherit secure default
    storage/home canmount on default
    storage/home shareiscsi off default
    storage/home xattr off temporary
    storage/home copies 1 default

    Filesystem Size Used Avail Capacity Mounted on
    storage 1.3T 180G 1.2T 13% /storage
    storage/home 15G 944M 14G 6% /home

    --
    | Jeremy Chadwick jdc at parodius.com |
    | Parodius Networking http://www.parodius.com/ |
    | UNIX Systems Administrator Mountain View, CA, USA |
    | Making life hard for others since 1977. PGP: 4BD6C0CB |

    _______________________________________________
    freebsd-stable@freebsd.org mailing list
    http://lists.freebsd.org/mailman/lis...freebsd-stable
    To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"


  5. Re: zfs quota question

    On Tue, Oct 07, 2008 at 02:54:37AM -0700, Jeremy Chadwick wrote:
    > On Tue, Oct 07, 2008 at 05:32:43PM +0800, lhmwzy wrote:
    > > I create a zfs volume pool/lhm and give it quota 1M use "zfs set
    > > quota=1m pool/lhm"
    > >
    > > #zfs get all pool/lhm
    > > zfs get all pool/lhm
    > > [ttyp0][5:22:12pm]
    > > NAME PROPERTY VALUE SOURCE
    > > pool/lhm type filesystem -
    > > pool/lhm creation Tue Oct 7 17:14 2008 -
    > > pool/lhm used 1.00M -
    > > pool/lhm available 0 -
    > > pool/lhm referenced 1.00M -
    > > pool/lhm compressratio 7.25x -


    Turn compression off and retry.

    --
    Pawel Jakub Dawidek http://www.wheel.pl
    pjd@FreeBSD.org http://www.FreeBSD.org
    FreeBSD committer Am I Evil? Yes, I Am!

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.4 (FreeBSD)

    iD8DBQFI6zdTForvXbEpPzQRAid6AJ4nyoGFRUAaYKfU3zteE9 ojaXDQ+gCeL0n3
    oXawt0yyCpdoErXhL4cVmeo=
    =SXwF
    -----END PGP SIGNATURE-----


  6. Re: zfs quota question

    On Tue, Oct 07, 2008 at 03:12:59AM -0700, Jeremy Chadwick wrote:
    > On Tue, Oct 07, 2008 at 12:07:26PM +0200, Holger Kipp wrote:
    > > On Tue, Oct 07, 2008 at 02:54:37AM -0700, Jeremy Chadwick wrote:
    > > > On Tue, Oct 07, 2008 at 05:32:43PM +0800, lhmwzy wrote:
    > > > > I create a zfs volume pool/lhm and give it quota 1M use "zfs set
    > > > > quota=1m pool/lhm"

    > >
    > > > I can confirm and reproduce what you're seeing.
    > > >
    > > > Based on all of the ZFS documentation and examples I've read, it appears
    > > > to be a bug in FreeBSD ZFS.
    > > >
    > > > CC'ing pjd@, who maintains ZFS on FreeBSD.

    > >
    > > I can't confirm this on a recent 7-STABLE (yesterday):
    > >
    > > intserv2# zfs set quota=1m tank/test
    > > intserv2# cp /usr/ports/distfiles/samba-3.0.32.tar.gz /tank/test/
    > > cp: /tank/test/samba-3.0.32.tar.gz: Disc quota exceeded

    >
    > Interesting. The system I'm testing on:
    >
    > FreeBSD icarus.home.lan 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #0: Thu Oct 2 03:04:20 PDT 2008 root@icarus.home.lan:/usr/obj/usr/src/sys/PDSMI_PLUS_RELENG_7_amd64 amd64
    >
    > Can you provide the output from "zfs get all tank tank/test"?
    > Below are mine.
    >
    > Note that for the testing, I set the quota on storage/home to 4G, and
    > did "dd if=/dev/zero of=/home/filler bs=1g count=8". I've since
    > set the quota back to 16G.
    >
    > NAME PROPERTY VALUE SOURCE
    > storage compressratio 1.02x -
    >
    > storage/home type filesystem -
    > storage/home compressratio 1.25x -


    I am not sure if you get correct results with /dev/zero and
    enabled compression. A file that only contains null bytes won't
    grow very fast in compressed form.

    You might want to create storage/test and disable compression
    for this, then set a limit of 1M or larger (if you like) and try
    once again.

    I currently have a pool defined without general compression and
    just used

    # zfs create tank/test
    # zfs set quota=1m tank/test
    # cp /usr/ports/distfiles/samba-3.0.32.tar.gz /tank/test/
    cp: /tank/test/samba-3.0.32.tar.gz: Disc quota exceeded

    # zfs destroy tank/test

    and compressration is a very steady 1.00x ;-)

    Best regards,
    Holger Kipp
    _______________________________________________
    freebsd-stable@freebsd.org mailing list
    http://lists.freebsd.org/mailman/lis...freebsd-stable
    To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"


  7. Re: zfs quota question

    On Tue, Oct 07, 2008 at 03:30:09AM -0700, Jeremy Chadwick wrote:
    > On Tue, Oct 07, 2008 at 12:17:55PM +0200, Pawel Jakub Dawidek wrote:
    > > Turn compression off and retry.

    >
    > Yep, that's the key!
    >
    > # zfs set quota=4g storage/home
    > # zfs set compression=off storage
    > # zfs get compression,quota,mountpoint
    > NAME PROPERTY VALUE SOURCE
    > storage compression off local
    > storage quota none default
    > storage mountpoint /storage default
    > storage/home compression off inherited from storage
    > storage/home quota 4G local
    > storage/home mountpoint /home local
    >
    > # dd if=/dev/zero of=/home/filler bs=1g count=8
    > dd: /home/filler: Disc quota exceeded
    > 4+0 records in
    > 3+1 records out
    > 3306553344 bytes transferred in 62.566567 secs (52848566 bytes/sec)
    >
    > # df -h /home
    > Filesystem Size Used Avail Capacity Mounted on
    > storage/home 4.0G 4.0G 0B 100% /home
    >
    > I had no idea compression could cause this. A useful feature, but
    > obviously can result in misleading results... :-)


    Yeah, ZFS offers a lot, which can create confusion, unfortunately. Do we
    limit physical space with quota or only logical (before compression)?
    Should we take space consumed by snapshots into account or not? etc.

    --
    Pawel Jakub Dawidek http://www.wheel.pl
    pjd@FreeBSD.org http://www.FreeBSD.org
    FreeBSD committer Am I Evil? Yes, I Am!

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.4 (FreeBSD)

    iD8DBQFI6zruForvXbEpPzQRAtsqAJ92UKil9GkuXAi6FNxg0n ek0Dhv+wCeMI+M
    e8ZDh2MtKXIpRJGwOt/pycU=
    =cuEq
    -----END PGP SIGNATURE-----


  8. Re: zfs quota question

    sorry,I make a mistake.
    It is a filesystem,not a volume.

    2008/10/7 Holger Kipp :
    > according to zfs manpage:
    >
    > Quotas cannot be set on volumes, as the "volsize" property acts as
    > an implicit quota.
    >

    _______________________________________________
    freebsd-stable@freebsd.org mailing list
    http://lists.freebsd.org/mailman/lis...freebsd-stable
    To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"


+ Reply to Thread