[talk] OpenBSD disk cloning

Robert Menes viewtiful.icchan at gmail.com
Sat Jul 8 17:14:39 EDT 2023

This might be a doable solution, but I do have another question to go along
with this, because I don't want to play guesswork with what's currently
installed on my system and what I have to reinstall on the new drive.

Do OpenBSD's pkg utilities (pkg_add, pkg_info, etc.) have an option to
output to a file a list of all installed packages? IIRC dpkg on Debian, or
its apt tools, have an option you can pass into them to dump out a whole
list of installed packages to a text file, which can be read back in on a
new system to install all the same packages back in again. Everything else
like custom configuration and such can easily be put onto a USB stick and
migrated over, or I can put them into a private GitHub repo, clone it into
the new machine, and put everything into place.

On Sat, Jul 8, 2023, 12:34 jpb <jpb at jimby.name> wrote:

> 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
>    https://www.openbsd.org/faq/faq15.html#Intro)
>  * 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.nycbug.org:8443/pipermail/talk/attachments/20230708/70ee4e1e/attachment.htm>

More information about the talk mailing list