On 2014-10-27 14:14, Steve Williams wrote:
Hi,

I have an older system on physical hardware that needs upgrading. I've
been procrastinating because it's the type of thing that needs to be
done from start to finish, and it's rather out of date (OpenBSD
5.2-current) so I know there will be all sorts of surprises.

If you follow the Upgrade Guides, there shouldn't be any.  5.2-> 5.3,
5.3 -> 5.4, 5.4 -> 5.5, and then 5.5 -> 5.6 starting on Saturday. :)

I have Virtualbox (2.2.4) running on my Windows PC and able to
boot/install OpenBSD in it.

I had (what I think is) a great thought today that maybe I could
(somehow) restore a backup from my physical hardware into the
Virtualbox VM and do a "test" upgrade there, figuring things out bit
by bit with no pressure of my system being down.  Once I had the
upgrade process figured out, I'd then be better prepared to do it to
my physical system.

Excellent idea

I have never done a dump/restore of a complete system before.  I do
know that on my physical system, the hard disk is sd0 whereas the VM,
it's wd0 (with an OpenBSD 5.5 install... yes, I know 5.6 is imminent).
 Not a big deal to tweak /etc/fstab though.

If your production /etc/fstab used DUID rather than device number, you may
need to revise the DUID in your virtual machine's disklabel rather than
editing fstab(5).  Either way.

I'm reasonably comfortable with dump/restore, but not to completely
"clone" a system.

How can I do a dump of the root filesystem over top of a running
system (in the VM)?   Does it have to be in single user mode?

Are there any other things that are going to need to be tweaked other
than /etc/fstab?

The following how-to is from memory, and I may have missed a step (or
two).  Use only with that understanding.  If' you get confused, let
me know and I'll try to help.

You do the restore from the ramdisk kernel, since restore(8) is
included.  You will need to have a mounted /tmp, since restore
requires it.

1.  Boot the ramdisk kernel, bsd.rd.
2.  Use fdisk(8) to create an MBR on your new system's drive.
3.  Use disklabel(8) to create partitions on your new system's drive.

You can edit by hand or use -R with a copy of your producition
disklabel.  You will create a disklabel with a new DUID either way.

If your fstab(8) uses DUIDs and you wish to retain them, edit the
new drive's DUID to match your production system's.

4. Create, format, and mount a /tmp filesystem.  If you don't have
a /tmp partition or you use MFS for /tmp, you may find your swap
partition "b" is handy to format and mount as /tmp.  Use
disklabel(8) to create the partition, use newfs(8) to format, and
use mount(8), of course.

5. For each filesystem to restore, format with newfs(8) and mount
with mount(8).  For speed during restore, you will find -o async
or -o async,noatime helpful.

6. Now just cd(1) into each mounted, empty filesystem, and restore(8) with -r.
starting with dump level 0 and lather, rinse, repeat with other levels.

7. When each partition has been restored, you may remove the
restoresymtable file in the root of each restored filesystem.

8. You must install bootblocks manually.  For a 5.2 system,
the installboot(8) program is located in /usr/mdec, along with
the biosboot(8) first stage bootloader.  The /boot second stage
bootloader should already be in your root filesystem.

example (for 5.2 and wd0's root partition mounted at /mnt):

# /usr/mdec/installboot -v /mnt/boot /usr/mdec/biosboot wd0

9.  If you need to adjust /etc/fstab instead of DUIDs, edit before
booting.

Reply via email to