public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Can I move Cygwin and Cygwin64 to a drive other than C: ?
@ 2015-04-01  8:35 Robert Miles
  2015-04-01  8:47 ` Corinna Vinschen
  0 siblings, 1 reply; 11+ messages in thread
From: Robert Miles @ 2015-04-01  8:35 UTC (permalink / raw)
  To: cygwin

The C: drive on one of my 64-bit Windows 7 computers is approaching
90% full, but there are two other drives that are nearly empty.

Can I move the entire Cygwin and Cygwin64 directory trees to one
of the nearly empty drives, without losing the extra packages I've
already downloaded and the files I've created?


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: Can I move Cygwin and Cygwin64 to a drive other than C: ?
  2015-04-01  8:35 Can I move Cygwin and Cygwin64 to a drive other than C: ? Robert Miles
@ 2015-04-01  8:47 ` Corinna Vinschen
  2015-04-01  8:52   ` Corinna Vinschen
  2015-04-02  5:56   ` Robert Miles
  0 siblings, 2 replies; 11+ messages in thread
From: Corinna Vinschen @ 2015-04-01  8:47 UTC (permalink / raw)
  To: cygwin

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

On Apr  1 03:26, Robert Miles wrote:
> The C: drive on one of my 64-bit Windows 7 computers is approaching
> 90% full, but there are two other drives that are nearly empty.
> 
> Can I move the entire Cygwin and Cygwin64 directory trees to one
> of the nearly empty drives, without losing the extra packages I've
> already downloaded and the files I've created?

Robocopy allows to copy an entire Cygwin tree while keeping all
permissions intact.  I had good luck with something along the
lines of

  robocopy C:\cygwin64 D:\cygwin64 /e /purge /z /copyall /sl


YMMV,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

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

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

* Re: Can I move Cygwin and Cygwin64 to a drive other than C: ?
  2015-04-01  8:47 ` Corinna Vinschen
@ 2015-04-01  8:52   ` Corinna Vinschen
  2015-04-02  5:56   ` Robert Miles
  1 sibling, 0 replies; 11+ messages in thread
From: Corinna Vinschen @ 2015-04-01  8:52 UTC (permalink / raw)
  To: cygwin

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

On Apr  1 10:47, Corinna Vinschen wrote:
> On Apr  1 03:26, Robert Miles wrote:
> > The C: drive on one of my 64-bit Windows 7 computers is approaching
> > 90% full, but there are two other drives that are nearly empty.
> > 
> > Can I move the entire Cygwin and Cygwin64 directory trees to one
> > of the nearly empty drives, without losing the extra packages I've
> > already downloaded and the files I've created?
> 
> Robocopy allows to copy an entire Cygwin tree while keeping all
> permissions intact.  I had good luck with something along the
> lines of
> 
>   robocopy C:\cygwin64 D:\cygwin64 /e /purge /z /copyall /sl

Of course, you have to tweak the start menu and desktop shortcuts
manually, so that they point to drive D instead of drive C.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

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

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

* Re: Can I move Cygwin and Cygwin64 to a drive other than C: ?
  2015-04-01  8:47 ` Corinna Vinschen
  2015-04-01  8:52   ` Corinna Vinschen
@ 2015-04-02  5:56   ` Robert Miles
  2015-04-02  8:17     ` Corinna Vinschen
  2015-04-06 21:47     ` Duncan Roe
  1 sibling, 2 replies; 11+ messages in thread
From: Robert Miles @ 2015-04-02  5:56 UTC (permalink / raw)
  To: cygwin

On 4/1/2015 3:47 AM, Corinna Vinschen wrote:
> On Apr  1 03:26, Robert Miles wrote:
>> The C: drive on one of my 64-bit Windows 7 computers is approaching
>> 90% full, but there are two other drives that are nearly empty.
>>
>> Can I move the entire Cygwin and Cygwin64 directory trees to one
>> of the nearly empty drives, without losing the extra packages I've
>> already downloaded and the files I've created?
>
> Robocopy allows to copy an entire Cygwin tree while keeping all
> permissions intact.  I had good luck with something along the
> lines of
>
>    robocopy C:\cygwin64 D:\cygwin64 /e /purge /z /copyall /sl
>
>
> YMMV,
> Corinna

I tried that on C:\cygwin; it gave an error message without copying
anything.  I suspect that was because this directory tree included
links to the top-level directories of all of the Windows drives,
including the one holding the Windows 7 operating system.

