[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: protect generations

From: Marco van Hulten
Subject: Re: protect generations
Date: Sun, 12 Jan 2020 15:57:22 +0100

Marius Bakke wrote:
> There are AFAIK two ways in which 'guix gc' can delete "live" profiles:
> 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=1m

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]
>     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 — the accidental removal of the generation in question
was one of the user who ran the gc command; other users' old
generation stayed in tact.)  Instead it should read

> -d [duration]
>     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 <address@hidden> wrote:
> > 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.  
> From my understanding, yes gone but not necessary forever.
> 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?  
> 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


, 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]