public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* permission question
@ 2016-12-07 15:48 Greg Freemyer
  2016-12-07 16:02 ` Gluszczak, Glenn
  2016-12-07 18:22 ` Greg Freemyer
  0 siblings, 2 replies; 10+ messages in thread
From: Greg Freemyer @ 2016-12-07 15:48 UTC (permalink / raw)
  To: cygwin

I have a USB drive with 100,000's of thousands of files I put on it
from one PC.  I've built that dataset up over a couple years.

I moved the USB drive to a different PC and I'm trying to rsync it to
another drive.

99.9% of the data seems to have made its way from one drive to the other.

But I got a few permission denied messages when reading files off of
the source drive.

I really don't need anything but the equivalent of 666 permissions for
the source drive files.

I know linux well, but I have screwed up Windows permissions once too often.

Is there a command I should run in Windows or cygwin to grant my user
read/write permission to all of the files?

Or I can parse the rsync log file I created and look for the handful
of files that failed with permission denied.

Thanks
Greg
--
Greg Freemyer

--
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] 10+ messages in thread

* RE: permission question
  2016-12-07 15:48 permission question Greg Freemyer
@ 2016-12-07 16:02 ` Gluszczak, Glenn
  2016-12-07 18:22 ` Greg Freemyer
  1 sibling, 0 replies; 10+ messages in thread
From: Gluszczak, Glenn @ 2016-12-07 16:02 UTC (permalink / raw)
  To: cygwin


I've found recently while using cp or rsync that the Administrator account could not access files or set back permissions for files with System account privileges.
I had to resort to xcopy to do things properly.

-----Original Message-----
From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com] On Behalf Of Greg Freemyer
Sent: Wednesday, December 07, 2016 10:48 AM
To: cygwin@cygwin.com
Subject: permission question

I have a USB drive with 100,000's of thousands of files I put on it from one PC.  I've built that dataset up over a couple years.

I moved the USB drive to a different PC and I'm trying to rsync it to another drive.

99.9% of the data seems to have made its way from one drive to the other.

But I got a few permission denied messages when reading files off of the source drive.

I really don't need anything but the equivalent of 666 permissions for the source drive files.

I know linux well, but I have screwed up Windows permissions once too often.

Is there a command I should run in Windows or cygwin to grant my user read/write permission to all of the files?

Or I can parse the rsync log file I created and look for the handful of files that failed with permission denied.

Thanks
Greg
--
Greg Freemyer

--
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] 10+ messages in thread

* Re: permission question
  2016-12-07 15:48 permission question Greg Freemyer
  2016-12-07 16:02 ` Gluszczak, Glenn
@ 2016-12-07 18:22 ` Greg Freemyer
  2016-12-07 18:48   ` Stephen John Smoogen
  1 sibling, 1 reply; 10+ messages in thread
From: Greg Freemyer @ 2016-12-07 18:22 UTC (permalink / raw)
  To: cygwin

On Wed, Dec 7, 2016 at 10:47 AM, Greg Freemyer <greg.freemyer@gmail.com> wrote:
> I have a USB drive with 100,000's of thousands of files I put on it
> from one PC.  I've built that dataset up over a couple years.
>
> I moved the USB drive to a different PC and I'm trying to rsync it to
> another drive.
>
> 99.9% of the data seems to have made its way from one drive to the other.
>
> But I got a few permission denied messages when reading files off of
> the source drive.
>
> I really don't need anything but the equivalent of 666 permissions for
> the source drive files.
>
> I know linux well, but I have screwed up Windows permissions once too often.
>
> Is there a command I should run in Windows or cygwin to grant my user
> read/write permission to all of the files?
>
> Or I can parse the rsync log file I created and look for the handful
> of files that failed with permission denied.
>
> Thanks

It's worst than I thought.

I used rsync -avP to make the copy of the folders / files.   (Its
2.5TB, so it took all day yesterday to run).

I'm trying now to use "rsync -cvr" to compare the checksums of the
source / destination and re-copy any that got corrupted.

The trouble is lots of the destination files can't be read due to
permission issues, so the compare doesn't match and the rsync is
copying the same files again.

I admit to having little understanding of the Windows / cygwin
permissions integration.  Or even Windows permissions standalone.  I
do understand Linux permissions well.

I'm tempted to just do a "chmod 755 -R .", but I've just had too many
windows permission issues in the last year to start trying things
without guidance.

Greg

--
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] 10+ messages in thread

* Re: permission question
  2016-12-07 18:22 ` Greg Freemyer
@ 2016-12-07 18:48   ` Stephen John Smoogen
  2016-12-07 19:06     ` Greg Freemyer
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen John Smoogen @ 2016-12-07 18:48 UTC (permalink / raw)
  To: cygwin

