Re: How copy /usr contents to a new partition?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday, Jan 13th 2006 at 13:20 +0530, quoth Parameshwara Bhat:

=>I want to copy /usr to a new partition and then attach that at /usr. I issued
=>a command
=>
=>	cp -options(recursive included) /usr /mnt/"mountpoint
=>
=>This resulted in the creation of a new "usr" directory under
=>/mnt/"mountpoint"/usr and contents of /usr went into sub-directories. What I
=>want is to copy all the subdirectories and files directly under /usr to go at
=>/mnt/"mountpoint" for obvious reasons. How do I do that? "Man cp" did not give
=>me any clue.
=>
=>Also, is there a command which compares each file under two directory trees
=>for difference.(I want to verify after the above operation)

The proper way to do this is as follows:

cd src
find . -print | cpio -pdvum dest

You can use tar on linux because linux tar is enhanced to know about 
things besides directories and files. i.e., it knows about devices, 
symlinks, etc...

But the idiom to learn is the cpio incantation above. The -p is called 
passthrough mode. -d sez create dirs as needed, -v is verbose, -u sez to 
preserve usernames and -m is mod time preservation. 

Also, when copying withing the same physical device, you can add -l which 
creates hardlinks is no time.

-- 
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux