From nobody Tue Dec 26 20:14:01 2023 X-Original-To: freebsd-fs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T05Zl04yyz55S64 for ; Tue, 26 Dec 2023 20:14:07 +0000 (UTC) (envelope-from SRS0=2BNT=IF=quip.cz=000.fbsd@elsa.codelab.cz) Received: from elsa.codelab.cz (elsa.codelab.cz [94.124.105.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4T05Zk4CtVz3RC4 for ; Tue, 26 Dec 2023 20:14:06 +0000 (UTC) (envelope-from SRS0=2BNT=IF=quip.cz=000.fbsd@elsa.codelab.cz) Authentication-Results: mx1.freebsd.org; none Received: from elsa.codelab.cz (localhost [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id 0BC54D7887; Tue, 26 Dec 2023 21:14:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quip.cz; s=private; t=1703621644; bh=cmUGiX8vPze5mfFdh/ULA4+R1FOErBIB6JRo2ejIwCM=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=MwjE0MW1IqHmpl4LVg4m2cJz6t2ZfldhEwTsp13Wz9q4vCig9PwMY4JP3flbEE5x0 vLLK4/VO+gZSgrNTww75iMgZ9Uv1rlFmDG89EPZpgPiNOtLXymUxysrlnjbfZVQvpe USv2aUordtujRDlnMzjiE9w/WvRxaG3eI+lzq1pw= Received: from [192.168.145.49] (ip-89-177-27-225.bb.vodafone.cz [89.177.27.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by elsa.codelab.cz (Postfix) with ESMTPSA id B46A9D7884; Tue, 26 Dec 2023 21:14:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quip.cz; s=private; t=1703621642; bh=cmUGiX8vPze5mfFdh/ULA4+R1FOErBIB6JRo2ejIwCM=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=feN5ujPOTm2BDX1NdLXNjp2eIKfapv+T1dV6DA+f9hrrn8aHde9MObxWzHVGrNmET aWc5bwmW1IK+fTupVE7xH2I2zF3nTzdnggCH88JOHzdaF6vYZ6TxL1yd3m8INX4HLU u1lr56zREJlH7MkzjpEwnAhqE1G24aNoXcfRAHQo= Message-ID: Date: Tue, 26 Dec 2023 21:14:01 +0100 List-Id: Filesystems List-Archive: https://lists.freebsd.org/archives/freebsd-fs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-fs@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Howto migrate a FreeBSD cloud instance to another one without native FreeBSD support? Content-Language: en-US To: Michael Grimm Cc: freebsd-fs@freebsd.org References: <4A6398FE-5DC1-45A1-85A9-7C5054CF5BF7@ellael.org> From: Miroslav Lachman <000.fbsd@quip.cz> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:42000, ipnet:94.124.104.0/21, country:CZ] X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4T05Zk4CtVz3RC4 On 26/12/2023 19:41, Michael Grimm wrote: > Miroslav Lachman <000.fbsd@quip.cz> wrote; [..] >> I know nothing about OVH and almost nothing about what kind of FreeBSD setup you want to migrate (partitions, UFS vs ZFS etc.) but one thing I can imagine in you situation is creating everything from Linux rescue (partitions, formatting to UFS or ZFS, boot sector, rsync old FreeBSD instance to newly created...) > > Sorry, if I haven't been clear enough: > > #) I do want to migrate an existing ZFS pool (from one instance to another (zfs send | zfs receive). > This I have done numerous times before. > > #) New to me is the preparation of the target disk out of an Ubuntu/Linux rescue system. > Namely, how to partition with Linux functionality (gdisk, cfdisk, …) lacking gpart? I used Linux fdisk about a 15 years ago so I am not the right person to help in this. > Namely, which kind of booting to use (legacy versus EFI)? Legacy (BIOS) or EFI boot is matter of what OVH supports. FreeBSD and Linux supports both. Both will work for a years. >> And the second is: you can prepare small minimalistic FreeBSD image in Bhyve / VirtualBox etc. make a copy of it with dd and then write it by dd to your new instance's disk with the help of Linux rescue system. Then you can reboot to a minimalistic FreeBSD system, enlarge partition(s), use growfs or zpool / zfs enlargement and then finally move data from the old instance to this new instance by rsync, or zfs send, or whatever tool you prefer. > > Thanks for this info, very much appreciated. Do you use swap partition on your old instances? If yes, I would go with the path of creating minimalistic FreeBSD UFS image which you can dd in to target disk with the help of Linux rescue system. You can prepare the image of the size of your swap, write it by dd on to target disk (with the boot sector / boot partition), then you reboot to this FreeBSD instance where you can work with all the FreeBSD tools you like, edit or add partitions, create ZFS pool, use zfs recv etc.. And after all work is done, you can wipe content of this partition and use it as you swap on newly migrated FreeBSD instance. This partition can be few hundreds to 1 GB of size, just to fit the base installation of FreeBSD and tools you need to have for migration. Kind regards Miroslav Lachman