Thanks for your reply. I am not trying to manually remove anything from /gnu/store/. I could use your suggestion if I am building a package through "guix build" command. But the file "[...]grub.cfg" under /gnu/store/ is created by the system (not user) during "guix system init" process. So how can I prevent "guix gc" process from removing a system created file? Thanks!
February 19, 2019 6:14 PM, "Björn Höfling" <[email protected]> wrote: > On Tue, 19 Feb 2019 18:15:34 +0000 > "Raghav Gururajan" <[email protected]> wrote: > >> Hi Guix! >> >> Since my BIOS comes with in-built grub payload, I did not want to >> install bootloader on disk (but do want grub.cfg file >> under /gnu/store/), so I passed --no-bootloader parameter during guix >> system init. The guix system got successfully instantiated and there >> was *grub.cfg file under /gnu/store/. The file stayed even after >> multiple reboot, guix pull and guix package -u. But when I did guix >> gc, it removed the *grub.cfg file under /gnu/store/. How can I >> prevent this from happening? Since I am a novice user, please provide >> me step-wise explanation. > > Hi, > > I'm not 100% sure that what you are doing is correct in the Guix-sense. > Anyway, what's important is that you never delete from the /gnu/store > manually, always use guix gc, as you did. > > To prevent things in the store from garbage collection, you can use the > additional build parameter "--root=file", see here: > > https://www.gnu.org/software/guix/manual/en/guix.html#Additional-Build-Options > > i.e. guix build ... --root=/home/me/my-gc-root > > That would prevent the gc to remove that file, as long as that created > link points to the store entry. > > Hope this helps, > > Björn
