From nobody Fri Sep 2 00:20:39 2022 X-Original-To: freebsd-questions@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 4MJdqM548sz4b8kX for ; Fri, 2 Sep 2022 00:20:47 +0000 (UTC) (envelope-from freebsd@gushi.org) Received: from prime.gushi.org (prime.gushi.org [IPv6:2620:137:6000:10::142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "prime.gushi.org", Issuer "RapidSSL TLS DV RSA Mixed SHA256 2020 CA-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MJdqM1097z4FL4 for ; Fri, 2 Sep 2022 00:20:47 +0000 (UTC) (envelope-from freebsd@gushi.org) Received: from smtpclient.apple ([IPv6:2601:602:87f:b05d:a8aa:e32b:2b06:f9e3]) (authenticated bits=0) by prime.gushi.org (8.16.1/8.16.1) with ESMTPSA id 2820Kiw1096184 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 1 Sep 2022 17:20:45 -0700 (PDT) (envelope-from freebsd@gushi.org) DKIM-Filter: OpenDKIM Filter v2.10.3 prime.gushi.org 2820Kiw1096184 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gushi.org; s=prime2014; t=1662078045; bh=jZqudlLzt3YjTdPH3lHD4AY33V53uP1xsSpz8U7c9RI=; h=Subject:From:In-Reply-To:Date:Cc:References:To; z=Subject:=20Re:=20making=20a=20disk/slice=20bootable|From:=20Dan=2 0Mahoney=20|In-Reply-To:=20<07BE254D-7701-47F2- 94E3-09ED7229FB2B@gushi.org>|Date:=20Thu,=201=20Sep=202022=2017:20 :39=20-0700|Cc:=20FreeBSD-questions=20|References:=20=0D=0A=20<07BE254D-7701-47F2-94E3-09ED7229 FB2B@gushi.org>|To:=20paul=20beard=20; b=bQY7nICJjDkXNjXF6MOkNl/Ni3o1GokI3wIMeNGo0uujzgFBoGmHgcNUbGpup4jiE lxfwUuvWSzeQJoUbguh28/iG/at2snPt6kSxo/7CnL6KKt/s3iGuc4Ffd/8T3wcSEt GEk6pwtn1FNRZdQ2ttjP6R7I7T5SuJp22U7xyrEC/kfIsiXNhZHGZysSIbiafj6a9O BARwoPwDk//0LXcU3Hpjv0f79xUMMMgmaQfZz7KvPUTwszPcBkdUxXvJCKFGSAqpYJ yXTH0sWOzyXP8YJHWd3Zlu1lBwoNyXfL++qllQ5TfZb2BEkSmx3bdnwidBSqMmeA4I qkMXiU/6H68Zw== X-Authentication-Warning: prime.gushi.org: Host [IPv6:2601:602:87f:b05d:a8aa:e32b:2b06:f9e3] claimed to be smtpclient.apple Content-Type: text/plain; charset=us-ascii List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: making a disk/slice bootable From: Dan Mahoney In-Reply-To: <07BE254D-7701-47F2-94E3-09ED7229FB2B@gushi.org> Date: Thu, 1 Sep 2022 17:20:39 -0700 Cc: FreeBSD-questions Content-Transfer-Encoding: quoted-printable Message-Id: References: <07BE254D-7701-47F2-94E3-09ED7229FB2B@gushi.org> To: paul beard X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4MJdqM1097z4FL4 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gushi.org header.s=prime2014 header.b=bQY7nICJ; dmarc=pass (policy=none) header.from=gushi.org; spf=pass (mx1.freebsd.org: domain of freebsd@gushi.org designates 2620:137:6000:10::142 as permitted sender) smtp.mailfrom=freebsd@gushi.org X-Spamd-Result: default: False [-6.20 / 15.00]; DWL_DNSWL_MED(-2.00)[gushi.org:dkim]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[gushi.org,none]; MV_CASE(0.50)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; R_DKIM_ALLOW(-0.20)[gushi.org:s=prime2014]; R_SPF_ALLOW(-0.20)[+mx]; RCVD_IN_DNSWL_MED(-0.20)[2620:137:6000:10::142:from]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCPT_COUNT_TWO(0.00)[2]; TO_DN_ALL(0.00)[]; HAS_XAW(0.00)[]; ASN(0.00)[asn:393507, ipnet:2620:137:6000::/44, country:US]; DKIM_TRACE(0.00)[gushi.org:+]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Fdisk is for old-school partitions (where disks had only 1-4 primary = partitions, and then subdivided those partitions into "slices" = (bsdlabel). I'm pretty sure the command you're looking for is: gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada1 In english, this says: * Stick the "protective master boot record" on the root of the disk = (/boot/pmbr) * Write a partition boot label from the file specified... * to this indexed partition (-i 1)=20 * ...on ada1 =46rom there, you may need to tell the stage 0 loader where to find your = next bootable partition on the next boot() prompt. -Dan > On Sep 1, 2022, at 16:44, Dan Mahoney wrote: >=20 >=20 >=20 >> On Sep 1, 2022, at 16:41, paul beard wrote: >>=20 >> I have been mirroring the virtual disk in a FreeBSD vm for a couple = of years and the main disk got corrupted. The mirrored disk doesn't = boot, says it can't find a kernel, so I think I missed out on an = additional step, writing an MBR or boot sector, perhaps.=20 >>=20 >> The files are all there if I mount them from a VM with FreeBSD.I = assume there is a way to make a mountable disk bootable. fdisk and = gpart are available but it's been a long time since I messed around with = those.=20 >=20 > Let's start with the obvious: Can you post your disk layout? Mirrored = how? Gmirror/ZFS/Hardware raid/etc? MBR or Gpart? >=20 > What commands have you tried thusfar? >=20 > What does the boot so far look like (i.e. are you hitting the stage 0 = boot loader, and getting the loader prompt?) >=20 > More info required, please, but this sounds very fixable. >=20 > -Dan