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

Re: [Xen-users] dual personalities - solved!



Kent Watsen <kent@xxxxxxxxxx> writes:

> I should have called:
> 
>     cp -ax /mnt/hdb1/* /mnt/suse-root

Using cp with multiple (esp. directory) arguments often does not
exactly what one expects, because it works very similar to

    for d in /mnt/hdb1/*; do cp -ax $d /mnt/suse-root; done

and that means, a file that is hardlinked in several of these
directories will not be hardlinked in the copy, but instead you will
have multiple copies of it.  I have sometimes used something like

    cp -ax /mnt/hdb1 /mnt/suse-root
    mv /mnt/suse-root/hdb1/* /mnt/suse-root
    rmdir /mnt/suse-root/hdb1

instead but usually I prefer using tar that doesn't have this problem
(or dd if copying whole block devices as in your case).

Having hardlinks between different top-level directories is very
unlikely it's not a problem in this case but you should always
remember this behavior when cp'ing multiple directories.


urs

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.