I found a way to see the robocopy instructions; it looks like I'll
need to read them thoroughly in order to tell it to copy the links
but not what they point to.



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: Can I move Cygwin and Cygwin64 to a drive other than C: ?
  2015-04-02  5:56   ` Robert Miles
@ 2015-04-02  8:17     ` Corinna Vinschen
  2015-04-02 13:28       ` cyg Simple
  2015-04-04 18:46       ` Eric Pement
  2015-04-06 21:47     ` Duncan Roe
  1 sibling, 2 replies; 11+ messages in thread
From: Corinna Vinschen @ 2015-04-02  8:17 UTC (permalink / raw)
  To: cygwin

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

On Apr  2 00:55, Robert Miles wrote:
> On 4/1/2015 3:47 AM, Corinna Vinschen wrote:
> >On Apr  1 03:26, Robert Miles wrote:
> >>The C: drive on one of my 64-bit Windows 7 computers is approaching
> >>90% full, but there are two other drives that are nearly empty.
> >>
> >>Can I move the entire Cygwin and Cygwin64 directory trees to one
> >>of the nearly empty drives, without losing the extra packages I've
> >>already downloaded and the files I've created?
> >
> >Robocopy allows to copy an entire Cygwin tree while keeping all
> >permissions intact.  I had good luck with something along the
> >lines of
> >
> >   robocopy C:\cygwin64 D:\cygwin64 /e /purge /z /copyall /sl
> >
> >
> >YMMV,
> >Corinna
> 
> I tried that on C:\cygwin; it gave an error message without copying
> anything.

Under an elevated shell?  I *did* move Cygwin installations using
robocopy and the above works for me.  In an elevated shell.

> I suspect that was because this directory tree included
> links to the top-level directories of all of the Windows drives,
> including the one holding the Windows 7 operating system.

That doesn't make sense.

> I found a way to see the robocopy instructions; it looks like I'll
> need to read them thoroughly in order to tell it to copy the links
> but not what they point to.

That doesn't make sense either.  The symlinks created by setup or Cygwin
tools are using POSIX paths, not Windows paths.  Since you're moving the
Cygwin installation as a whole, the reference point for the POSIX root
dir moves as well.  From the Windows (i.e. robocopy) perspective, those
symlinks are simple files with arbitrary content and the DOS system bit
set.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

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

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

* RE: Can I move Cygwin and Cygwin64 to a drive other than C: ?
  2015-04-02  8:17     ` Corinna Vinschen
@ 2015-04-02 13:28       ` cyg Simple
  2015-04-02 14:09         ` Corinna Vinschen
  2015-04-04 18:46       ` Eric Pement
  1 sibling, 1 reply; 11+ messages in thread
From: cyg Simple @ 2015-04-02 13:28 UTC (permalink / raw)
  To: cygwin

> From: Corinna Vinschen
> 
> That doesn't make sense either.  The symlinks created by setup or Cygwin tools
> are using POSIX paths, not Windows paths.  Since you're moving the Cygwin
> installation as a whole, the reference point for the POSIX root dir moves as well.
> From the Windows (i.e. robocopy) perspective, those symlinks are simple files
> with arbitrary content and the DOS system bit set.
> 

I've had issues where I forget to modify /etc/fstab for the new device.

--
cyg Simple


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: Can I move Cygwin and Cygwin64 to a drive other than C: ?
  2015-04-02 13:28       ` cyg Simple
@ 2015-04-02 14:09         ` Corinna Vinschen
  0 siblings, 0 replies; 11+ messages in thread
From: Corinna Vinschen @ 2015-04-02 14:09 UTC (permalink / raw)
  To: cygwin

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

On Apr  2 09:28, cyg Simple wrote:
> > From: Corinna Vinschen
> > 
> > That doesn't make sense either.  The symlinks created by setup or Cygwin tools
> > are using POSIX paths, not Windows paths.  Since you're moving the Cygwin
> > installation as a whole, the reference point for the POSIX root dir moves as well.
> > From the Windows (i.e. robocopy) perspective, those symlinks are simple files
> > with arbitrary content and the DOS system bit set.
> > 
> 
> I've had issues where I forget to modify /etc/fstab for the new device.

The default fstab only contains a single entry for cygdrives, which is
installation path agnostic.  But either way, it wouldn't let robocopy
fail.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

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

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

* Re: Can I move Cygwin and Cygwin64 to a drive other than C: ?
  2015-04-02  8:17     ` Corinna Vinschen
  2015-04-02 13:28       ` cyg Simple
@ 2015-04-04 18:46       ` Eric Pement
  2015-04-04 19:05         ` Andrey Repin
  1 sibling, 1 reply; 11+ messages in thread
From: Eric Pement @ 2015-04-04 18:46 UTC (permalink / raw)
  To: cygwin

Follow-up question for Corinna or anyone who might know the answer:

> >On Apr  1 03:26, Robert Miles wrote:
> > >>Can I move the entire Cygwin and Cygwin64 directory trees to one
> > >>of the nearly empty drives, without losing the extra packages I've
> > >>already downloaded and the files I've created?
> > >
> > >Robocopy allows to copy an entire Cygwin tree while keeping all
> > >permissions intact.  I had good luck with something along the
> > >lines of
> > >
> > >   robocopy C:\cygwin64 D:\cygwin64 /e /purge /z /copyall /sl
. . .
With an added comment that
> I *did* move Cygwin installations using
> robocopy and the above works for me.  In an elevated shell.

I recently needed to move a Cygwin installation, about 6 GB, to
another drive accessible only on a network file system. Due to the
number of files, copying everything would have taken a week or more,
because everything slows down when the number of files increases.

The solution I ultimately took was not the best. I compressed
everything into a single *.7z (7-zip) archive, moved the single
archive across the network, and uncompressed the *.7z archive on the
target machine.

Although the total time was much, much faster (maybe 5 or 6 hours,
including 30 minutes to uncompress the archive), all my file
permissions were set to the same value, regardless of what they had
been previously, and any extended attributes were lost entirely.

I didn't like it, but I had no realistic alternative.

For future resource, what is the best way to archive a Cygwin
installation into a single file, which will preserve all file
properties and permissions, so that the archive can be transferred to
another location? (For the sake of clarity, presume that Cygwin does
NOT exist in the target location, so a non-Cygwin tool must be used to
expand the archive.)

Thanks in advance.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: Can I move Cygwin and Cygwin64 to a drive other than C: ?
  2015-04-04 18:46       ` Eric Pement
