Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 May 2015 16:16:13 +0530
From:      Avinash Sonawane <>
To:        Polytropon <>
Subject:   Re: Swap partition for FreeBSD
Message-ID:  <>
In-Reply-To: <>
References:  <> <> <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
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

Want to link to this message? Use this URL: <>