all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* moving /gnu to different disk
@ 2016-01-12 21:39 carl hansen
  2016-01-12 22:29 ` Leo Famulari
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: carl hansen @ 2016-01-12 21:39 UTC (permalink / raw)
  To: help-guix

[-- Attachment #1: Type: text/plain, Size: 588 bytes --]

Rather than trying the following, I thought, "Why not ask first?"

Due to the sizes of various hard disks in my machine, I want to move /gnu
to /directoryondifferentdisk/gnu
and then do
mount --bind /directoryondifferentdisk/gnu /gnu

(I have already formed a superstition that
ln -s /directoryondifferentdisk/gnu /gnu
won't work)

I see a vast collection of hard links in /gnu/store/.links...

I forsee problems when copying /gnu, not reproducing hard links
but reproducing the data.

Are my fears founded? How to proceed?
Or better to start over with new installation of gnux and /gnu?

[-- Attachment #2: Type: text/html, Size: 812 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: moving /gnu to different disk
  2016-01-12 21:39 moving /gnu to different disk carl hansen
@ 2016-01-12 22:29 ` Leo Famulari
  2016-01-13 11:12   ` Ludovic Courtès
  2016-01-12 22:29 ` Andreas Enge
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Leo Famulari @ 2016-01-12 22:29 UTC (permalink / raw)
  To: carl hansen; +Cc: help-guix

On Tue, Jan 12, 2016 at 01:39:02PM -0800, carl hansen wrote:
> Rather than trying the following, I thought, "Why not ask first?"
> 
> Due to the sizes of various hard disks in my machine, I want to move /gnu
> to /directoryondifferentdisk/gnu
> and then do
> mount --bind /directoryondifferentdisk/gnu /gnu
> 
> (I have already formed a superstition that
> ln -s /directoryondifferentdisk/gnu /gnu
> won't work)
> 
> I see a vast collection of hard links in /gnu/store/.links...
> 
> I forsee problems when copying /gnu, not reproducing hard links
> but reproducing the data.

You could try moving the data with `rsync --hard-links`. Of course you
should test that it works as expected first or you might end up out of
space on the new device, too!

From the rsync man page:
-H, --hard-links            preserve hard links

Of course, there may be a better solution altogether.

> 
> Are my fears founded? How to proceed?
> Or better to start over with new installation of gnux and /gnu?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: moving /gnu to different disk
  2016-01-12 21:39 moving /gnu to different disk carl hansen
  2016-01-12 22:29 ` Leo Famulari
@ 2016-01-12 22:29 ` Andreas Enge
  2016-01-13  4:31   ` carl hansen
  2016-01-13 11:14 ` Efraim Flashner
  2016-01-13 18:06 ` Christopher Allan Webber
  3 siblings, 1 reply; 8+ messages in thread
From: Andreas Enge @ 2016-01-12 22:29 UTC (permalink / raw)
  To: carl hansen; +Cc: help-guix

On Tue, Jan 12, 2016 at 01:39:02PM -0800, carl hansen wrote:
> I forsee problems when copying /gnu, not reproducing hard links
> but reproducing the data.

You can use rsync with the option "-H" to preserve hard links.

I think your proposed solution with bind mounts will work, but I let
the specialists confirm.

Andreas

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: moving /gnu to different disk
  2016-01-12 22:29 ` Andreas Enge
@ 2016-01-13  4:31   ` carl hansen
  0 siblings, 0 replies; 8+ messages in thread
From: carl hansen @ 2016-01-13  4:31 UTC (permalink / raw)
  To: Andreas Enge; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 660 bytes --]

On Tue, Jan 12, 2016 at 2:29 PM, Andreas Enge <andreas@enge.fr> wrote:

> On Tue, Jan 12, 2016 at 01:39:02PM -0800, carl hansen wrote:
> > I forsee problems when copying /gnu, not reproducing hard links
> > but reproducing the data.
>
> You can use rsync with the option "-H" to preserve hard links.
>
> I think your proposed solution with bind mounts will work, but I let
> the specialists confirm.
>
> Andreas
>
> Thanks, Andreas and Leo, the

rsync -Hav /gnu/ /directoryondifferentdisk/gnu
rm -rf /gnu
mkdir /gnu

mount --bind /directoryondifferentdisk/gnu /gnu

seems to be working perfectly.

I hope this question and answer is put into GUIX faq somehow.

[-- Attachment #2: Type: text/html, Size: 1482 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: moving /gnu to different disk
  2016-01-12 22:29 ` Leo Famulari
@ 2016-01-13 11:12   ` Ludovic Courtès
  0 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2016-01-13 11:12 UTC (permalink / raw)
  To: Leo Famulari; +Cc: help-guix

Leo Famulari <leo@famulari.name> skribis:

> On Tue, Jan 12, 2016 at 01:39:02PM -0800, carl hansen wrote:
>> Rather than trying the following, I thought, "Why not ask first?"
>> 
>> Due to the sizes of various hard disks in my machine, I want to move /gnu
>> to /directoryondifferentdisk/gnu
>> and then do
>> mount --bind /directoryondifferentdisk/gnu /gnu
>> 
>> (I have already formed a superstition that
>> ln -s /directoryondifferentdisk/gnu /gnu
>> won't work)
>> 
>> I see a vast collection of hard links in /gnu/store/.links...
>> 
>> I forsee problems when copying /gnu, not reproducing hard links
>> but reproducing the data.
>
> You could try moving the data with `rsync --hard-links`.

In fact you can also omit /gnu/store/.links when copying.  Nothing is
lost by doing so.  This directory simply contains a hash-to-file mapping
used by the deduplication mechanism.

However, make sure do copy /var/guix in addition to /gnu/store!
/var/guix/db/db.sqlite is the database containing meta-data for
/gnu/store, so things will break badly if it’s missing or out-of-sync.

HTH,
Ludo’.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: moving /gnu to different disk
  2016-01-12 21:39 moving /gnu to different disk carl hansen
  2016-01-12 22:29 ` Leo Famulari
  2016-01-12 22:29 ` Andreas Enge
@ 2016-01-13 11:14 ` Efraim Flashner
  2016-01-15 14:06   ` Mark H Weaver
  2016-01-13 18:06 ` Christopher Allan Webber
  3 siblings, 1 reply; 8+ messages in thread
From: Efraim Flashner @ 2016-01-13 11:14 UTC (permalink / raw)
  To: carl hansen; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 1025 bytes --]

