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

Re: Problem selecting options for cp command



On 9/5/2016 7:46 AM, Mark Fletcher wrote:


On Mon, Sep 5, 2016 at 9:30 PM Richard Owlett
<rowlett@cloud85.net <mailto:rowlett@cloud85.net>> wrote:

    I attempted to copy contents of one partition to another using
         cp -R /media/richard/myrepo /media/richard/test

    /media/richard/myrepo is a hard disk partition
    /media/richard/test   is a USB flash drive

    I received "illegal operation" error messages as symbolic links
    were encountered.
    "man cp" was too terse to be illuminating.


I think cp -a is your best bet. It will copy everything,
shouldn't choke on links, and will also set permissions etc
correctly on the target device, assuming you have permissions to
do so (you should be doing the copy as root, always assuming you
want to keep permissions and access modes intact).

I recently used it to copy hard disk partitions to a replacement
SSD (some discussions about that are in the archives of this
list) and it worked just dandy.

Mark

"archive" had brought up mental image of dusty back rooms where things were being preserved for posterity. Not making a copy to actually be used.

Someone had suggested rsync but that has too many options for me to bungle. "cp" may be slower but appears more comfortable.

Thanks to all.



Reply to: