Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 May 2015 10:13:56 +0100
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: Swap partition for FreeBSD
Message-ID:  <55570A54.2080107@FreeBSD.org>
In-Reply-To: <CAJ9BSW9cVmd8c%2B4E5rWAd9FPDvgpwqVKDSh7962FW3-g_W9jMQ@mail.gmail.com>
References:  <CAJ9BSW9cVmd8c%2B4E5rWAd9FPDvgpwqVKDSh7962FW3-g_W9jMQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--pc2qNR7SocS2d5K6oXtfb001lMktgTLle
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

On 16/05/2015 08:41, Avinash Sonawane wrote:
> I was trying to build www/webkit-gtk3 (a dependency for x11/gnome3)
> then it abruptly exited with "Out of swap space error" so I created a
> separate 8GB partition to be used as freebsd-swap.
>=20
> Here is `gpart show`, `gpart show -p`, `swapinfo` and `/etc/fstab`
> http://pastebin.com/KSFM49yP
>=20
> Now my problem is that I see a message "May 16 12:31:59 titanic
> kernel: GEOM_PART: Partition 'ada0s6' not suitable for kernel dumps
> (wrong type?)" during bootup.
>=20
> And I think that's because though the system is using ada0s6 as swap
> partition (evident from the above pastebin) the partition has a wrong
> type. More specifically it is linux-data instead of freebsd-swap (See
> `gpart show` in above paste)
>=20
> So how do I change the type of ada0s6 to freebsd-swap?
>=20
> I tried `bsdlabel -e ada0s6` but then it said "bsdlabel: /dev/ada0s6:
> no valid label found"
>=20
> Then I tried `gpart modify -i 2878773 -t freebsd-swap ada0s4` then it
> said "gpart: pre-check failed: Operation canceled" (Here 2878773 is
> the index number of ada0s6. See `gpart show` in above pastebin)
>=20
> I tried these 2 approaches after `swapoff /dev/ada0s6` too but they
> throw same error messages as above.
>=20
> So how do I get rid of the above mentioned error message appearing
> during boot or how do I format ada0s6 to freebsd-swap from linux-data?

You're correct to use gpart(8) to create your new swap partition.  Don't
use bsdlabel(8) -- that is for dealing with the really old style of disk
partitioning and is incompatible with the gpt disk labels you have.

Now, in order to fix your problem: you can't change the type of a
partition.  Instead, you need to delete the partition and then create a
new 'freebsd-swap' partition using the same chunk of disk space.  Try
and quiesce the system as much as possible before you do this -- it
might be worth booting from a LiveCD.  Also the index numbers look
pretty strange to me.  Possibly the OS that created those partitions has
different ideas on the layout of a gpt partition table, and it might be
necessary to boot back into that OS in order to remove the partition
cleanly.

There's no formatting required for a swap area: the system just uses it
as a blob of available space and writes what it needs to.

	Cheers,

	Matthew


--pc2qNR7SocS2d5K6oXtfb001lMktgTLle
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.20 (Darwin)

iQJ8BAEBCgBmBQJVVwpbXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NTNBNjhCOTEzQTRFNkNGM0UxRTEzMjZC
QjIzQUY1MThFMUE0MDEzAAoJELsjr1GOGkAThBAP/0LlznS7ktRyaglDrBiLaVV7
DOHvhFJcX3VFvnV4xMXh+7BXyeUgb2b2SfxrU/mKcJ62U0JP1nDM48s64Ib4UFRx
L4PdVoRxcRDE3Blbr7wmpcY0DNF4NrYSewwGDqOVKfBrjC5dJzg6218u/dO2YXh6
UuhcmPSAiIG04DEK5li9WeRpql13Ni68KxYC9NDJW33zqOytahg+M0YntCRE6t8L
6PipQfY6A7M4a37W+E5C3ERxtWCLK7cqZNNvly221wJjVRMrXhyEA3tNuTLIG0iz
y/WR7lGJEMOAtACx8DRQXSBh8CPMGza95MQr/FUef0uoxB7GO1gS9QHCnoWS7Ght
Wq6j+ZHAv9k1ZpUrw6oip5Hp5xQsVXYEF/hXkJeIancp9cZ+bbDnlCaPB97wvLh6
/2umItglrPgTFptXinniOMDk6MDWRdCRw5R52SjnXAB8H0UeWuVR8ZlP9d0FTMm4
C6Ckhgp2pF7uvcwjOsGJabq05eG3IvGJns2JL+0tvbTqzAHft/X1VLXbIytiUGdA
IQ5gww1vgttgwZWlHpEIjO1uHw/CmojUcUp/TeEE/LVdolLivU2j9j4KY3uUfC6K
QkwmyrYWvDCsiaXp3NXKkVX3XtXuIOS2MYs9Vqg29vwqSxO0hyetg3A+SclKwkIv
0m2mEgwwAqPpP3SWbaZh
=723A
-----END PGP SIGNATURE-----

--pc2qNR7SocS2d5K6oXtfb001lMktgTLle--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?55570A54.2080107>