From owner-freebsd-questions@freebsd.org Thu Feb 22 23:00:36 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2B20F0A714 for ; Thu, 22 Feb 2018 23:00:35 +0000 (UTC) (envelope-from dch@skunkwerks.at) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B4147DC38 for ; Thu, 22 Feb 2018 23:00:34 +0000 (UTC) (envelope-from dch@skunkwerks.at) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id D4CC820EFF; Thu, 22 Feb 2018 18:00:33 -0500 (EST) Received: from web6 ([10.202.2.216]) by compute7.internal (MEProxy); Thu, 22 Feb 2018 18:00:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skunkwerks.at; h=content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=iJp9MCL9gon1TRJ5/x6z8Qf7zHMfH EsOxSoT0CzurVo=; b=E1tYCTRibW3D+xozrClBY94UDr7VBO7x7E9UB/55re36n cnVLJJuX7kJUwOP2jLEjANEj2DkpJ4oHucmVjTrYGSpuqc+9OctvyKdSIDmbYrqf 1iP8+hJbrf5iZYUuUVOTr5sGtDLIgO7dWAMXBmUoqeeDUCSOCRRYHbj233TvpeKP XFkvOjxlJ3uVpTxKg/92dWUnwJmrYC6Z1J8h69zXLfx66pcAO2IcRFu3T2jLsQ+e lClmGU0x95r4R3btSKJtnEDhIYaDMGLF9pGrE4941hqRxp2jkS38qQeNf+pcY2XZ X950K0OshCvd/Vg/OrHksVqmGSHFrAhzA1e7p+Q8Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=iJp9MC L9gon1TRJ5/x6z8Qf7zHMfHEsOxSoT0CzurVo=; b=EyQxDGQWgfFWFE5EfdoEHJ ww34IEMmjUJbwZIUF4HE8JTg31hX+u7FRkpg28hiACUz8Yh955OtikZPFr6yZ9ot ce33M/+tV2urc9U0WOk4fOGvACbjGVpIvDl6LkaT24jbXjGg6Ep7RA+jtU1cevol 4Pk9YWImOiFLYvxINmWtsJzlakurJmghaeg3FPbpEFNMeaAhvmz5k9HNObIPyGo4 kSRblKw+5CSv9D3VzphXK5/vtdPd1p647yocyuGQlSC9ehc10f1nt1lwvUySlQ5q JcOzg/Mq/caNkZlouy0uMqOB2dwaqu6UpJuloUHpLWrnhkLKwRX9gFEoqQwDuSNw == X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id A8E314133; Thu, 22 Feb 2018 18:00:33 -0500 (EST) Message-Id: <1519340433.3372351.1280283944.09E847B7@webmail.messagingengine.com> From: Dave Cottlehuber To: freebsd-questions@freebsd.org, byrnejb@harte-lyne.ca MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-efbb3405 Subject: Re: Resetting zfs snapshots References: In-Reply-To: Date: Fri, 23 Feb 2018 00:00:33 +0100 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Feb 2018 23:00:36 -0000 On Thu, 22 Feb 2018, at 22:29, James B. Byrne via freebsd-questions wrote: > I am in the process of setting up a new FreeBSD server which involves > transferring a large amount of data onto. The system was installed > with root zfs and snapshots were initialised immediately. > > Several iterations of test data transfer and deletes has now resulted > in snapshots exceeding 64 Gb. I wish to effectively restart/rebase > snapshots following the final transfer and eliminate all previous > ones. > > What is the safest way to do this? -read the manpage for `zfs destroy` carefully ;-) and make a backup. start off using: zfs destroy -vn zroot/path/to/dataset@first-snapshot%last-snapshot the -n ensures it only displays what it *would* do, but actually makes no changes. the @first%last is an inclusive range so the destruction would include: - first - last - everything in between You may want -r which does this same range destruction for all child datasets. If your goal is to *recursively* nuke all snapshots prior to "now" then you can: # make a snapshot right now that will be destroyed in the inclusive range zfs snapshot -r zroot@before # this snapshot will live on in infamy long after its comrades are gone zfs snapshot -r zroot@now # use the inclusive range to trash all preceding snapshots zfs destroy -vrn zroot@%before # at this point a backup is a really good idea zfs send -LevR zroot@now > somewhere/with/space I highly recommend Jude + Lucas' zfs books, well worth every penny. Also, if you're not using boot environments, start now. they are the best thing since zfs. You have a good opportunity to test these out before your system is live. [1]: sysutils/beadm-devel [2]: http://www.callfortesting.org/bhyve-boot-environments/ A+ Dave