Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jul 2014 09:25:58 -0600 (MDT)
From:      Warren Block <wblock@wonkity.com>
To:        Luciano Mannucci <luciano@vespaperitivo.it>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Repairing boot
Message-ID:  <alpine.BSF.2.11.1407100919210.92272@wonkity.com>
In-Reply-To: <20140710151359.58BB2A64@hub.freebsd.org>
References:  <20140710151359.58BB2A64@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.11.1407100919210.92272>