From owner-freebsd-questions@freebsd.org Mon Nov 14 07:53:54 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22F77C40C4D for ; Mon, 14 Nov 2016 07:53:54 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [81.2.117.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.infracaninophile.co.uk", Issuer "infracaninophile.co.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id ABA451606 for ; Mon, 14 Nov 2016 07:53:53 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from liminal.local (unknown [IPv6:2001:8b0:151:1:1c1d:86a1:a200:b700]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: m.seaman@infracaninophile.co.uk) by smtp.infracaninophile.co.uk (Postfix) with ESMTPSA id D49EF2E10 for ; Mon, 14 Nov 2016 07:53:41 +0000 (UTC) Authentication-Results: smtp.infracaninophile.co.uk; dmarc=none header.from=FreeBSD.org Authentication-Results: smtp.infracaninophile.co.uk/D49EF2E10; dkim=none; dkim-atps=neutral Subject: Re: zfs send/receive as dump/restore alternative To: freebsd-questions@freebsd.org References: <20161114054657.GA66229@admin.sibptus.transneft.ru> From: Matthew Seaman Message-ID: <1bf448ae-a011-8c69-b199-17d71f4053c3@FreeBSD.org> Date: Mon, 14 Nov 2016 07:53:29 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161114054657.GA66229@admin.sibptus.transneft.ru> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qCGj6cNDwlkJRaFf7FfoH6b4QQrfJpxdr" X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on smtp.infracaninophile.co.uk X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2016 07:53:54 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qCGj6cNDwlkJRaFf7FfoH6b4QQrfJpxdr Content-Type: multipart/mixed; boundary="JxLXpq0qjqQnRXLA2HHOxHElFqpfvsB2B"; protected-headers="v1" From: Matthew Seaman To: freebsd-questions@freebsd.org Message-ID: <1bf448ae-a011-8c69-b199-17d71f4053c3@FreeBSD.org> Subject: Re: zfs send/receive as dump/restore alternative References: <20161114054657.GA66229@admin.sibptus.transneft.ru> In-Reply-To: <20161114054657.GA66229@admin.sibptus.transneft.ru> --JxLXpq0qjqQnRXLA2HHOxHElFqpfvsB2B Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 14/11/2016 05:46, Victor Sudakov wrote: > How would you restore a) a single dataset or b) a single file from a > replication stream package? I really need this mode of operation for > undeleting users' files etc. You have to 'zfs recv' your datastream and expand it out as a filesystem. Then you can simply copy individual files back to your live system, or you can do a zfs send / zfs recv of a single dataset to restore that. You can easily 'zfs recv' the datastream into a different root directory than it came from -- so you won't end up overwriting onesystem with the backup of another. There are scripts to do this in ports, but here's some I wrote myself: https://github.com/infracaninophile/zfs-backup I never did get round to writing a 'zfs-restore' script though. Cheers, Matthew --JxLXpq0qjqQnRXLA2HHOxHElFqpfvsB2B-- --qCGj6cNDwlkJRaFf7FfoH6b4QQrfJpxdr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQJ8BAEBCgBmBQJYKW2AXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NTNBNjhCOTEzQTRFNkNGM0UxRTEzMjZC QjIzQUY1MThFMUE0MDEzAAoJELsjr1GOGkATeDgQAJKtd+AQCIHrBvhNlOJXMOOr +/7BYC6VE+E7hOiHzVKI1WewZXcnJY6ayx/IYvs6rU1qEXBxmM/4//NFfOAVbqQH Go+sdSqdhsppWkTDvp2oe95dNvvCDyjJu0WHtlPfu6nX6VIWGcA5J8RWTZydsC0J NK8m67E6Wnku6nlYAvB7NTiqVbdtK+JfO7/WrZ2/0FkyMxN/1sjQx0fQu/dsNCyv zfqvXZS69p7u88EHGn2naeeDE3fDun9ZE+QhViyPFwxPxHEV2zcfh60QW1bz13Ia QOHfRt+B9bUwb/DrdTXT2r5N6tws/o7rQ3BPQ6+2T98vdt9xvPVdvulKaerXwJEr N8/P3NPMH6WhLEFzIQi/UXApmJNFecn7BOaFVadCJhR9uwLzaEfciyVctOqiAFvr YXn56vLillPmAEMb8jAoXfAR0OVCxrzzlzwcCGm58AdvT4JO1VorYo/m7u1JI9V9 Elr/vS6m31QERSTsmJT8gei820MkhkYmhdh1/a9n4evDCKShn3Z9OTz4h/Mrki2p sQgoY3n7eOdXYJeqBQfac//6P+WiF0FwhXHWceLqilLvzYjrFFWUvsp+EsqOHuBK ABHSvybDb01frdf59ptkm3bWJnOetgSDk8PFon0i/MlCGIJvFYUzAH59AIvf6BSS 792GEEeLoY4xYNJd7ysw =6I+0 -----END PGP SIGNATURE----- --qCGj6cNDwlkJRaFf7FfoH6b4QQrfJpxdr--