Moving/merging a filesystem back into /

Linda Walsh rsync at tlinx.org
Wed Dec 4 22:03:27 MST 2013


On 12/4/2013 4:01 AM, Charles Marcus wrote:
>
> Thanks Linda... I was initially planning on using cp for this, but 
> someone on the gentoo list convinced me that rsync was better (not 
> sure why now)...
----
    cp didn't support ACL's and xattrs about 3-4 years ago.  rsync was 
maybe the 2nd
large util that did (star was the first, but it doesn't seems as popular 
today)...

>> or "star" would be better.
>> If you have other things mounted on /usr
> For the purpose you are stating, copying all of /usr using "cp"
>
> Nothing else mounted on/under /usr...
>
> But... what exactly is meant by the -x switch ('stay on same filesystem')?
----
If you had a separate /usr/share, for example, when it got to 'share',
the "-x" wouldn't follow that onto the mounted file system.

The reason I mentioned remounting is that a mount can hide files (if you
mount a fs on top of a non-empty directory)... these are all "gotchas", 
most of
which it sounds like you don't need to worry about.

FWIW, I'm talking about the "cp" from coreutils -- you can check the manpage
and -a = --preserve=all, and under all it mentions context, links, 
xattrs, in
addition to ownership/timestamps...etc.


> Currently /usr is on a reiserfs formatted LVM partition, and / is ext3 
> on a regular partition on a hardware RAID mirrored pair...
----

I've never used reiserfs, but I don't see any red flags, either....

For a one time copy... 'cp' should work fine...

Also ... copy it from /usr->/usr.tmp -- that way you don't need to take 
down your
system until the copy is done -- when done. boot into single user or a 
rescue disk
and rename /usr.tmp ->/usr (and fix fstab to not mount the separate /usr)...

Good luck!



More information about the rsync mailing list