On Tue, 12 Jan 2016 13:39:02 -0800
carl hansen <carlhansen1234@gmail.com> wrote:

> Rather than trying the following, I thought, "Why not ask first?"
> 
> Due to the sizes of various hard disks in my machine, I want to move /gnu
> to /directoryondifferentdisk/gnu
> and then do
> mount --bind /directoryondifferentdisk/gnu /gnu
> 
> (I have already formed a superstition that
> ln -s /directoryondifferentdisk/gnu /gnu
> won't work)
> 
> I see a vast collection of hard links in /gnu/store/.links...
> 
> I forsee problems when copying /gnu, not reproducing hard links
> but reproducing the data.
> 
> Are my fears founded? How to proceed?
> Or better to start over with new installation of gnux and /gnu?

When I moved mine from / to a new partition I did `cp -a` and it all worked well.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: moving /gnu to different disk
  2016-01-12 21:39 moving /gnu to different disk carl hansen
                   ` (2 preceding siblings ...)
  2016-01-13 11:14 ` Efraim Flashner
@ 2016-01-13 18:06 ` Christopher Allan Webber
  3 siblings, 0 replies; 8+ messages in thread
From: Christopher Allan Webber @ 2016-01-13 18:06 UTC (permalink / raw)
  To: carl hansen; +Cc: help-guix

carl hansen writes:

> Rather than trying the following, I thought, "Why not ask first?"
>
> Due to the sizes of various hard disks in my machine, I want to move /gnu
> to /directoryondifferentdisk/gnu
> and then do
> mount --bind /directoryondifferentdisk/gnu /gnu
>
> (I have already formed a superstition that
> ln -s /directoryondifferentdisk/gnu /gnu
> won't work)
>
> I see a vast collection of hard links in /gnu/store/.links...
>
> I forsee problems when copying /gnu, not reproducing hard links
> but reproducing the data.
>
> Are my fears founded? How to proceed?
> Or better to start over with new installation of gnux and /gnu?

On my last machine I started out with a too-small root partition, but I
was installing a lot of guix packages, so I bind-mounted /home/guix-gnu/
to /gnu/ and everything worked great.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: moving /gnu to different disk
  2016-01-13 11:14 ` Efraim Flashner
@ 2016-01-15 14:06   ` Mark H Weaver
  0 siblings, 0 replies; 8+ messages in thread
From: Mark H Weaver @ 2016-01-15 14:06 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: help-guix

Efraim Flashner <efraim@flashner.co.il> writes:

> On Tue, 12 Jan 2016 13:39:02 -0800
> carl hansen <carlhansen1234@gmail.com> wrote:
>
>> Rather than trying the following, I thought, "Why not ask first?"
>> 
>> Due to the sizes of various hard disks in my machine, I want to move /gnu
>> to /directoryondifferentdisk/gnu
>> and then do
>> mount --bind /directoryondifferentdisk/gnu /gnu
>> 
>> (I have already formed a superstition that
>> ln -s /directoryondifferentdisk/gnu /gnu
>> won't work)
>> 
>> I see a vast collection of hard links in /gnu/store/.links...
>> 
>> I forsee problems when copying /gnu, not reproducing hard links
>> but reproducing the data.
>> 
>> Are my fears founded? How to proceed?
>> Or better to start over with new installation of gnux and /gnu?
>
> When I moved mine from / to a new partition I did `cp -a` and it all worked well.

Yes, and 'cp' is many times faster than rsync.  On one non-trivial test,
I found that it was around 8 times faster.

      Mark

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-01-15 14:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-12 21:39 moving /gnu to different disk carl hansen
2016-01-12 22:29 ` Leo Famulari
2016-01-13 11:12   ` Ludovic Courtès
2016-01-12 22:29 ` Andreas Enge
2016-01-13  4:31   ` carl hansen
2016-01-13 11:14 ` Efraim Flashner
2016-01-15 14:06   ` Mark H Weaver
2016-01-13 18:06 ` Christopher Allan Webber

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.