[talk] OpenBSD disk cloning

jpb jpb at jimby.name
Sat Jul 8 12:34:52 EDT 2023

On Fri, 7 Jul 2023 06:09:53 -0400
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
> 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!
> Thanks, everyone!
> --Robert

Hi Robert,

I'm old school, so take this with a grain of (old) salt.

I normally manage two machines for just this scenario.  When I need to
update, I prepare the other ("new") machine:

 * with the latest OS, repartitioning as part of the base install
 * install the same packages/ports (includes all dependencies)
 * copy any user data from old to new, usually using rsync which you
   can find in the packages repo (see
 * after that, i test for a day or two, then just use the new system,
   putting the old system aside until the next update.

This way is more expensive, but it's also very reliable in that if
anything breaks with the new install or package updates, I can just
continue using the current system until any issues are resolved.

Hope this helps,
Jim B.

More information about the talk mailing list