From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id IK8SDajb22SDNQAASxT56A (envelope-from ) for ; Tue, 15 Aug 2023 22:10:16 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id ICNRDKjb22QfaAEA9RJhRA (envelope-from ) for ; Tue, 15 Aug 2023 22:10:16 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C8A8A4F3B6 for ; Tue, 15 Aug 2023 22:10:15 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=JXvppzde; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1692130215; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=f+BBm3MVmysL8DRuPC714qOlY5ajlNcMSkNQgtDiErQ=; b=kiVJ/7xg7FhIZpajojFtFfhxd5eC2bD1ZWTUHy37T2a8GpTW4JDaEdG7NQeWgrP8UyqKhr i0Bh6r3m4YbBkBLNg+uPH7grfgjPj5e/G+EpUjdPT6fOkVB41+ehYCUDeoE4BkCq4iI/vc NCMV/P8UfYyyWapeih3VkiVWua7XeAVkfdM3bMzMOSGTPoPDI9LfxMPfSj+C8dYuf1FwKp mwxFclvToYQ2/bLWKOGkTjLNhk0M2RSSQ/ZnLWwflaVIngrF/r968wEN2Qe2rVCDMV/zUu 1jJxQUUpdzCf5wVbqR3GcQPTHMOJZHqvhTBfiT8yUFoixpNv9202OBixehMAxg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=JXvppzde; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1692130215; a=rsa-sha256; cv=none; b=NR+QCncTDT5xWvM2MpcO0t+9RzO7m2HSChef2M5YsceoqP1fJHsmhplqhGdJ/5c4sMb5mB IIvitFeiatIp/DDdgFMvcU6FgqY0yxWnuN+syY3wExcF0iZRzG/XMNvRd2TGUa2CN2dchv 3CCvJiaZfzCVDhKixYSGYxr608DsI/s6ao9/VmQXHvp7kE8DQ5vHQfZm78eP0/tVLxo3z2 B6WiDVfTRUfc39gCNo5kjJ+BfIgUUYpvj4in3sMSjbSTKBviFWD5SkvrkDygiMQXdsxgqc 0wC0a7xRcbAo0CnfNSLd8EHQbtaSO9nkPsvfF5/b2sFgHA0xfqOQ3SxRRJjIag== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qW0Br-0006dW-OH; Tue, 15 Aug 2023 15:58:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qW0Bp-0006bR-Eg for guix-devel@gnu.org; Tue, 15 Aug 2023 15:58:53 -0400 Received: from mail-qv1-xf31.google.com ([2607:f8b0:4864:20::f31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qW0Bm-0001GW-V9 for guix-devel@gnu.org; Tue, 15 Aug 2023 15:58:53 -0400 Received: by mail-qv1-xf31.google.com with SMTP id 6a1803df08f44-6459a873237so18595026d6.0 for ; Tue, 15 Aug 2023 12:58:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692129529; x=1692734329; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=f+BBm3MVmysL8DRuPC714qOlY5ajlNcMSkNQgtDiErQ=; b=JXvppzdeUPyicpn5KyykaWkNj72jKtTOAhCDML4ZclVOBKXEdDwywpqwiFOhKGRVvn 9WStVS7U6cGV1MwzLvaxMVw6Mbpo+5hjoClwvFumDlIRlWUvBpHhPaOhhne8l3qH33h2 c0Lkl2Max62cALcaVZRShHShXT/KEN0VrIDXUQ5F6ofbrYFwBQtkNB5FZ/id90x1rpoC RgkeM9aCfZY1Mh9rIr3k1novlPsHuhL1PnQmB+PXttMD5HiAEPRBw+eCjMwyV33VczIv ChhaNA8mifeEcsbfz6TcHQ5KjavC3q/zN95NTAZQWClQYNSznyLBGmXMmV4bmQhRn12D GamQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692129529; x=1692734329; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=f+BBm3MVmysL8DRuPC714qOlY5ajlNcMSkNQgtDiErQ=; b=N/AR7NJgcgdZ8V4zmd8obA1EKb15MADp+8rI8duTGJDA5a3DCfXxFRMJ05a1TCj7UG NQv+FWw/SYnIrMDIeAqOALQfWrENBZQGaqOAZYI37EN7FagoKFh8s1AAUoKL/Gq2bxow ID7GibI6kybRFPasu7Pfw2B9MWlmv76v6clnjFdIfU2Ry7VImPZQz9xkimiPmQRS2pNe 7zc7trv7yGDBXQATvmYRrJPUJlh8LlrGTqS1Yi4lsR1Rff7ZN4xnyV1YsnCf6v3qo8ik Pt48iF4HqbZVqZRXIzOMpTB+qfC96AqgeKU8GOmq77W+tAovPdE4n7GeKP4pcVenrDiy AT7A== X-Gm-Message-State: AOJu0Ywm+OkRuW9fXeel7VmzViye++G6q5cJTjuMILDET2bik8Vm/2Ed OCkRVJzbL2kcIBHnswHOMGWN0CxJhr9m4Q== X-Google-Smtp-Source: AGHT+IExCpwWzMNbwQz8qfrhwbdKAfjPG/IWCtBGbDijOXqSoHezHsl4YrHEQLjH5J1/cbhvawk+KA== X-Received: by 2002:a0c:dc8c:0:b0:642:d729:35ec with SMTP id n12-20020a0cdc8c000000b00642d72935ecmr14051587qvk.51.1692129529472; Tue, 15 Aug 2023 12:58:49 -0700 (PDT) Received: from hurd (dsl-148-65.b2b2c.ca. [66.158.148.65]) by smtp.gmail.com with ESMTPSA id z11-20020a0cf00b000000b0063d09326fa4sm4366620qvk.31.2023.08.15.12.58.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 12:58:48 -0700 (PDT) From: Maxim Cournoyer To: Nicolas Graves Cc: guix-devel@gnu.org Subject: Re: btrfs recommended layout for snapshots? References: <87jztxn2hc.fsf@ngraves.fr> <87h6p1n0sv.fsf@ngraves.fr> Date: Tue, 15 Aug 2023 15:58:47 -0400 In-Reply-To: (Efraim Flashner's message of "Tue, 15 Aug 2023 17:33:27 +0300") Message-ID: <87a5usjcw8.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::f31; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qv1-xf31.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: C8A8A4F3B6 X-Migadu-Scanner: mx1.migadu.com X-Spam-Score: -8.57 X-Migadu-Spam-Score: -8.57 X-TUID: Wks3yoMNMqwG Hi Efraim and others, Efraim Flashner writes: > On Mon, Aug 14, 2023 at 04:41:52PM +0200, Nicolas Graves via > Development of GNU Guix and the GNU System distribution. wrote: >> >> > - either not snapshotting the rootfs / at all, with the hypothesis that >> > we get it back entirely from config files. Is that possible ? Is there >> > information in / (I think of /etc in particular) that is saved, not >> > temporary and not managed by guix system that would justify that we >> > want to snapshot / at all? >> > This would allow to simply care about only a few "user data" >> > directories, and be sure to not miss anything when there's a need to >> > restore the state. >> > >> > I can't find easily a case of successful use of the second >> > configuration, but would be glad to find one, as well as some discussion >> > about what would be a recommended way to secure the state beyond >> > dotfiles. >> >> I've found some equivalent information on the NixOS side here : >> https://nixos.wiki/wiki/Impermanence >> >> Some (rare) directories indeed seem that would better be saved because >> their information is useful for the system, in the case of NixOS, it >> seems to be "/etc/nixos", "/etc/NetworkManager" (for system >> connections), "/var/log", "/var/lib". >> >> However, I have much more files that aren't linked in the store, >> especially in the /etc directory (at least 20 files). >> >> Has anybody tried to do something like this on Guix? > > I'm still not using most of the features of btrfs, just compression. Some side topic, but an easy and useful way to leverage Btrfs snapshots is through 'btrbk', for automatic and incremental backups. I have mind setup via this mcron job that fires ever hour: --8<---------------cut here---------------start------------->8--- (define btrbk-job #~(job '(next-hour) (lambda () (system* #$(file-append btrbk "/bin/btrbk") "-q" "-c" #$(local-file "btrbk.conf") "run")) "btrbk")) --8<---------------cut here---------------end--------------->8--- and this special extra file service: --8<---------------cut here---------------start------------->8--- (extra-special-file "/etc/btrbk.conf" (local-file "btrbk.conf")) --8<---------------cut here---------------end--------------->8--- that reads like: --8<---------------cut here---------------start------------->8--- lockfile /var/lock/btrbk.lock transaction_log /var/log/btrbk.log snapshot_dir _btrbk_snap stream_buffer 256m snapshot_preserve_min 2d snapshot_preserve 14d target_preserve_min no target_preserve 20d 10w 6m archive_preserve_min latest archive_preserve 12m 7y # TODO: /etc/crypttab with automatic mounting of external drives target /media/maxim/btr_backup/_btrbk # TODO: Backup @root? volume /mnt/btr_pool subvolume @home subvolume @data --8<---------------cut here---------------end--------------->8--- It'd be nice to add a btrbk-service-type some day to make this easier for people to get started. -- Thanks, Maxim