From owner-freebsd-questions@freebsd.org Sun Apr 29 21:05:57 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E4ECFB8E08 for ; Sun, 29 Apr 2018 21:05:57 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67BB2731E7 for ; Sun, 29 Apr 2018 21:05:56 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([92.195.45.149]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.183]) with ESMTPA (Nemesis) id 0M3jZR-1eMZsM1FVB-00rJka; Sun, 29 Apr 2018 23:05:43 +0200 Date: Sun, 29 Apr 2018 23:05:40 +0200 From: Polytropon To: Manish Jain Cc: Robert Fitzpatrick , FreeBSD Subject: Re: Restoring bootcode Message-Id: <20180429230540.c93489c9.freebsd@edvax.de> In-Reply-To: References: <5AE5F327.3050702@webtent.org> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:E3iyTxuQZ0b1PFkfTaQPYhPCpmGTUPgBGmZv7rEPFTnZw1Kl0Iy ZrVrU47z8zOnlsakplLpvC0KzoSJlkOYOXYLR5CNurtGNqghVgTWPLm6zCxKoKWY9m2sG+g j0N1K9EecKHFKGCcYrTQOfnwq1N6x7imnJaQRGI9a0RnwwZ4YrkgwVGVlYcFu1fG7t1AHof U266DvTFlB27YqVGYyjkw== X-UI-Out-Filterresults: notjunk:1;V01:K0:q0TQ0SY7iDA=:Fk3ell3B382+WJ1YH2KdFV YbNry9VY0UtTmgPZTVRI9eT/bWmVR2B3TYP2T5zKXpsDEP95z8w2c7DNDP37zXgY1jznCtqOm RupmUyMwAx713XXMCcsTWb42wumfPQCdB+MNaCkgSAtfF4LFDn7odMRKytsA7WJjJVGfSIw36 O+r3NSppexKPu8SX9zpNtbQbC+8CNHEjepU7icvGq77RmeGATzLnyl1KDJDRYdmzofP7tnMLw SekF3DFOdwA09XjlehU5aoHVFZrfTVz4AHfZc6ehN/rcCOHzRJuYUKTYy23mUaEDdmZQ2ICuY S9QKD8Y0sNZvXtMZWJQZExdZP57Dft3kBxbLFWvonGyq4kbvks6prhkZ40jqRUAaIUbXxjdZy 5uY8QHWVlwJHhMZMt+PuxKLwps/w6alqKqdpMlNkxei1bBaL+6G0yBiQRqZuY+i+iMah2JHHC tCqucz2bHjmGKwEW6Dvj05QndWB/WXyQ3ExGqefehcm2glsJ10iAQ32G152kw+mKP/DBYyqE1 MNKNdOij3vs2WcJjz3VFLX6xRfK62EMuBwIUW3jPCA91mDip+HzEjiz3o8J9TafX/YxndoDoJ 8rlg/whNXADI+iMSkBkxhc/4YIK2ZDazaNg06rKFowIChaK/Le+LcXfAsmLys4L/x8EGgYoBv 1BAjPkQ9cg/nxehhZbZoWUrmGeMq9sJJV+FchiOCJVZLKT6kGt4uAjsRZSAlYCBwDefQDPylz k3irdFbg0KG8ih58 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Apr 2018 21:05:57 -0000 On Sun, 29 Apr 2018 23:48:04 +0530, Manish Jain wrote: > On 04/29/18 22:00, Robert Fitzpatrick via freebsd-questions wrote: > > Something happens to the bootcode since an upgrade a while back and I'v= e=20 > > been starting this 10.4-RELEASE server at the loader OK prompt using=20 > > 'set currdev=3Ddisk0s1a' and then boot. Here is the server system... > >=20 > > root@dev:~ # gpart show > > =3D>=A0=A0=A0=A0=A0 63=A0 41942977=A0 ada0=A0 MBR=A0 (20G) > > =A0=A0=A0=A0=A0=A0=A0 63=A0 41929587=A0=A0=A0=A0 1=A0 freebsd=A0 [acti= ve]=A0 (20G) > > =A0 41929650=A0=A0=A0=A0 13390=A0=A0=A0=A0=A0=A0=A0 - free -=A0 (6.5M) > >=20 > > =3D>=A0=A0=A0=A0=A0=A0 0=A0 41929587=A0 ada0s1=A0 BSD=A0 (20G) > > =A0=A0=A0=A0=A0=A0=A0=A0 0=A0=A0 1024000=A0=A0=A0=A0=A0=A0 1=A0 freebs= d-ufs=A0 (500M) > > =A0=A0 1024000=A0=A0=A0 524288=A0=A0=A0=A0=A0=A0 2=A0 freebsd-swap=A0 = (256M) > > =A0=A0 1548288=A0 20480000=A0=A0=A0=A0=A0=A0 4=A0 freebsd-ufs=A0 (9.8G) > > =A0 22028288=A0 19901299=A0=A0=A0=A0=A0=A0 5=A0 freebsd-ufs=A0 (9.5G) > >=20 > > I've tried the following to install the boot code, but still ending up= =20 > > at the loader prompt... > >=20 > > root@dev:~ # gpart bootcode -b /boot/mbr ada0 > > bootcode written to ada0 > >=20 > > I also tried with ada0s1 with same result. Clearly I don't understand=20 > > how to get this done, can someone help? > >=20 >=20 > Hi Robert, >=20 > /boot/mbr needs you to set ada0s1 as the active partition. The easier=20 > solution in your case perhaps is: >=20 > gpart bootcode -b /boot/boot0 ada0 > gpart bootcode -b /boot/boot ada0s1 As this seems to be a MBR setup, the commands should probably be: # gpart bootcode -b /boot/mbr ada0 # gpart set -a active -i 1 ada0 # gpart bootcode -b /boot/boot ada0s1 Step 1 will add the regular MBR boot code, assuming this is a FreeBSD-only system (no boot manager required). Step 2 covers the case where the "active" flag has accidentally been cleared; make sure it is set again (so the system will recognize the partition s1 as being active, and attempt booting by transfering control to it). Step 3 will install the kernel loading mechanism for the slice that hosts the FreeBSD partitions (and therefore continue booting the kernel from /boot/kernel/kernel on /dev/ada0s1a, its default location). See "man 8 boot" and "man gpart" (sec. EXAMPLES). Further reading: http://www.wonkity.com/~wblock/docs/html/disksetup.html#_the_old_standard_m= br :-) --=20 Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...