From owner-freebsd-questions@freebsd.org Sun Feb 28 22:58:57 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 31CA3AB8321 for ; Sun, 28 Feb 2016 22:58:57 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F18C71827 for ; Sun, 28 Feb 2016 22:58:56 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de (port-92-195-66-139.dynamic.qsc.de [92.195.66.139]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx02.qsc.de (Postfix) with ESMTPS id CCAE727742; Sun, 28 Feb 2016 23:58:51 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id u1SMwoWJ003173; Sun, 28 Feb 2016 23:58:51 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Sun, 28 Feb 2016 23:58:50 +0100 From: Polytropon To: Bernt Hansson Cc: questions FreeBSD Subject: Re: boot code Message-Id: <20160228235850.5051e942.freebsd@edvax.de> In-Reply-To: <56D376F9.10207@bananmonarki.se> References: <56D376F9.10207@bananmonarki.se> 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-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Feb 2016 22:58:57 -0000 On Sun, 28 Feb 2016 23:38:49 +0100, Bernt Hansson wrote: > Hello list! >=20 > I need to get the boot code on a hdd. > Tried boot0cfg and fdisk -B /dev/ada1 >=20 > But upon a reboot choosing the hdd it just don=B4t boot. The disk needs to have at least one partition that's marked as active, if I remember correctly. This is the "old way" of initializing it: # fdisk -BI /dev/ada1 # bsdlabel -B -w ada0s1 Add "-b /boot/boot0" for the fdisk command if you need to specify the boot code (normal boot or boot manager). If you want to use the whole disk as a "dedicated partition", you can do this: # bsdlabel -w ada1 # bsdlabel -e ada1 set type "4.2BSD" for 'a' partition make 'a' same size as 'c' save # newfs -m 0 -i 16384 -b 16384 -f 2048 -U -t enable -n disable -L ssdroot = /dev/ada1a # bsdlabel -B ada1 Adjust -i, -b and -f according to the expected usage. But that's not a very kind way to deal with disks. :-) You should use gpart today. There is good documentation in "man gpart", as well as those resources: http://www.wonkity.com/~wblock/docs/html/disksetup.html https://www.freebsd.org/doc/handbook/disks-adding.html http://www.freebsd.org/doc/handbook/geom-glabel.html Avoid MBR partitioning if possible - it's considered obsolete, outdated, old-fashioned, stupid and lame. ;-) --=20 Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...