Date: Fri, 3 Feb 2017 16:12:07 +0000 From: Gary Palmer <gpalmer@freebsd.org> To: Ultima <ultima1252@gmail.com> Cc: freebsd-stable@freebsd.org, freebsd-current@freebsd.org, freebsd-fs@freebsd.org Subject: Re: zfs snapshot_limit is not respected Message-ID: <20170203161207.GB68015@in-addr.com> In-Reply-To: <CANJ8om427B8JMFZn4o_%2BZuDv7ssMjNJ4UjQ_%2BKvpbz0Vq6c3WQ@mail.gmail.com> References: <CANJ8om7HKhXB8RoaisBay-L70EzLDSBmiV_fnJqBOwohrCC3sQ@mail.gmail.com> <20170203124251.GA68015@in-addr.com> <CANJ8om427B8JMFZn4o_%2BZuDv7ssMjNJ4UjQ_%2BKvpbz0Vq6c3WQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Feb 03, 2017 at 10:27:48AM -0500, Ultima wrote: > Hey Gary, > > You are probably right. Do you know how to "lock" this property by chance? > I'v read this exact line several times trying to understand the exact > meaning. The "user is allowed to change the limit" I *think* is referring > to the zfs allow command. The problem is that I checked the dataset and it > is showing no permissions granted to a user. So I guess user in this case > is also including the root user, but how does one lock the property from > root? I keep going through the manpage looking for something I may have > missed but keep coming up empty. Hi, I suspect you can't lock root out, but you could allow a different user to create snapshots. If you use that user to create snapshots, they should be subject to the snapshot limit, assuming you don't let them change that property. Regards, Gary > Thanks for replying, > Ultima > > On Fri, Feb 3, 2017 at 7:42 AM, Gary Palmer <gpalmer@freebsd.org> wrote: > > > On Thu, Feb 02, 2017 at 09:31:58PM -0500, Ultima wrote: > > > I recently moved some data on a box with limited space. I decided I > > should > > > limit the snapshots so that space would not become an issue. I just check > > > back a week later to find out the box is hitting the borderline. Doing I > > > quick check I realized that the snapshot_limit is not being respected. > > > > > > # uname -a > > > FreeBSD R1 11.0-STABLE FreeBSD 11.0-STABLE #17 r312232: Sun Jan 15 > > 10:59:10 > > > EST 2017 root@S1:/usr/src/11-STABLE/obj/usr/src/11-STABLE/src/sys/ > > MYKERNEL > > > amd64 > > > > > > # zfs create zroot/bhyve/test > > > # zfs set snapshot_limit=0 zroot/bhyve/test > > > # zfs snapshot zroot/bhyve/test@1 > > > > > > > > > # zfs snapshot zroot/bhyve/test@2 > > > # zfs snapshot zroot/bhyve/test@3 > > > # zfs list -t snapshot | grep zroot/bhyve/test > > > zroot/bhyve/test@1 0 - > > > 88K - > > > zroot/bhyve/test@2 0 - > > > 88K - > > > zroot/bhyve/test@3 0 - > > > 88K - > > > # zfs get all zroot/bhyve/test | grep snapshot > > > zroot/bhyve/test usedbysnapshots 0 - > > > zroot/bhyve/test snapshot_limit 0 local > > > zroot/bhyve/test snapshot_count 3 local > > > > > > Also wanted to verify 0 was not being mistaken for none. > > > > > > # for snapshot in `zfs list -t snapshot | grep zroot/bhyve/test | awk > > > '{print $1}'`; do zfs destroy $snapshot ; done > > > > > > # zfs get all zroot/bhyve/test | grep snapshot > > > zroot/bhyve/test usedbysnapshots 0 - > > > zroot/bhyve/test snapshot_limit 0 local > > > zroot/bhyve/test snapshot_count 0 local > > > > > > # zfs set snapshot_limit=1 zroot/bhyve/test > > > # zfs snapshot zroot/bhyve/test@1 > > > # zfs snapshot zroot/bhyve/test@2 > > > # zfs snapshot zroot/bhyve/test@3 > > > # zfs get all zroot/bhyve/test | grep snapshot > > > zroot/bhyve/test usedbysnapshots 0 - > > > zroot/bhyve/test snapshot_limit 1 local > > > zroot/bhyve/test snapshot_count 3 local > > > > > > > > > Also tested on head > > > FreeBSD S1 12.0-CURRENT FreeBSD 12.0-CURRENT #26 r312388: Wed Jan 18 > > > 12:38:52 EST 2017 > > > root@S1:/usr/src/head/obj/usr/src/head/src/sys/MYKERNEL-NODEBUG > > > amd64 > > > > Hi, > > > > I suspect this line from the manpage is key: > > > > The limit is not enforced if the user is allowed to change the limit > > > > Regards, > > > > Gary > > > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170203161207.GB68015>