From owner-freebsd-questions@FreeBSD.ORG Thu Jul 10 15:26:00 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70D7927E for ; Thu, 10 Jul 2014 15:26:00 +0000 (UTC) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F0F825F5 for ; Thu, 10 Jul 2014 15:25:59 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.9/8.14.9) with ESMTP id s6AFPwdA020544 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 10 Jul 2014 09:25:58 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.9/8.14.9/Submit) with ESMTP id s6AFPwim020541; Thu, 10 Jul 2014 09:25:58 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Thu, 10 Jul 2014 09:25:58 -0600 (MDT) From: Warren Block To: Luciano Mannucci Subject: Re: Repairing boot In-Reply-To: <20140710151359.58BB2A64@hub.freebsd.org> Message-ID: References: <20140710151359.58BB2A64@hub.freebsd.org> User-Agent: Alpine 2.11 (BSF 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Thu, 10 Jul 2014 09:25:58 -0600 (MDT) Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2014 15:26:00 -0000 On Thu, 10 Jul 2014, Luciano Mannucci wrote: > > Hi gurus! > I'm new to freebsd (I come from linux/solaris/hp-ux). I've messed up > my startup after upgrading from 9.1 to 9.2 some time ago. Today I > tried to repair my foxconn amd64 small box via the command > > # boot0cfg -B -s 2 /dev/ada0 > > But if I try to boot I get > > F2 ? > F6 PXE > > Boot: F1 > > and it doesn't do anything. If I bootstrap starting from an USB key, > escaping to boot prompt, issuing a set currdev=disk2p2 followed by > boot-conf does the trick. > > what have I missed? "p2" suggests the disk has a GPT partitioning scheme. The old boot0 multi-boot loader is not meant for GPT, only MBR. Writing the normal GPT bootcode will fix that particular problem. Use 'gpart show' to verify that the disk is using GPT and the partition number of the freebsd-boot partition. For example: % gpart show ada0 => 34 500118125 ada0 GPT (238G) 34 6 - free - (3.0K) 40 1024 1 freebsd-boot (512K) 1064 984 - free - (492K) 2048 4194304 2 freebsd-ufs (2.0G) 4196352 4194304 3 freebsd-ufs (2.0G) 8390656 491727496 4 freebsd-ufs (234G) 500118152 7 - free - (3.5K) The first line shows that this disk uses GPT partitioning. In the third column, "1" is the partition number of the freebsd-boot partition. To write the GPT bootcode: # gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0 There might still be a problem booting if /etc/fstab refers to disks rather than labels and the disk numbers have changed. If that happens, please show the output of 'gpart show' and the contents of /etc/fstab.