[talk] OpenBSD disk cloning

Dan Cross crossd at gmail.com
Wed Jul 12 13:07:36 EDT 2023


On Fri, Jul 7, 2023 at 6:10 AM Robert Menes <viewtiful.icchan at gmail.com> wrote:
> Hey everyone,
>
> I'm switching the SSD in my OpenBSD laptop out for a larger one, from 128GB to 1TB.
>
> Currently, my OpenBSD install is the normal default partition setup, but I also want to grow /usr/local and /home to take advantage of the added space. I'm on OpenBSD 7.3 and also encrypted my volume at install.
>
> So, threefold problem:
>
> 1) What is a fast, easy way to quickly copy all the existing partitions to the new drive, and
> 2) Should I prepare disk encryption first, before cloning the existing partitions, and

Yes, I would imagine so.  Trying to encrypt the disk after-the-fact
seems fraught.

> 3) I've looked at Clonezilla for 1) but have to consider also growing the partitions I want to grow afterwards; Clonezilla AFAIK doesn't do partition resizing.
>
> What are some solutions or ideas that anyone has that would allow me to even do all this from within OpenBSD itself? This will also be a good learning method to do more with OpenBSD as well!

I think a question I would ask in response to this is: do you have a
way in which you can access both drives from your machine
simultaneously? This may be challenging in a laptop form-factor, but
things like clonezilla would tend to indicate that you may be able to
do so. If that's the case, I think you could do everything online.

If it were me, I would install the second drive and partition and
label it, and create filesystems manually; then, I would mount those
and copy data from the old to the new drive by using dump piped to
restore.

There is reasonably good documentation on the steps involved in the
OpenBSD FAQ: https://www.openbsd.org/faq/faq14.html

> Thanks, everyone!

Hope that helps!

        - Dan C.



More information about the talk mailing list