On 7 December 2016 at 13:22, Greg Freemyer <greg.freemyer@gmail.com> wrote:
> On Wed, Dec 7, 2016 at 10:47 AM, Greg Freemyer <greg.freemyer@gmail.com> wrote:
>> I have a USB drive with 100,000's of thousands of files I put on it
>> from one PC.  I've built that dataset up over a couple years.
>>
>> I moved the USB drive to a different PC and I'm trying to rsync it to
>> another drive.
>>
>> 99.9% of the data seems to have made its way from one drive to the other.
>>
>> But I got a few permission denied messages when reading files off of
>> the source drive.
>>
>> I really don't need anything but the equivalent of 666 permissions for
>> the source drive files.
>>
>> I know linux well, but I have screwed up Windows permissions once too often.
>>
>> Is there a command I should run in Windows or cygwin to grant my user
>> read/write permission to all of the files?
>>
>> Or I can parse the rsync log file I created and look for the handful
>> of files that failed with permission denied.
>>
>> Thanks
>
> It's worst than I thought.
>
> I used rsync -avP to make the copy of the folders / files.   (Its
> 2.5TB, so it took all day yesterday to run).
>
> I'm trying now to use "rsync -cvr" to compare the checksums of the
> source / destination and re-copy any that got corrupted.
>
> The trouble is lots of the destination files can't be read due to
> permission issues, so the compare doesn't match and the rsync is
> copying the same files again.
>
> I admit to having little understanding of the Windows / cygwin
> permissions integration.  Or even Windows permissions standalone.  I
> do understand Linux permissions well.
>
> I'm tempted to just do a "chmod 755 -R .", but I've just had too many
> windows permission issues in the last year to start trying things
> without guidance.

That would probably make things worse. I believe that Windows
permissions are like attribs in Linux (which moves it into witchcraft
and sorcery). For dealing with this sort of issue I would look at
using the xcopy that Glenn from dell mentioned.

> Greg
>
> --
> 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
>



-- 
Stephen J Smoogen.

--
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] 10+ messages in thread

* Re: permission question
  2016-12-07 18:48   ` Stephen John Smoogen
@ 2016-12-07 19:06     ` Greg Freemyer
  2016-12-07 20:12       ` Erik Soderquist
  0 siblings, 1 reply; 10+ messages in thread
From: Greg Freemyer @ 2016-12-07 19:06 UTC (permalink / raw)
  To: cygwin

On Wed, Dec 7, 2016 at 1:48 PM, Stephen John Smoogen <smooge@gmail.com> wrote:
>> I'm tempted to just do a "chmod 755 -R .", but I've just had too many
>> windows permission issues in the last year to start trying things
>> without guidance.
>
> That would probably make things worse. I believe that Windows
> permissions are like attribs in Linux (which moves it into witchcraft
> and sorcery). For dealing with this sort of issue I would look at
> using the xcopy that Glenn from dell mentioned.
>
>> Greg

I really like cygwin and have used it for a decade plus.  Only in the
last year or 18-months have I noticed significant permission issues
that slow down my workflow.

Copying these folders/files from one drive to another is a task I'd
like to accomplish, but even more importantly I'd like to understand
how to work with permissions in cygwin.  As it is, I'm concerned I
will have to leave cygwin behind and I don't want to do that.

Greg
--
Greg Freemyer

--
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] 10+ messages in thread

* Re: permission question
  2016-12-07 19:06     ` Greg Freemyer
@ 2016-12-07 20:12       ` Erik Soderquist
  2016-12-07 20:39         ` Brian Inglis
  0 siblings, 1 reply; 10+ messages in thread
From: Erik Soderquist @ 2016-12-07 20:12 UTC (permalink / raw)
  To: cygwin

> I really like cygwin and have used it for a decade plus.  Only in the
> last year or 18-months have I noticed significant permission issues
> that slow down my workflow.
>
> Copying these folders/files from one drive to another is a task I'd
> like to accomplish, but even more importantly I'd like to understand
> how to work with permissions in cygwin.  As it is, I'm concerned I
> will have to leave cygwin behind and I don't want to do that.

I've been a Windows and Linux admin for years, and Windows permissions
can be a pain, but can also be very granular.

What I normally do for something like this is use robocopy's "backup mode"
switch to bypass permissions on the source entirely and intentionally not
copy the permissions to the destination, then set up the permissions I want
on the destination after the copy is complete.

The "backup mode" option requires either backup operator or local admin
permissions to use.

-- Erik

--
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] 10+ messages in thread