@ 2015-04-04 19:05         ` Andrey Repin
  2015-04-04 20:43           ` LRN
  0 siblings, 1 reply; 11+ messages in thread
From: Andrey Repin @ 2015-04-04 19:05 UTC (permalink / raw)
  To: Eric Pement, cygwin

Greetings, Eric Pement!

> Follow-up question for Corinna or anyone who might know the answer:

>> >On Apr  1 03:26, Robert Miles wrote:
>> > >>Can I move the entire Cygwin and Cygwin64 directory trees to one
>> > >>of the nearly empty drives, without losing the extra packages I've
>> > >>already downloaded and the files I've created?
>> > >
>> > >Robocopy allows to copy an entire Cygwin tree while keeping all
>> > >permissions intact.  I had good luck with something along the
>> > >lines of
>> > >
>> > >   robocopy C:\cygwin64 D:\cygwin64 /e /purge /z /copyall /sl
> . . .
> With an added comment that
>> I *did* move Cygwin installations using
>> robocopy and the above works for me.  In an elevated shell.

> I recently needed to move a Cygwin installation, about 6 GB, to
> another drive accessible only on a network file system. Due to the
> number of files, copying everything would have taken a week or more,
> because everything slows down when the number of files increases.

> The solution I ultimately took was not the best. I compressed
> everything into a single *.7z (7-zip) archive, moved the single
> archive across the network, and uncompressed the *.7z archive on the
> target machine.

> Although the total time was much, much faster (maybe 5 or 6 hours,
> including 30 minutes to uncompress the archive), all my file
> permissions were set to the same value, regardless of what they had
> been previously, and any extended attributes were lost entirely.

> I didn't like it, but I had no realistic alternative.

> For future resource, what is the best way to archive a Cygwin
> installation into a single file, which will preserve all file
> properties and permissions, so that the archive can be transferred to
> another location? (For the sake of clarity, presume that Cygwin does
> NOT exist in the target location, so a non-Cygwin tool must be used to
> expand the archive.)

About any sane modern archiving tool can read TAR archives.
And most of them understand gz/xz/bz2 compression.
You could have used any of that to unpack Cygwin to get a bootstrap
environment, then use that environment to unpack the tar with all permisisons
restored.
Alternatively, RAR can add/restore access data.


-- 
With best regards,
Andrey Repin
Saturday, April 4, 2015 21:48:51

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: Can I move Cygwin and Cygwin64 to a drive other than C: ?
  2015-04-04 19:05         ` Andrey Repin
@ 2015-04-04 20:43           ` LRN
  0 siblings, 0 replies; 11+ messages in thread
From: LRN @ 2015-04-04 20:43 UTC (permalink / raw)
  To: cygwin


