From owner-freebsd-questions@FreeBSD.ORG Sat May 16 10:33:14 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3817AC9A for ; Sat, 16 May 2015 10:33:14 +0000 (UTC) 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 EDF1115C1 for ; Sat, 16 May 2015 10:33:13 +0000 (UTC) Received: from r56.edvax.de (port-92-195-97-206.dynamic.qsc.de [92.195.97.206]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx02.qsc.de (Postfix) with ESMTPS id E397427711; Sat, 16 May 2015 12:33:04 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id t4GAX3p7002549; Sat, 16 May 2015 12:33:04 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Sat, 16 May 2015 12:33:03 +0200 From: Polytropon To: Avinash Sonawane Cc: freebsd-questions@freebsd.org Subject: Re: Swap partition for FreeBSD Message-Id: <20150516123303.8d9cf0dc.freebsd@edvax.de> In-Reply-To: References: <55570A54.2080107@FreeBSD.org> 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=US-ASCII Content-Transfer-Encoding: 7bit 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: Sat, 16 May 2015 10:33:14 -0000 On Sat, 16 May 2015 15:16:56 +0530, Avinash Sonawane wrote: > On Sat, May 16, 2015 at 2:43 PM, Matthew Seaman wrote: > > > partitioning and is incompatible with the gpt disk labels you have. > > No. I don't have GPT disk labels. I have MBR partitioning scheme. In that case, your partitioning scheme looks a little bit strange in retrospect. You said that you're using ada0s6 for swap. In MBR terminology, s6 is a "logical drive inside a DOS extended partition". Why do you construct something that complicated? Typically, you use _one_ "DOS primary partition" - in BSD called a slice - to carry the FreeBSD filesystems _and_ the swap partition, for example: ada0s1a = / ada0s1b = swap <- not a separate slice! ada0s1d = /tmp ada0s1e = /var ada0s1f = /usr ada0s1g = /home With gpart or (the old-fashioned) fdisk, you would create the slice, then use bsdlabel to create the partitions inside that slice. Those that are _not_ swap partitions would then be formatted with a UFS file system; swap doesn't need to be formatted. Now, when you're using MBR, and ada0s6 should be your swap device, where's the rest of your system? You could probably use fdisk to access ada0s6 and create the swap partition ada0s6b. See "man fdisk" for examples. But keep mind that using fdisk and bsdlabel, as well as using MBR instead of GPT, is nowadays considered "not good anymore", even though it should still work, even when "extended partitions" (see above) are involved... > After searching a bit on the web I came to know that default kernel > build options specify "options GEOM_PART_EBR_COMPAT" which prevents > GEOM from editing EBR partition schemes. So to create a partition of > type freebsd-swap in extended partition it looks like I need to > recompile the kernel without the GEOM_PART_EBR_COMPAT kernel option. It seems to be that way. Using "extended DOS partitions" has never been a good idea. :-) However, as I initially wrote, this isn't _needed_ when you put the swap partition into the slice where the rest of your FreeBSD installation resides. You can have up to 4 "DOS primary partitions" (slices), and each one could carry an independent OS install. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...