On Wed, Mar 14, 2018 at 6:08 PM, Tinker <t1...@protonmail.ch> wrote:

> Say you have an OpenBSD installation (with /dev and all) mounted on
> /mnt , and you'd like to clone it to /mnt2 , which is a partition
> of different size, so dd is not an option.
>
> For simplicity of the example both the source and destination OS
> installations are on single ffs partitions, e.g. /mnt hosts /dev/sd1a
> which is sd1's only partition, and /mnt2 hosts /dev/sd2a which is sd2's
> only partition.
>
> Can you make cp or some other recursive copying tool properly replicate
> device files, links, file privileges and attributes, user and group
> ownership, and maybe even creation and modification times, so the
> copying together will make /mnt2 a complete and bootable replica of
> /mnt ?
>

Ignoring the "bootable" qualifier which is more about disklabel and
installboot:

cd /mnt && pax -rwpe . /mnt2


Philip Guenther

(Replies that are mangled by protonmail will be ignored.)

Reply via email to