From owner-freebsd-questions@freebsd.org Tue Mar 1 13:37:31 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 29B68ABE9F6 for ; Tue, 1 Mar 2016 13:37:31 +0000 (UTC) (envelope-from kraduk@gmail.com) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF26F1CB5 for ; Tue, 1 Mar 2016 13:37:30 +0000 (UTC) (envelope-from kraduk@gmail.com) Received: by mail-wm0-x22a.google.com with SMTP id l68so33729572wml.1 for ; Tue, 01 Mar 2016 05:37:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=+MGaI9QozEiHRV5Zpiota1AtRuB9WFdaisvB2RVsy1I=; b=CvqCQKvXayNWxY/K0B7nKwwDyn1sMwzCt2/G1AV8l0W0D8ZdhJskbhPeFaQESj5kt0 SGyEKAPcxYR+T8mjpkvxXBPv/3j4hOLLmgthZxpH28FNNXETNXwbgFg4QFMZyy73+rhe kaojMjAhljNzaphO+1iJRiFbplKC10QifkJn+fyw3pLmgFOd82OeJ2/zMSDaT2zOoJ2p bqiV/4Ak+/W/8KBTh8zR7Cr6cSL8GXL4LkGG7qAqJZA39zYeFHOMGHd6Fv3/nW0Sl/qw TcQQwcYG1tDVkLQ7tbxm72rdCNGigAtpKvtxj+HIcMr1HBfnLH738PdXHvECj7j5CgV2 kLfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=+MGaI9QozEiHRV5Zpiota1AtRuB9WFdaisvB2RVsy1I=; b=Ci/WQ5coZoAvB/Z0wJqZdDAP/WxCWuKBZoFvQQJgX7Kl5K9HaC3ZAlEsobIN2M6RWA 6suyLuWcIkDymi9aqIMPjpCrDvLuK8GRc8W2LpHrZpGYnb4dT++PCMCVCOTnHGI0+g1b 6fm90OeN20K6f/K/b057ZdEqHYhmGuFmaHfTiKg3ScKTXqn1GPgnO7akFKBPW+0RdkJi 64bmpTostPoA0jEo4udmu1nILp2g4oSF1N0rOGIstK99l6UlepJf2UZ8DLB4qoIqoDz7 m22UvCHit2OiM43y1kYyxa2fgjn6bl0GaVkxUYl8UAo+UDXyyUCTryQ3dqk7Y8Phnvlk hTWg== X-Gm-Message-State: AD7BkJL//Bo2nxrcVzYjg7eGMJLTRqbxasSzHYVFGyjBzguZkTlsCOohajTfhnerfxPIcgrzJTCsLXLhW/I+3Q== MIME-Version: 1.0 X-Received: by 10.194.113.130 with SMTP id iy2mr20580652wjb.56.1456839449082; Tue, 01 Mar 2016 05:37:29 -0800 (PST) Received: by 10.28.31.77 with HTTP; Tue, 1 Mar 2016 05:37:29 -0800 (PST) In-Reply-To: <56D58DF1.4060307@bananmonarki.se> References: <56D376F9.10207@bananmonarki.se> <20160228235850.5051e942.freebsd@edvax.de> <56D48D29.4060608@bananmonarki.se> <20160229194502.eebeabd6.freebsd@edvax.de> <56D58DF1.4060307@bananmonarki.se> Date: Tue, 1 Mar 2016 13:37:29 +0000 Message-ID: Subject: Re: boot code From: krad To: Bernt Hansson Cc: Polytropon , questions FreeBSD Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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: Tue, 01 Mar 2016 13:37:31 -0000 GPT is the way to go for future proofing and is backwards compatible in most cases. One addition this I would do is always add an EFI partition as well. Again this is for future proofing. On 1 March 2016 at 12:41, Bernt Hansson wrote: > On 2016-02-29 19:45, Polytropon wrote: > >> On Mon, 29 Feb 2016 19:25:45 +0100, Bernt Hansson wrote: >> >>> On 2016-02-28 23:58, Polytropon wrote: >>> >>>> On Sun, 28 Feb 2016 23:38:49 +0100, Bernt Hansson wrote: >>>> >>>>> Hello list! >>>>> >>>>> I need to get the boot code on a hdd. >>>>> Tried boot0cfg and fdisk -B /dev/ada1 >>>>> >>>>> But upon a reboot choosing the hdd it just don=C2=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. ;-) >>>> >>>> Thank you but no cigar. >>> >>> The machine is amd64 10.2-R so my guess its gpt. >>> >> >> 10.2 and amd64 doesn't exclude the use of MBR or dedicated. :-) >> When using GPT, both fdisk and bsdlabel are quite useless. >> (They are also obsolete as gpart can do MBR partitioning, too.) >> >> So in your case, the following approach should work: >> >> # gpart create -s gpt ada1 >> # gpart add -t freebsd-boot -l gpboot -b 40 -s 512K ada1 >> # gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada1 >> >> After installing the boot code, add data partions as desired: >> >> # gpart add -t freebsd-ufs -l gprootfs -b 1M -s ada1 >> >> Refer to: >> >> >> http://www.wonkity.com/~wblock/docs/html/disksetup.html#_the_new_standar= d_gpt >> >> Tried GPT and it ask for bootcode and not booting, so MBR it is. > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to " > freebsd-questions-unsubscribe@freebsd.org"