GNU bug report logs -
#8636
cp -x flag does not work
Previous Next
Reported by: obb33 <at> verizon.net
Date: Sat, 7 May 2011 20:16:01 UTC
Severity: normal
Done: Jim Meyering <jim <at> meyering.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
obb33 <at> verizon.net wrote:
> coreutils 8.12, i don't know if this problem existed in previous versions.
>
> copying the root directory ( / ) of a running linux system using cp -xdvpR
> cp followed a directory that was mounted via NFS under / . the copy was
> stopped before any other directories on other filesystems were copied so i
> can't speak about how cp would handle those mounts.
tags 8636 + moreinfo
thanks
Thanks for the report.
AFAIK, cp's -x (--one-file-system) option does work.
If it's not working for you, perhaps there is something
unusual about your situation. What does "df" say about
the NFS-mounted directory that was mistakenly copied?
To test it without copying data unnecessarily, I ran this:
mkdir junk && cp -srx / junk
That makes symlinks to the same files that a one-file-system "cp" would
have copied. The only nonempty directories in junk/ correspond to ones
in "/" that reside on the same file system as "/". So at least for me,
it works as advertised. Note that copying each top-level mount point
directory is expected -- those are all empty in the destination (junk/
in my case).
Please provide more details, including
- the precise command you ran
- a sample of the output showing it copying a file that it shouldn't
- what this prints: stat --format=%04D:%n / DIR
where DIR is an NFS-mounted directory that was mistakenly copied
This bug report was last modified 13 years and 248 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.