From owner-freebsd-current@FreeBSD.ORG Thu Oct 22 18:04:42 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 796D4106568D for ; Thu, 22 Oct 2009 18:04:42 +0000 (UTC) (envelope-from serenity@exscape.org) Received: from ch-smtp01.sth.basefarm.net (ch-smtp01.sth.basefarm.net [80.76.149.212]) by mx1.freebsd.org (Postfix) with ESMTP id 2CBD58FC1F for ; Thu, 22 Oct 2009 18:04:41 +0000 (UTC) Received: from c83-253-248-99.bredband.comhem.se ([83.253.248.99]:52059 helo=mx.exscape.org) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1N121e-0007Dz-3u; Thu, 22 Oct 2009 20:04:40 +0200 Received: from [192.168.1.5] (macbookpro [192.168.1.5]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx.exscape.org (Postfix) with ESMTPSA id 58E6D2492C0; Thu, 22 Oct 2009 20:04:37 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes From: Thomas Backman In-Reply-To: <790a9fff0910221049n130c5b00x66071a5a718eb6ab@mail.gmail.com> Date: Thu, 22 Oct 2009 20:04:34 +0200 Content-Transfer-Encoding: 7bit Message-Id: <8AC915BF-E826-4D90-8DD3-00E7FF7F4295@exscape.org> References: <4ADE995A.8080009@ish.com.au> <1256174188.2309.22.camel@balrog.2hip.net> <4ADFCFF3.1030201@ish.com.au> <790a9fff0910220001m3d7df03j127b51d7d0696271@mail.gmail.com> <4AE01342.4000303@ish.com.au> <790a9fff0910221049n130c5b00x66071a5a718eb6ab@mail.gmail.com> To: Scot Hetzel X-Mailer: Apple Mail (2.1076) X-Originating-IP: 83.253.248.99 X-Scan-Result: No virus found in message 1N121e-0007Dz-3u. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1N121e-0007Dz-3u 688ba1322d24f9ed2e316703f3943e98 Cc: freebsd-current@freebsd.org, Aristedes Maniatis Subject: Re: gpart, bsdlabel and fdisk X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2009 18:04:42 -0000 On Oct 22, 2009, at 7:49 PM, Scot Hetzel wrote: > All the guides I had read regarding creating partitions with gpart had > used # sectors instead of specifying the size as 8G. According to > Oliver Roberts ZFS guide (see http://www.keltia.net/howtos/zfsboot), > in order to create a 512MB swap, you have to double the number to get > 1G. Actually, there's a typo in the guide. When you specify 1G, that means 1 GiB, not "1 gigasectors". "gpart add -b 162 -s 1G -t freebsd-swap da0..da1 512 MB swap" ^ should read 1G(i)B swap. "1G" = 1 GiB = 1024*1024*1024 bytes. This is with GPT, but stilll valid: [root@chaos ~]# mkfile -n 2g testdisk [root@chaos ~]# ggatel create -u 2 testdisk [root@chaos ~]# gpart create -s gpt ggate2 ggate2 created [root@chaos ~]# gpart add -s 1G -t freebsd-swap ggate2 ggate2p1 added [root@chaos ~]# gpart show ggate2 => 34 4194237 ggate2 GPT (2.0G) 34 2097152 1 freebsd-swap (1.0G) 2097186 2097085 - free - (1.0G) As you can see, the partition ends up 2097152 sectors * 512 bytes = 1073741824 bytes = exactly 1024*1024*1024 bytes or 1 GiB. Regards, Thomas