* Re: permission question
  2016-12-07 20:12       ` Erik Soderquist
@ 2016-12-07 20:39         ` Brian Inglis
  2016-12-07 22:09           ` Greg Freemyer
  0 siblings, 1 reply; 10+ messages in thread
From: Brian Inglis @ 2016-12-07 20:39 UTC (permalink / raw)
  To: cygwin

On 2016-12-07 13:12, Erik Soderquist wrote:
>> I really like cygwin and have used it for a decade plus.  Only in the
>> last year or 18-months have I noticed significant permission issues
>> that slow down my workflow.
>>
>> Copying these folders/files from one drive to another is a task I'd
>> like to accomplish, but even more importantly I'd like to understand
>> how to work with permissions in cygwin.  As it is, I'm concerned I
>> will have to leave cygwin behind and I don't want to do that.
> 
> I've been a Windows and Linux admin for years, and Windows permissions
> can be a pain, but can also be very granular.
> 
> What I normally do for something like this is use robocopy's "backup mode"
> switch to bypass permissions on the source entirely and intentionally not
> copy the permissions to the destination, then set up the permissions I want
> on the destination after the copy is complete.
> 
> The "backup mode" option requires either backup operator or local admin
> permissions to use.

Concur and recommend for local copies:

robocopy src dst /s /sl /xj /copyall /zb /nfl /ndl /np /mt:8 /r:0 /w:0

to copy non-empty directories; keep winsymlinks as is; skip junctions; 
all info; backup fallback; no file, directory, or progress logging; 
8 threads, no retries, no waits: use /copy (like cp -p) instead of 
/copyall to skip security info.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
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] 10+ messages in thread

* Re: permission question
  2016-12-07 20:39         ` Brian Inglis
@ 2016-12-07 22:09           ` Greg Freemyer
  2016-12-07 22:28             ` Erik Soderquist
  2016-12-07 23:06             ` Michel LaBarre
  0 siblings, 2 replies; 10+ messages in thread
From: Greg Freemyer @ 2016-12-07 22:09 UTC (permalink / raw)
  To: Brian.Inglis, cygwin

If I'm going to relegate rsync to the trash bin due to it not
supporting Windows permissions well enough to be useful, I've got
other Windows recursive copy tools I use that don't preserve
permissions either.

I can't tell you how much I love Windows security permissions.  :(

In the mean time I have a huge number of folders now on my destination
drive I need to delete.  (over a million files it seems).

Neither cygwin, nor windows says I have permission to delete them.

Any idea how I can do it short of reformating.

Thanks
Greg
--
Greg Freemyer


On Wed, Dec 7, 2016 at 3:39 PM, Brian Inglis
<Brian.Inglis@systematicsw.ab.ca> wrote:
> On 2016-12-07 13:12, Erik Soderquist wrote:
>>> I really like cygwin and have used it for a decade plus.  Only in the
>>> last year or 18-months have I noticed significant permission issues
>>> that slow down my workflow.
>>>
>>> Copying these folders/files from one drive to another is a task I'd
>>> like to accomplish, but even more importantly I'd like to understand
>>> how to work with permissions in cygwin.  As it is, I'm concerned I
>>> will have to leave cygwin behind and I don't want to do that.
>>
>> I've been a Windows and Linux admin for years, and Windows permissions
>> can be a pain, but can also be very granular.
>>
>> What I normally do for something like this is use robocopy's "backup mode"
>> switch to bypass permissions on the source entirely and intentionally not
>> copy the permissions to the destination, then set up the permissions I want
>> on the destination after the copy is complete.
>>
>> The "backup mode" option requires either backup operator or local admin
>> permissions to use.
>
> Concur and recommend for local copies:
>
> robocopy src dst /s /sl /xj /copyall /zb /nfl /ndl /np /mt:8 /r:0 /w:0
>
> to copy non-empty directories; keep winsymlinks as is; skip junctions;
> all info; backup fallback; no file, directory, or progress logging;
> 8 threads, no retries, no waits: use /copy (like cp -p) instead of
> /copyall to skip security info.
>
> --
> Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
>
> --
> 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
>

--
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] 10+ messages in thread

* Re: permission question
  2016-12-07 22:09           ` Greg Freemyer
@ 2016-12-07 22:28             ` Erik Soderquist
  2016-12-07 23:06             ` Michel LaBarre
  1 sibling, 0 replies; 10+ messages in thread
From: Erik Soderquist @ 2016-12-07 22:28 UTC (permalink / raw)
  To: cygwin

On Wed, Dec 7, 2016 at 5:08 PM, Greg Freemyer <greg.freemyer@gmail.com> wrote:
> If I'm going to relegate rsync to the trash bin due to it not
> supporting Windows permissions well enough to be useful, I've got
> other Windows recursive copy tools I use that don't preserve
> permissions either.

