From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marco van Hulten Subject: Re: protect generations Date: Sun, 12 Jan 2020 15:57:22 +0100 Message-ID: <20200112155722.00f6010a@jasniac.instanton> References: <20200105224236.2e4fb9c2@jasniac.instanton> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:56683) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iqegI-0005lq-Ly for help-guix@gnu.org; Sun, 12 Jan 2020 09:57:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iqegH-00063K-CJ for help-guix@gnu.org; Sun, 12 Jan 2020 09:57:34 -0500 Received: from alfons.uib.no ([2001:700:200:30::141]:35692) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iqegG-0005lI-KU for help-guix@gnu.org; Sun, 12 Jan 2020 09:57:33 -0500 Received: from alfux.uib.no (smtp.uib.no) [2001:700:200:6::a:1f0c] by alfons.uib.no for help-guix@gnu.org with esmtp (Exim 4.92.3) id 1iqegA-000tWg-Qy; Sun, 12 Jan 2020 15:57:28 +0100 Received: from 173.92-220-42.customer.lyse.net (jasniac.instanton) [92.220.42.173]:50523 by smtp.uib.no for help-guix@gnu.org with esmtpsa (Exim 4.92.3) id 1iqeg7-0001XX-Uu; Sun, 12 Jan 2020 15:57:23 +0100 In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane-mx.org@gnu.org Sender: "Help-Guix" To: help-guix@gnu.org Marius Bakke wrote: > There are AFAIK two ways in which 'guix gc' can delete "live" profiles: >=20 > 1. you used the '-d' option, which deletes old profile generations, > optionally filtering on age This was the case. I did guix gc --delete-generations=3D1m which deleted the last month of generations. The profile that I wanted to retain was a bit older than one month. Apropos, in the documentation of 'guix gc' I read: > -d [duration] >=20 > Before starting the garbage collection process, delete all the > generations older than duration, for all the user profiles; when > run as root, this applies to all the profiles of all the users. I suppose the first mention of "all the user profiles" should not be there, as a non-priviledged user should not be able to remove generations from others' user profiles. (This does, indeed, appear not to be the case =E2=80=94 the accidental removal of the generation in questi= on was one of the user who ran the gc command; other users' old generation stayed in tact.) Instead it should read > -d [duration] >=20 > Before starting the garbage collection process, delete all the > generations older than duration from the current user's profile; when > run as root, this applies to all the profiles of all the users. Je 7 jan 13:11 skribis zimoun: > On Sun, 5 Jan 2020 at 22:42, Marco van Hulten wrote: >=20 > > One of the great features of Guix is that one can roll back his > > profile. But I did a garbage collection (gc) that was too aggressive > > such that a relevant old profile disappeared. I presume this is gone > > forever. =20 >=20 > From my understanding, yes gone but not necessary forever. >=20 > How did you instantiate the profile? Using a manifest file? Did the > profile use only one Guix commit or several? > How aggressive it was? What did you run? I have never used manifest files but usually use the imperative method of 'guix package -i ... -r ... -u' or sometimes I change to another "live" profile. > > Is it possible to lock certain generations (of certain users) such that > > 'guix gc' would not touch it? =20 >=20 > Interesting whislist. In retrospect, a realisation of this wish would probably introduce unnecessary complexity of 'guix gc'. So nevermind. :-) > Currently, the easiest way to protect the state of a profile is to > write down a manifest file, IMHO. > If this manifest file track the Guix commit and the targeted packages, > then you can re-instantiate this very profile whereever and whenever > you want to. I see how I can declare a specific manifest be used (by giving the manifest file). How do I create (or where do I find) the manifest file from the currently running generations? Can you give a minor clarification on the terms 'generation' and 'profile'? I understand that the a generation is an abstract term defining a profile. Generations correspond with /var/guix/profiles/per-user/*/guix-profile* , which is actually a subset, above referred to as "live" profiles. The running profile is the realpath(1) of ~/.guix-profile/. Are 'generations' and 'profiles' not basically the same thing? Instead of trying to restore the removed generation/profile, I try to fix the issue that I'm experiencing in newer generations. I might ask about this in a new thread if I cannot figure it out. =E2=80=94Marco