From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 6CplN7BlMGSH8gAASxT56A (envelope-from ) for ; Fri, 07 Apr 2023 20:49:20 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id ALFON7BlMGTLhAAAauVa8A (envelope-from ) for ; Fri, 07 Apr 2023 20:49:20 +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 3058F22172 for ; Fri, 7 Apr 2023 20:49:20 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkr8r-0004RO-4w; Fri, 07 Apr 2023 14:48:57 -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 1pkr8q-0004RE-EN for help-guix@gnu.org; Fri, 07 Apr 2023 14:48:56 -0400 Received: from mail-ua1-x932.google.com ([2607:f8b0:4864:20::932]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkr8n-0006vU-IZ for help-guix@gnu.org; Fri, 07 Apr 2023 14:48:56 -0400 Received: by mail-ua1-x932.google.com with SMTP id 89so30325968uao.0 for ; Fri, 07 Apr 2023 11:48:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680893332; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=kurdSvBXuRg7r5ISTakxV+1PZwpkkgb1DBm1sAxzAMQ=; b=Ris3B8ATAneCXwuamrJpiDHz4RiXvvWoaHVEPDPZnsnK2QJQ2Bxywp/Txk3j/tYplt TPAN3f9TB40z+14/W9ioP03CYdk0+ge4+BzZanxyNsDoPQnuVkFZsHWGRZFrI7fJQqel gMh5wXpDoKbJsyG3GPy+x0MdaDv6bKZzighSbyfYBwvoSsKtCEiQUKQTxXpCpgHsQ6J1 0B0nQJd9fyeja9v61a4qbDwW4RI/xPN1IGSNBRxI8ZSIVdKLc1KEoh3alLNY27E4vvlG ywNovHhJuq4hxM7L5+6FGKVBsdopDzSCi3fQckGgjXFAZ+aw9QHFtpxEGfQTg38ooFSe r7gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680893332; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=kurdSvBXuRg7r5ISTakxV+1PZwpkkgb1DBm1sAxzAMQ=; b=GGI2KUipy1HpXbYlfjB+apzeC0/HsZvAHTYGH++5VSm1jeivobemi2fkQZeDQSybQh 1mfxTYf+zNQXDQUAk+oHLdviJQrxie+imBLL4tMkCPbk+wpfMTmGIdcOhhWfrxluCyX1 qxvXvszI7XiWBlwm4tPonAi0l+nApZIOWxkNcvrGYxFeKE8RBjvzRPht1p0dFwbSAdw8 VfF/phc1nYkO4lG2Nl/WM6hshI+POAPFbyol8eVdCVdp3V4+H1n6et1rFedx0IhdXCaQ k48Hfp6wYnZSRoawIRD1470jKX1Ol1xHWZL/swiYPsk4cuDTANej+qDIWfdsP5tKWJzH glNA== X-Gm-Message-State: AAQBX9euc4U6tunYounoUruPO56FleoulM4CosluD5nxgrUOQY0LAYkF FXVy+tC8YGRgNgyzZ1g2qH2rHDiLgOxB/xK0W4c+dXlqzYE= X-Google-Smtp-Source: AKy350bJ71VdcVtUF4pqu3+mWSohXtXkms83jvsMtnulsHekj/p21L1flBZYqX6qP5TpmLxbA4fpZvGOr47jBbrHT74= X-Received: by 2002:ab0:54d8:0:b0:765:c202:f704 with SMTP id q24-20020ab054d8000000b00765c202f704mr1447089uaa.2.1680893331607; Fri, 07 Apr 2023 11:48:51 -0700 (PDT) MIME-Version: 1.0 From: Rodrigo Morales Date: Fri, 7 Apr 2023 18:48:35 +0000 Message-ID: Subject: How to transfer everything from /gnu/store from one system to another? To: help-guix@gnu.org Received-SPF: pass client-ip=2607:f8b0:4864:20::932; envelope-from=moralesrodrigo1100@gmail.com; helo=mail-ua1-x932.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, PDS_BTC_ID=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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1680893360; a=rsa-sha256; cv=none; b=J9H7u1vwfZY3psoYtEaBpGxLFC0bwplq+vheVgdF1gLHkHf/uKQLKeSno3Xez2n7wkqwP1 pQQ3bSJOwc8yvoWPoLV9zNHJnhV6bN6XV8yYS0cCbsGQilhugwuRJuLS1qdjt2H7od5CdU +QHd/lVROiRDdTZuK/lMFe6Y2BqaSbtJId3dcwvomYoL/ZGewEKTDSscJd7ZZ/yNaVkMcK +RNtdfRM5v73X73p/rIOoZ1J8TF4cz+BrR5jSX9oUEUOrt76zmle+fr058MjQYF4jTsXhh it3MWc8fJdo7pzgRd0XgJ7VEQUoXjHrOBkmgHFn7YLQpVXZvTx2P17L7sGy3sw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=Ris3B8AT; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1680893360; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=7m1MMT3dcfDCDPf/DSeX8EfIaaCXdBUT96SkdCvlha0=; b=dP0RRoUXgP5vqljrsQq+dX38fxxsx5B69esfKQEL/OhAYwnmGZ5qsVRC+v7E6LRDYnVwOn gvJaJxlvkNPAcr038pWAS2nG7LdhZUJmfYWnrzdeSFskRnsczYoaf16onT0CVSekZ647DR iOBMjJhcU0PEI3Ro9uc7O4vug3HDGv8kE/Z60nhoCju/yHhk0SvrPpWW2gkhmu7Gf0Lth8 0lm8xmomAB02yOJ4vfHkPe/yBYzZ10oUdzuyfbGuc59MkBNcQ3xvRbKYWmZj7ZAl4XdL0u 2FzKzk2kqbGmuitnoIgtZazSZBNZFBEATeoiGu0VGXpzB2yUBlVdSuoduPe78g== Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=Ris3B8AT; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -1.22 X-Spam-Score: -1.22 X-Migadu-Queue-Id: 3058F22172 X-TUID: iyyl3Kb+UIak Table of Contents _________________ 1. The context 2. What I know .. 1. Transfer packages by name .. 2. Transfer paths under /gnu/store .. 3. Transfer everything in /gnu/store from one system to another 3. The question 1 The context =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D I'm currently using two systems. System A (hostname: delta, ip: 196.168.1.42) is being used as my main station. System B (hostname: desktop, ip: 192.168.1.34) is used for installing and reinstalling Guix System multiple times since I'm testing system B's hardware. In order not to overload Guix servers by requesting the same packages multiple times and to download packages faster, I'm using guix publish in system A and I'm serving system B with packages coming from system A's store. In one of my experiments, I installed multiple kernels in system B and now I want to transfer them to system A's store. I want to transfer them from system B to system A because I'm going to wipe all partitions in system B and install GuixSD again, but I don't want to spend resources and time again building the same kernels, so before wiping all partitions in system B I want to save in system A the kernels and related packages that I installed in system B. 2 What I know =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 2.1 Transfer packages by name ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I know that `guix copy' can be used to transfer packages by name either from system A to system B or conversely using the flags `--from' or `--to'. ,---- | rdrg@desktop ~$ guix copy --to=3Drdrg@192.168.1.42 maxima | guix copy: sending 2 store items (128 MiB) to '192.168.1.42'... | /gnu/store/vmbfzagscqm647m5liycnqznk6lpp85l-gnuplot-5.4.6 | /gnu/store/zc9dwfim9zy0d8ccmminvzpismx4laiz-maxima-5.46.0 | rdrg@desktop ~$ echo $? | 0 `---- I can confirm that this works because in system A I had never installed `maxima' but after using `guix copy' in system B, the directory now exists in system A. ,---- | rdrg@delta ~/my$ find /gnu/store -mindepth 1 -maxdepth 1 -name '*maxima*' | /gnu/store/zc9dwfim9zy0d8ccmminvzpismx4laiz-maxima-5.46.0 | rdrg@delta ~/my$ echo $? | 0 | rdrg@delta ~/my$ find /gnu/store/zc9dwfim9zy0d8ccmminvzpismx4laiz-maxima-5.46.0 -mindepth 1 -maxdepth 1 | /gnu/store/zc9dwfim9zy0d8ccmminvzpismx4laiz-maxima-5.46.0/bin | /gnu/store/zc9dwfim9zy0d8ccmminvzpismx4laiz-maxima-5.46.0/share | /gnu/store/zc9dwfim9zy0d8ccmminvzpismx4laiz-maxima-5.46.0/libexec | /gnu/store/zc9dwfim9zy0d8ccmminvzpismx4laiz-maxima-5.46.0/lib | rdrg@delta ~/my$ echo $? | 0 `---- 2.2 Transfer paths under /gnu/store ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I also know that `guix copy' can be used to transfer paths under `/gnu/store'. ,---- | rdrg@desktop ~$ guix copy --to=3Drdrg@192.168.1.42 /gnu/store/wi3v2br7d4yh2mbj9ni7y6fbjbqvcmc5-transmission-3.00 | guix copy: sending 1 store item (4 MiB) to '192.168.1.42'... | /gnu/store/wi3v2br7d4yh2mbj9ni7y6fbjbqvcmc5-transmission-3.00 | rdrg@desktop ~$ echo $? | 0 `---- Similarly, I can confirm that this works because in system A I had never installed `transmission' and after `guix copy' finished, the path that existed in system B now exists in system A. ,---- | rdrg@delta ~/my$ find /gnu/store/wi3v2br7d4yh2mbj9ni7y6fbjbqvcmc5-transmission-3.00 -mindepth 1 -maxdepth 1 | /gnu/store/wi3v2br7d4yh2mbj9ni7y6fbjbqvcmc5-transmission-3.00/bin | /gnu/store/wi3v2br7d4yh2mbj9ni7y6fbjbqvcmc5-transmission-3.00/share | /gnu/store/wi3v2br7d4yh2mbj9ni7y6fbjbqvcmc5-transmission-3.00/etc | /gnu/store/wi3v2br7d4yh2mbj9ni7y6fbjbqvcmc5-transmission-3.00/lib | rdrg@delta ~/my$ echo $? | 0 `---- 2.3 Transfer everything in /gnu/store from one system to another ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Because it is possible to transfer paths using `guix copy', I can iterate through all directories in `/gnu/store' using `find' in system B and transfer them to system A, as shown in the command below. ,---- | rdrg@desktop ~$ find /gnu/store -mindepth 1 -maxdepth 1 -exec guix copy --to=3Drdrg@192.168.1.42 {} + `---- I executed this command. However, some errors were shown and the command didn't exit successfully. ,---- | rdrg@desktop ~$ find /gnu/store -mindepth 1 -maxdepth 1 -exec guix copy --to=3Drdrg@192.168.1.42 {} + | guix copy: error: path `/gnu/store/.links' is not valid | guix copy: sending 0 store items (0 MiB) to '192.168.1.42'... | guix copy: sending 0 store items (0 MiB) to '192.168.1.42'... | guix copy: sending 0 store items (0 MiB) to '192.168.1.42'... | guix copy: sending 0 store items (0 MiB) to '192.168.1.42'... | guix copy: error: path `/gnu/store/gckhwapfi4m73pvlsskri4qscf1mzs55-nvidia-module-515.76.lock' is not valid | guix copy: error: path `/gnu/store/sldynyzhq1w96b05yb5qvfgyvqji1ydm-linux-libre-5.10.177.lock' is not valid | guix copy: sending 296 store items (4,894 MiB) to '192.168.1.42'... | 21% =E2=96=95=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2= =96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96= =88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88= =E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2= =96=88=E2=96=88=E2=96=88=E2=96=8F =E2=96=8F;;; [2023/04/07 13:16:47.068026, 0] [GSSH ERR= OR] Parent session is not connected: # | Backtrace: | 17 (primitive-load "/home/rdrg/.config/guix/current/bin/gu=E2= =80=A6") | In guix/ui.scm: | 2300:7 16 (run-guix . _) | 2263:10 15 (run-guix-command _ . _) | In ice-9/boot-9.scm: | 1752:10 14 (with-exception-handler _ _ #:unwind? _ # _) | 1752:10 13 (with-exception-handler _ _ #:unwind? _ # _) | In guix/store.scm: | 659:37 12 (thunk) | 1298:8 11 (call-with-build-handler _ _) | 1298:8 10 (call-with-build-handler # =E2=80=A6) | In guix/status.scm: | 830:4 9 (call-with-status-report _ _) | In guix/scripts/copy.scm: | 81:26 8 (_) | In guix/ssh.scm: | 530:7 7 (send-files _ _ _ #:recursive? _ #:log-port _) | In guix/store.scm: | 1764:12 6 (export-paths # _ = =E2=80=A6) | 1731:22 5 (export-path # _ # = =E2=80=A6) | 716:13 4 (process-stderr _ _) | In guix/build/utils.scm: | 1014:11 3 (loop _ _) | In unknown file: | 2 (put-bytevector # = =E2=80=A6) | In ice-9/boot-9.scm: | 1685:16 1 (raise-exception _ #:continuable? _) | 1685:16 0 (raise-exception _ #:continuable? _) | | ice-9/boot-9.scm:1685:16: In procedure raise-exception: | Throw to key `guile-ssh-error' with args `("write_to_channel_port" "Parent session is not connected" # #f)'. | rdrg@desktop ~$ echo $? | 1 | rdrg@desktop ~$ `---- I also tried executing `guix copy' on each file. However, this was very slow, because an instance of `guix copy' need to be launch for each file in `/gnu/store' =3Deven for files that had already been copied. ,---- | find /gnu/store -mindepth 1 -maxdepth 1 -exec guix copy --to=3D rdrg@192.168.1.42 {} \; `---- Instead, what I tried was to get the files under `/gnu/store' that were unique to system B and execute `guix copy' on them, as shown in the code block below. The command throw ,---- | rdrg@desktop ~$ find /gnu/store -mindepth 1 -maxdepth 1 | sort > ~/e/desktop.txt | rdrg@desktop ~$ ssh rdrg@192.168.1.42 'find /gnu/store -mindepth 1 -maxdepth 1 | sort' > ~/e/delta.txt | rdrg@desktop ~$ for i in $(comm -2 -3 ~/e/desktop.txt ~/e/delta.txt); do guix copy --to=3Drdrg@192.168.1.42 "$i"; done | guix copy: sending 2 store items (49 MiB) to '192.168.1.42'... | /gnu/store/3hfbyphf96riviip19cqap6hnmai6q8m-gtk+-3.24.30 | /gnu/store/0ffbcckd6mziy5q1qpbjnpsmin9zwchq-glib-schemas | guix copy: sending 12 store items (0 MiB) to '192.168.1.42'... | /gnu/store/wkcw7xifbvdi2an2nkq5sq6d3cgmnvzm-linux-libre-6.2.9-guix.tar.xz-b= uilder | /gnu/store/i44qvynnrxs3a21ag855diprjdq5i7gh-linux-libre-deblob-6.2.9-gnu.dr= v | /gnu/store/gkyl8v3z17mqkyblm7v37afhlp2hjilf-linux-libre-deblob-check-6.2.9-= gnu.drv | /gnu/store/fh4dmd3s5z8vq2p041arrznbcharrmrl-linux-libre-arm-export-__sync_i= cache_dcache.patch.drv | /gnu/store/dixa4n5h0fv475qi0a4cpwbi1hdjbypv-linux-libre-6.2.9-guix.tar.xz.d= rv | /gnu/store/8l15dxwm0pwdyqa7mqc9b3f7b4hvl7cs-100gnu+freedo.patch.drv | /gnu/store/5yg1dg009ma726yja5ql4m0nl61jwrby-linux-libre-6.2.9-guix.tar.xz-b= uilder | /gnu/store/3605dafwvk90fw4kcm62qnlaghi753rj-linux-libre-6.2.9-guix.tar.xz.d= rv | /gnu/store/2kjrxdhwm7izgnap6z6mhw1hva49ch43-linux-libre-6.2.9-builder | /gnu/store/x53glvwk5sb4j2fwc90mmqamswmf41nc-linux-libre-6.2.9.drv | /gnu/store/r56gag4i5gk9mchncg7sig1hkgx9lql7-linux-modules-builder | /gnu/store/0fz88rlf18j3qq1xy7kkpazd9warl4gd-linux-modules.drv | | (... some omitted lines ...) `---- After the command finished executing, the following files were the only ones that were not copied which don't look as if they were important because they are empty (see proof below). ,---- | rdrg@desktop ~$ find /gnu/store -mindepth 1 -maxdepth 1 | sort > ~/e/desktop.txt | rdrg@desktop ~$ ssh rdrg@192.168.1.42 'find /gnu/store -mindepth 1 -maxdepth 1 | sort' > ~/e/delta.txt | rdrg@desktop ~$ for i in $(comm -2 -3 ~/e/desktop.txt ~/e/delta.txt); do echo "File: $i"; du -hs "$i"; sudo cat "$i"; done | File: /gnu/store/1ap2jaip98r0w5fx82bkzgx2vrkdk06h-linux-libre-4.14.312.lock | 0 /gnu/store/1ap2jaip98r0w5fx82bkzgx2vrkdk06h-linux-libre-4.14.312.lock | File: /gnu/store/29mnj31zxycznvswjydk28ivgwa6x0fs-nvidia-module-515.76.lock | 0 /gnu/store/29mnj31zxycznvswjydk28ivgwa6x0fs-nvidia-module-515.76.lock | File: /gnu/store/gckhwapfi4m73pvlsskri4qscf1mzs55-nvidia-module-515.76.lock | 0 /gnu/store/gckhwapfi4m73pvlsskri4qscf1mzs55-nvidia-module-515.76.lock | File: /gnu/store/sldynyzhq1w96b05yb5qvfgyvqji1ydm-linux-libre-5.10.177.lock | 0 /gnu/store/sldynyzhq1w96b05yb5qvfgyvqji1ydm-linux-libre-5.10.177.lock | File: /gnu/store/vd0ka6x5bjbgpksiwlwgy4r3v8kc9hfi-samba-4.16.8.lock | 0 /gnu/store/vd0ka6x5bjbgpksiwlwgy4r3v8kc9hfi-samba-4.16.8.lock | rdrg@desktop ~$ echo $? | 0 `---- 3 The question =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D As I showed in the previous section "Transfer everything in /gnu/store from one system to another", I already know how to transfer all paths from one system to another. However, I'm wondering if there's a command available in `guix <>' to accomplish the same behavior, since I would prefer using a solution that involve fewer steps.