I still use rsync in cygwin, just not on things that have "separate"
windows permissions

> I can't tell you how much I love Windows security permissions.  :(

Same!

> In the mean time I have a huge number of folders now on my destination
> drive I need to delete.  (over a million files it seems).
>
> Neither cygwin, nor windows says I have permission to delete them.
>
> Any idea how I can do it short of reformating.

This will obliterate the permissions, so you are aware up front...

In the Windows security dialog, go to advanced --> owner, and forcibly
take recursive ownership of the tree.  On annything you do not have
access to, Windows should prompt you to overwrite the security so you
do have access.  Local Admin is required to be able to do this.

-- Erik

--
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] 10+ messages in thread

* RE: permission question
  2016-12-07 22:09           ` Greg Freemyer
  2016-12-07 22:28             ` Erik Soderquist
@ 2016-12-07 23:06             ` Michel LaBarre
  1 sibling, 0 replies; 10+ messages in thread
From: Michel LaBarre @ 2016-12-07 23:06 UTC (permalink / raw)
  To: 'Greg Freemyer', Brian.Inglis, cygwin



> -----Original Message-----
> From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com] On
> Behalf Of Greg Freemyer
> Sent: December-07-16 5:08 PM
> To: Brian.Inglis@systematicsw.ab.ca; cygwin@cygwin.com
> Subject: Re: permission question
> 
> If I'm going to relegate rsync to the trash bin due to it not
> supporting Windows permissions well enough to be useful, I've got
> other Windows recursive copy tools I use that don't preserve
> permissions either.
> 
> I can't tell you how much I love Windows security permissions.  :(
> 
> In the mean time I have a huge number of folders now on my destination
> drive I need to delete.  (over a million files it seems).
> 
> Neither cygwin, nor windows says I have permission to delete them.
> 
> Any idea how I can do it short of reformating.


You should be able to take ownership recursively of the offending files and then remove them.
(Right click - Security => Advanced => Owner Tab => Edit (you may be prompted by UAC for admin credentials) => Other users or groups => pick one
Don't forget to select "Replace owner on subcontainers and objects".  In a separate step, reset the permissions recursively to get full control, then delete everything.)

By the way, did you ever try to setup fstab to apply noacl to default mounts before doing your rsynch?
I wonder if that would have reduced your problems.


> 
> Thanks
> Greg
> --
> Greg Freemyer
> 
> 
> On Wed, Dec 7, 2016 at 3:39 PM, Brian Inglis
> <Brian.Inglis@systematicsw.ab.ca> wrote:
> > On 2016-12-07 13:12, Erik Soderquist wrote:
> >>> I really like cygwin and have used it for a decade plus.  Only in the
> >>> last year or 18-months have I noticed significant permission issues
> >>> that slow down my workflow.
> >>>
> >>> Copying these folders/files from one drive to another is a task I'd
> >>> like to accomplish, but even more importantly I'd like to understand
> >>> how to work with permissions in cygwin.  As it is, I'm concerned I
> >>> will have to leave cygwin behind and I don't want to do that.
> >>
> >> I've been a Windows and Linux admin for years, and Windows
> permissions
> >> can be a pain, but can also be very granular.
> >>
> >> What I normally do for something like this is use robocopy's "backup
> mode"
> >> switch to bypass permissions on the source entirely and intentionally not
> >> copy the permissions to the destination, then set up the permissions I
> want
> >> on the destination after the copy is complete.
> >>
> >> The "backup mode" option requires either backup operator or local admin
> >> permissions to use.
> >
> > Concur and recommend for local copies:
> >
> > robocopy src dst /s /sl /xj /copyall /zb /nfl /ndl /np /mt:8 /r:0 /w:0
> >
> > to copy non-empty directories; keep winsymlinks as is; skip junctions;
> > all info; backup fallback; no file, directory, or progress logging;
> > 8 threads, no retries, no waits: use /copy (like cp -p) instead of
> > /copyall to skip security info.
> >
> > --
> > Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
> >
> > --
> > 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
> >
> 
> --
> 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


--
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] 10+ messages in thread

end of thread, other threads:[~2016-12-07 23:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-07 15:48 permission question Greg Freemyer
2016-12-07 16:02 ` Gluszczak, Glenn
2016-12-07 18:22 ` Greg Freemyer
2016-12-07 18:48   ` Stephen John Smoogen
2016-12-07 19:06     ` Greg Freemyer
2016-12-07 20:12       ` Erik Soderquist
2016-12-07 20:39         ` Brian Inglis
2016-12-07 22:09           ` Greg Freemyer
2016-12-07 22:28             ` Erik Soderquist
2016-12-07 23:06             ` Michel LaBarre

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