unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Julien Lepiller <julien@lepiller.eu>
To: help-guix@gnu.org,Phil <phil@beadling.co.uk>
Subject: Re: Moving /gnu/store safely?
Date: Wed, 03 Mar 2021 08:49:55 -0500	[thread overview]
Message-ID: <CEC68BB6-9CA1-4108-84FD-F92DAECC743C@lepiller.eu> (raw)
In-Reply-To: <85mtvkmjvr.fsf@beadling.co.uk>

I suppose the doubling of size is due to deduplication not working well with rsync: we use hard links for identical files, but I suppose rsync doesn't recreate the hard links?

Maybe try guix gc --optimize?

Le 3 mars 2021 08:44:56 GMT-05:00, Phil <phil@beadling.co.uk> a écrit :
>Hi all,
>
>My growing /gnu/store needed to be moved to another location.  I
>couldn't
>find any specific instructions on doing this but think I've managed to
>cobble together a way of doing this safely without breaking store
>properties.
>
>There were some gremlins tho - on restarting Guix the /gnu/store was
>seen to grow to approximately double it's size.
>
>I seem to have tamed this with the garbage collection, but would be
>interested
>in people's thoughts if this is a reasonable way to do this, or if you
>have any hints or gotchas I may have missed?
>
>Stop all Guix services and mounts
>    systemctl stop guix-daemon.service
>    systemctl stop gnu-store.mount
>    systemctl status guix-daemon.service
>    systemctl status gnu-store.mount
>    
>Assuming that you have a /some_other_disk mount with more room:
>    mkdir /some_other_disk/gnu
>    rsync -va /gnu/store /some_other_disk/gnu/
>    
>Move the old store create the correct directory for the new
>    cd /gnu/store
>    mv store store.old
>    mkdir store
>    chmod 01775 store
>    chown root:guixbuild store
>    
>Change the Guix configuration file -
>/etc/systemd/system/gnu-store.mount - under [Mount]:
>    What=/some_other_disk/gnu/store
>    
>Reload configuration and restart the daemon
>    systemctl daemon-reload
>    systemctl start guix-daemon.service
>    systemctl status guix-daemon.service
>    systemctl status gnu-store.mount
>
>When you're sure everything looks good
>rm -rf /gnu/store.old
>
>Like I said this worked and guix pull/install/etc worked fine
>afterwards
>- previous installs were recognized etc.
>
>When I ran:
>guix gc --verify
>
>It returned success (0 ret code)
>
>I noted however that the new /gnu/store was approx double in size - it
>looked like it had created new links to represent store items.
>
>I then ran:
>guix gc --collect-garbage
>
>This seemed to remove about half the size of the new store - suggesting
>to me that stale links were now removed.
>
>Is my method sane?
>
>Is there a better way of doing such a move to avoid the doubling of
>size?
>
>
>Thanks,
>Phil

  reply	other threads:[~2021-03-03 13:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-03 13:44 Moving /gnu/store safely? Phil
2021-03-03 13:49 ` Julien Lepiller [this message]
2021-03-03 14:49 ` André Batista
2021-03-03 19:10   ` Phil
2021-03-03 16:38 ` Tobias Geerinckx-Rice
2021-03-03 20:14   ` Phil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CEC68BB6-9CA1-4108-84FD-F92DAECC743C@lepiller.eu \
    --to=julien@lepiller.eu \
    --cc=help-guix@gnu.org \
    --cc=phil@beadling.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).