[-- Attachment #1.1: Type: text/plain, Size: 3104 bytes --]

On 04.04.2015 21:52, Andrey Repin wrote:
> Greetings, Eric Pement!
> 
>> Follow-up question for Corinna or anyone who might know the answer:
> 
>>>> On Apr  1 03:26, Robert Miles wrote:
>>>>>> Can I move the entire Cygwin and Cygwin64 directory trees to one
>>>>>> of the nearly empty drives, without losing the extra packages I've
>>>>>> already downloaded and the files I've created?
>>>>>
>>>>> Robocopy allows to copy an entire Cygwin tree while keeping all
>>>>> permissions intact.  I had good luck with something along the
>>>>> lines of
>>>>>
>>>>>   robocopy C:\cygwin64 D:\cygwin64 /e /purge /z /copyall /sl
>> . . .
>> With an added comment that
>>> I *did* move Cygwin installations using
>>> robocopy and the above works for me.  In an elevated shell.
> 
>> I recently needed to move a Cygwin installation, about 6 GB, to
>> another drive accessible only on a network file system. Due to the
>> number of files, copying everything would have taken a week or more,
>> because everything slows down when the number of files increases.
> 
>> The solution I ultimately took was not the best. I compressed
>> everything into a single *.7z (7-zip) archive, moved the single
>> archive across the network, and uncompressed the *.7z archive on the
>> target machine.
> 
>> Although the total time was much, much faster (maybe 5 or 6 hours,
>> including 30 minutes to uncompress the archive), all my file
>> permissions were set to the same value, regardless of what they had
>> been previously, and any extended attributes were lost entirely.
> 
>> I didn't like it, but I had no realistic alternative.
> 
>> For future resource, what is the best way to archive a Cygwin
>> installation into a single file, which will preserve all file
>> properties and permissions, so that the archive can be transferred to
>> another location? (For the sake of clarity, presume that Cygwin does
>> NOT exist in the target location, so a non-Cygwin tool must be used to
>> expand the archive.)
> 
> About any sane modern archiving tool can read TAR archives.
> And most of them understand gz/xz/bz2 compression.
> You could have used any of that to unpack Cygwin to get a bootstrap
> environment, then use that environment to unpack the tar with all permisisons
> restored.

Agreed. I do this regularly (for a different reason), and all you need is a
small subset of Cygwin that can support tar and gz/bz2/xz/whatever you use to
compress the files. My subset is 21 megabytes when uncompressed; in your case
it can be much smaller, as i also have wget and its dependencies, and i'm
forming that subset automatically by unpacking packages (which means a lot of
unneeded files are installed). You may need to run some kind of chown/chmod
combo after unpacking that subset.

Another interesting scenario is to use icacls to save ACLs of files, then use
it on target machine to restore them.

Also, you can just *install* a minimal set of Cygwin packages on the target
machine normally.



-- 
O< ascii ribbon - stop html email! - www.asciiribbon.org

[-- Attachment #1.2: 0x922360B0.asc --]
[-- Type: application/pgp-keys, Size: 1747 bytes --]

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

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

* Re: Can I move Cygwin and Cygwin64 to a drive other than C: ?
  2015-04-02  5:56   ` Robert Miles
  2015-04-02  8:17     ` Corinna Vinschen
@ 2015-04-06 21:47     ` Duncan Roe
  1 sibling, 0 replies; 11+ messages in thread
From: Duncan Roe @ 2015-04-06 21:47 UTC (permalink / raw)
  To: cygwin

On Thu, Apr 02, 2015 at 12:55:51AM -0500, Robert Miles wrote:
> On 4/1/2015 3:47 AM, Corinna Vinschen wrote:
> >On Apr  1 03:26, Robert Miles wrote:
> >>The C: drive on one of my 64-bit Windows 7 computers is approaching
> >>90% full, but there are two other drives that are nearly empty.
> >>
> >>Can I move the entire Cygwin and Cygwin64 directory trees to one
> >>of the nearly empty drives, without losing the extra packages I've
> >>already downloaded and the files I've created?
> >
> >Robocopy allows to copy an entire Cygwin tree while keeping all
> >permissions intact.  I had good luck with something along the
> >lines of
> >
> >   robocopy C:\cygwin64 D:\cygwin64 /e /purge /z /copyall /sl
> >
> >
> >YMMV,
> >Corinna
>
> I tried that on C:\cygwin; it gave an error message without copying
> anything.  I suspect that was because this directory tree included
> links to the top-level directories of all of the Windows drives,
> including the one holding the Windows 7 operating system.
>
> I found a way to see the robocopy instructions; it looks like I'll
> need to read them thoroughly in order to tell it to copy the links
> but not what they point to.
>
Yes robocopy does have an option to copy symlinks rather than what they point
to: I saw it in the robocopy instructions that you're about to read.

Cheers ... Duncan.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

end of thread, other threads:[~2015-04-06 21:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-01  8:35 Can I move Cygwin and Cygwin64 to a drive other than C: ? Robert Miles
2015-04-01  8:47 ` Corinna Vinschen
2015-04-01  8:52   ` Corinna Vinschen
2015-04-02  5:56   ` Robert Miles
2015-04-02  8:17     ` Corinna Vinschen
2015-04-02 13:28       ` cyg Simple
2015-04-02 14:09         ` Corinna Vinschen
2015-04-04 18:46       ` Eric Pement
2015-04-04 19:05         ` Andrey Repin
2015-04-04 20:43           ` LRN
2015-04-06 21:47     ` Duncan Roe

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