From owner-freebsd-questions@FreeBSD.ORG Sat May 16 10:46:35 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C1F3F0D for ; Sat, 16 May 2015 10:46:35 +0000 (UTC) Received: from mail-ig0-x229.google.com (mail-ig0-x229.google.com [IPv6:2607:f8b0:4001:c05::229]) (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 1AF4D16C5 for ; Sat, 16 May 2015 10:46:35 +0000 (UTC) Received: by igbpi8 with SMTP id pi8so56306745igb.0 for ; Sat, 16 May 2015 03:46:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=E+3Jvu2nxPTueV1chBnGK1qGwaKKcVsb1qC4NXfUHoo=; b=hk7RWVqUBfK2jIw+brG4wLcZ+t92NR6Rv0dVHuzKSRPqFB2hVV4kfkA9I6Hr5q2dee br9HCVAjJJCv8NJSxAdleZNq7jLAU26VeBjfWJlvSjEuanI0WPGhN+gYreB6kNF3lTKM VDtEQYytg1PzOzITzZoe/QZgT/jlRzA3cOO+1oR7oonhoGxBYUXyVPgPix5sC8VR0A0v yhP80pGZoyhMCREj229iLAWWLFPrGTbzvLZyQMkCnssIIOhbNRWafbM0SWGWrVKCxIP+ hMvZshQ0I121GKMZQG+leeilfvy2k/y2ao8wsvT+O7v/rvX0PQRybTX5PPjyd1uEzzad hhAg== X-Received: by 10.50.59.211 with SMTP id b19mr3451776igr.42.1431773194062; Sat, 16 May 2015 03:46:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.121.1 with HTTP; Sat, 16 May 2015 03:46:13 -0700 (PDT) In-Reply-To: <20150516123303.8d9cf0dc.freebsd@edvax.de> References: <55570A54.2080107@FreeBSD.org> <20150516123303.8d9cf0dc.freebsd@edvax.de> From: Avinash Sonawane Date: Sat, 16 May 2015 16:16:13 +0530 Message-ID: Subject: Re: Swap partition for FreeBSD To: Polytropon Cc: freebsd-questions@freebsd.org Content-Type: text/plain; charset=UTF-8 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:46:35 -0000 On Sat, May 16, 2015 at 4:03 PM, Polytropon wrote: > 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? I have 4 Primary partitions. Out of which one ada0s1 has FreeBSD, ada0s2 has Debian, ada0s3 is one extra Primary partition (which currently holds data) and ada0s4 is an extended partition (to create further logical partitions like linux-swap, data partitions etc.) > > 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? As `gpart show -p` depicts in the above mentioned paste, I have installed FreeBSD in ada0s1 > > 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. I have Freebsd installed in ada0s1a so can I create ada0s1b inside ada0s1 to have freebsd-swap? How do I do that? Or should I create ada0s6b as swap partition inside ada0s6 slice? -- Avinash Sonawane (RootKea) PICT, Pune http://rootkea.wordpress.com