From owner-freebsd-questions@freebsd.org Fri Sep 13 19:57:46 2019 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAE15D16BB for ; Fri, 13 Sep 2019 19:57:46 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) Received: from holgerdanske.com (holgerdanske.com [184.105.128.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "xray.he.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46VRJ94jp0z43V0 for ; Fri, 13 Sep 2019 19:57:45 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) Received: from 99.100.19.101 ([99.100.19.101]) by holgerdanske.com with ESMTPSA (ECDHE-RSA-AES128-GCM-SHA256:TLSv1.2:Kx=ECDH:Au=RSA:Enc=AESGCM(128):Mac=AEAD) (SMTP-AUTH username dpchrist@holgerdanske.com, mechanism PLAIN) for ; Fri, 13 Sep 2019 12:57:39 -0700 Subject: Re: Moving boot disk - does not seem easy? To: freebsd-questions@freebsd.org References: <03d6bfcb-aaad-c3a5-d2a6-b14f819113c2@mansionfamily.plus.com> From: David Christensen Message-ID: <6bf3e5dd-24f8-0f06-031d-91724cf2c0a7@holgerdanske.com> Date: Fri, 13 Sep 2019 12:57:24 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <03d6bfcb-aaad-c3a5-d2a6-b14f819113c2@mansionfamily.plus.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 46VRJ94jp0z43V0 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of dpchrist@holgerdanske.com has no SPF policy when checking 184.105.128.27) smtp.mailfrom=dpchrist@holgerdanske.com X-Spamd-Result: default: False [-0.06 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-0.84)[-0.844,0]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; IP_SCORE(-0.49)[ipnet: 184.104.0.0/15(0.80), asn: 6939(-3.19), country: US(-0.05)]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.63)[-0.628,0]; TO_DN_NONE(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[27.128.105.184.list.dnswl.org : 127.0.10.0]; R_SPF_NA(0.00)[]; DMARC_NA(0.00)[holgerdanske.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:6939, ipnet:184.104.0.0/15, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2019 19:57:46 -0000 On 9/12/19 2:26 PM, james wrote: > I had thought that this would be straightforward but it seems not. > > I have a freebsd 12 system, UFS boots /ada0p2.  Mounts some ZFS > partitions and I'm away. > > I add a new PCIe card with a SATA SSD, and it grabs ada0. > > I want to move my boot to the SSD, not least because the boot priority > now favours it as ada0, and I had to manually boot ada1p2. > > There's not much on ada1p2 now, but I want the new ada0p2 to be smaller, > so dd is not attractive. > > What's the easiest way to set ata0 to be much like ada0p2 was (given > that I booted from ada1p2)? > > Ideally I'd like boot and swap etc set up as well, which I kinda did > already with sade. > > I already had the issue with freebsd-install/MANIFTEST missing and did a > basic install to ada0, but it seems a bit naff to unmount all my ZFS > mountpoints just to tar across all the rest of it. > > Any pointers? I have been installing FreeBSD-11.2-RELEASE-amd64 via BIOS, the FreeBSD installer, and "ZFS (Auto)" partitioning. The installer applies MBR partitioning to the system drive. If I then attempt to migrate such a system image to a different device via dd(1) (no size changes), I have found that the destination device may not boot. The problem is that /boot/loader.conf encodes device nodes in various variable names and/or values. The work-around is to use a FreeBSD installer rescue shell, live image, etc., edit /boot/loader.conf on the target system drive as required, and move aside /boot/zfs/zpool.cache on the target system drive. I believe a better solution is use UEFI, GPT partitioning, and GPT labels. If the labels can then used throughout the bootloader chain, this would eliminate the device node problems when moving system images between devices. While it should be possible to partition the new SSD, change partition sizes, create file systems, dump(8) and restore(8) boot and/or root, find and fix all necessary configuration files, etc., I would feel more confident backing up the old system drive, disconnecting the old system drive, disconnecting the data drives, installing the new system drive, doing a fresh install (using UEFI boot, GPT partitioning, and labels), updating FreeBSD, restoring the system drive, and reconnecting/ reconfiguring the data drives. David