Storage optimization: Difference between revisions
m Fix trailing typo. Tags: Mobile edit Mobile web edit |
Denperidge (talk | contribs) Moving the store: fixed rsync --hard-links argument, merged rsync commands. Moved mount instructions from mounting on /mnt to mounting on /mnt/nix, added mount options |
||
Line 190: | Line 190: | ||
# Create a new partition | # Create a new partition | ||
# Mount this new partition over <code>/mnt</code> <syntaxhighlight lang="console"> | # Mount this new partition over <code>/mnt</code> <syntaxhighlight lang="console"> | ||
# mount /dev/disk/by-label/nix /mnt | # mount -o defaults,noatime /dev/disk/by-label/nix /mnt/nix | ||
</syntaxhighlight> | </syntaxhighlight> | ||
# Copy everything from <code>/nix</code> to <code>/mnt</code> ''Trailing slashes are important'', in that without them, <code>rsync</code> will create an additional directory of the same name at the destination. <syntaxhighlight lang="console"> | # Copy everything from <code>/nix</code> to <code>/mnt</code> ''Trailing slashes are important'', in that without them, <code>rsync</code> will create an additional directory of the same name at the destination. <syntaxhighlight lang="console"> | ||
# rsync --archive -- | # rsync --archive --hard-links --acls --one-file-system --verbose /nix/{store,var} /mnt/nix | ||
</syntaxhighlight> | </syntaxhighlight> | ||
# Mount the new partition as the new <code>/nix</code> <syntaxhighlight lang="console"> | # Mount the new partition as the new <code>/nix</code> <syntaxhighlight lang="console"> | ||
# umount /mnt | # umount /mnt/nix | ||
# mount /dev/disk/by-label/nix /nix | # mount /dev/disk/by-label/nix /nix | ||
</syntaxhighlight> | </syntaxhighlight> |