From owner-freebsd-questions@freebsd.org Mon Nov 7 21:18:47 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3AF7C3466F for ; Mon, 7 Nov 2016 21:18:47 +0000 (UTC) (envelope-from mike@milibyte.co.uk) Received: from avasout07.plus.net (avasout07.plus.net [84.93.230.235]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client CN "Bizanga Labs SMTP Client Certificate", Issuer "Bizanga Labs CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C6F383A for ; Mon, 7 Nov 2016 21:18:46 +0000 (UTC) (envelope-from mike@milibyte.co.uk) Received: from curlew.milibyte.co.uk ([80.229.31.82]) by avasout07 with smtp id 59Fa1u0021mJoLY019FbWn; Mon, 07 Nov 2016 21:15:35 +0000 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.2 cv=TLMHcBta c=1 sm=1 tr=0 a=cd0K7rcWwnZFf6xQxRobyA==:117 a=cd0K7rcWwnZFf6xQxRobyA==:17 a=kj9zAlcOel0A:10 a=MKtGQD3n3ToA:10 a=L24OOQBejmoA:10 a=dik7HMQjudEA:10 a=ZZnuYtJkoWoA:10 a=s9oXJcMGAAAA:8 a=czbyN2X7Sxa4wQM1hR4A:9 a=CjuIK1q_8ugA:10 a=cNNliUDrGJfcKjVfkxUC:22 Received: from curlew.lan ([192.168.1.13]) by curlew.milibyte.co.uk with esmtp (Exim 4.87) (envelope-from ) id 1c3rGL-0000n4-0l for freebsd-questions@freebsd.org; Mon, 07 Nov 2016 21:15:32 +0000 Date: Mon, 7 Nov 2016 21:15:28 +0000 From: Mike Clarke To: freebsd-questions@freebsd.org Message-ID: <20161107211528.0362a4a5@curlew.lan> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 X-SA-Exim-Connect-IP: 192.168.1.13 X-SA-Exim-Mail-From: mike@milibyte.co.uk X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on curlew.lan X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 Subject: Unable to boot after adding an extra partition. Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SA-Exim-Version: 4.2 X-SA-Exim-Scanned: Yes (on curlew.milibyte.co.uk) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 21:18:47 -0000 My current motherboard uses BIOS boot but in preparation for the new motherboard I'll be installing soon I thought I'd add an efi boot partition. Somewhere along the way I must have done something wrong because I ended up being locked out and unable to boot. curlew:/home/mike% uname -a FreeBSD curlew.lan 11.0-RELEASE-p2 FreeBSD 11.0-RELEASE-p2 #0: Mon Oct 24 06:55:27 UTC 2016 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 I have a ZFS mirror running on a couple of SSD's at ada0 and ada3. When I installed them a couple of years ago I left some spare space in readiness for this: => 34 250069613 ada0 GPT (119G) 34 6 - free - (3.0K) 40 1024 1 bios-boot (512K) 1064 3032 - free - (1.5M) 4096 230686720 2 freebsd-zfs (110G) 230690816 19378831 - free - (9.2G) I added a 512K efi partition with: gpart add -t efi -b 2048 -s 1024 -l efiboot1 ada0 gpart add -t efi -b 2048 -s 1024 -l efiboot2 ada3 This created a new partition with index 3 on each drive between the partitions numbered 1 and 2 with some free space on each side. I then created /EFI/BOOT in each efi partition and copied /boot/boot1.efi into it. I was then unable to boot my system, it just hung immediately after the "Verifying DMI Pool Data" message. I ran "gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0", and likewise for ada3, in case the boot partition had been corrupted but that made no difference. After this I deleted the efi partition, and re-ran gpart bootcode, to revert to the original configuration. When I next rebooted it failed with: Verifying DMI Pool Data ............. Missing boot loader As a workaround I've used zfs send | zfs receive to copy my ZFS filesystem to a spare hard drive and taken the SSD's out of service until I can resolve the boot problem. The system is running on the spare drive as a temporary measure so I know there was no problem with the filesystem but what did I do wrong with the boot partitions and how can I rectify the problem? -- Mike Clarke