OPNsense Forum

English Forums => General Discussion => Topic started by: Taunt9930 on June 02, 2023, 07:12:59 pm

Title: Migrate to new SSD
Post by: Taunt9930 on June 02, 2023, 07:12:59 pm
Hi All,

I had an SSD failure in my OPNSense appliance (Pondesk). Whilst diagnosing the issue, I fitted a 'temporary' 128Gb SSD I had laying around to fault find, and ended up re-building my system. It is an old SSD, so for piece of mind I would like to replace it with a new 250Gb version I now have.

Is there an easy way / best practice to migrate from one SSD to the other? I am a Windows man, so may need some help with shell commands if there is a way to image to an external drive/USB directly - that might be useful for backup.

Equipment I have, that might be useful:

256 Gb USB Stick
1 x USB to SATA Drive adaptor - I could use this to connect to either the appliance (would this work?) or indeed my windows Machine.
128Gb SSD - in Appliance, running OPNSense.
250 Gb SSD - intended target / replacement.
Windows 11 machine with USB (no spare SATA slots, sadly).
I do also have a paid version of Macrium Reflect Home (v8) Installed on my Windows 11 machine.

Filesystem is ZFS

I do, of course, appreciate that there will have to be down-time to swap the drives over - that's fine.

Thanks  :)
Title: Re: Migrate to new SSD
Post by: bartjsmit on June 02, 2023, 07:44:25 pm
If you have storage on the network, boot OPNsense from a CloneZilla USB stick and copy the drive to an image.

Fit the new drive and use CloneZilla again to copy the image to the drive. This will work as long as you're going for larger drives.

https://clonezilla.org/liveusb.php

Bart...
Title: Re: Migrate to new SSD
Post by: Patrick M. Hausen on June 02, 2023, 11:57:29 pm
Can you fit both SSDs into your system at the same time? In that case it would be dead easy with just FreeBSD tools.
Title: Re: Migrate to new SSD
Post by: Taunt9930 on June 03, 2023, 09:48:53 pm
Thanks both.

Sadly, no, only one SSD interface in my appliance.

I'll give Clonzilla live a whirl.
Title: Re: Migrate to new SSD
Post by: cookiemonster on June 03, 2023, 10:36:53 pm
Unless I misunderstand the question, wouldn't be a suitable option to install to the new disk and restore config?
Easy when no additional packages are installed.
Title: Re: Migrate to new SSD
Post by: tiermutter on June 03, 2023, 10:49:55 pm
Filesystem is ZFS

Then a nice and easy way would be to create a boot environment and export (e.g. to network share) via bemanager. After installing OPNsense on new SSD the backup can be restored via bemanager again.
That's the way I'm creating backups before installing major updates.
But for this one-time-job I would just clone the disk with any tool on Win or clonezilla, when a simple config restore is not helpful.
Title: Re: Migrate to new SSD
Post by: Taunt9930 on June 04, 2023, 09:04:46 am
Unless I misunderstand the question, wouldn't be a suitable option to install to the new disk and restore config?
Easy when no additional packages are installed.

Hi cookiemonster, a fair question! However, I have various packages and other manual tweaks installed for other stuff like Grafana dashboards that would not get restored, hence the need to replicated the filesystem for a speedy recovery.
Title: Re: Migrate to new SSD
Post by: Taunt9930 on June 04, 2023, 09:10:18 am
Filesystem is ZFS

Then a nice and easy way would be to create a boot environment and export (e.g. to network share) via bemanager. After installing OPNsense on new SSD the backup can be restored via bemanager again.
That's the way I'm creating backups before installing major updates.
But for this one-time-job I would just clone the disk with any tool on Win or clonezilla, when a simple config restore is not helpful.

Ooh, that sounds interesting for an ongoing backup process. I've done a quick search for bemanager and only this post came up. I'll do some research elsewhere. If you happen to know any resources you could quickly point to, that would be much appreciated.

Thanks all, very much appreciate your time/responses.

 
Title: Re: Migrate to new SSD
Post by: tiermutter on June 04, 2023, 10:22:46 am
Here are some instructions: https://github.com/JRGTH/bemanager

You can create BEs directly from
Code: [Select]
bemanager, but I have never done this, instead I use
Code: [Select]
bectl to manage BEs: https://forum.opnsense.org/index.php?topic=25540.msg122731#msg122731