Date: Thu, 29 Dec 2016 13:08:06 +0100 From: Polytropon <freebsd@edvax.de> To: Stari Karp <starikarp@yandex.com> Cc: FreeBSD Questions <freebsd-questions@freebsd.org> Subject: Re: swap partition Message-ID: <20161229130806.914b65a1.freebsd@edvax.de> In-Reply-To: <1483012420.95172.9.camel@yandex.com> References: <1483012420.95172.9.camel@yandex.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 29 Dec 2016 06:53:40 -0500, Stari Karp wrote: > I like to increase swap partition but I am scary to screw up my system. > FreeBSD is installed on iMac (Mountain Lion). >=20 > gpart show > =3D>=A0=A0=A0=A0=A0=A0=A0=A034=A0=A01953525101=A0=A0ada0=A0=A0GPT=A0=A0(9= 32G) > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A034=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A06=A0=A0= =A0=A0=A0=A0=A0=A0- free -=A0=A0(3.0K) > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A040=A0=A0=A0=A0=A0=A0409600=A0=A0=A0=A0=A01= =A0=A0efi=A0=A0(200M) > =A0=A0=A0=A0=A0=A0409640=A0=A01216587112=A0=A0=A0=A0=A02=A0=A0apple-hfs= =A0=A0(580G) > =A0 1216996752=A0=A0=A0=A0=A01269536=A0=A0=A0=A0=A03=A0=A0apple-boot=A0= =A0(620M) > =A0 1218266288=A0=A0=A0=A0=A0=A0=A0=A01024=A0=A0=A0=A0=A04=A0=A0freebsd-b= oot=A0=A0(512K) > =A0 1218267312=A0=A0=A0727710720=A0=A0=A0=A0=A05=A0=A0freebsd-ufs=A0=A0(3= 47G) > =A0 1945978032=A0=A0=A0=A0=A07547102=A0=A0=A0=A0=A06=A0=A0freebsd-swap=A0= =A0(3.6G) > =A0 1953525134=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A01=A0=A0=A0=A0=A0=A0=A0=A0-= free -=A0=A0(512B) >=20 > What I planning to do: > Boot to OS X and than decrease apple-hfs partition for 64 GB. > Than boot to FreeBSD (single user) and: > swapoff -a > gpart resize -i6 ada0 > swapon -a >=20 > Do I need to use gpart resize -i6 -s 64G ada0 or gpart will find empty > space and use it, please? I don't think this is possible. Partitions have to be coherent disk space. If I read your current layout correctly, shrinking ada0p2 (apple-hfs) would leave a "hole" before ada0p3 (apple-boot), but your swap space is ada0p6. However, you can add a second swap space (and maybe even ignore your existing one), so the final layout could be this: ada0p1=A0=A0efi=A0=A0(200M) ada0p2=A0=A0apple-hfs=A0=A0(580G - 64G) <--- shrink ada0p3=A0=A0freebsd-swap=A0=A0(64G) <--- create in "hole" ada0p4=A0=A0apple-boot=A0=A0(620M) ada0p5=A0=A0freebsd-boot=A0=A0(512K) ada0p6=A0=A0freebsd-ufs=A0=A0(347G) ada0p7=A0=A0freebsd-swap=A0=A0(3.6G) <--- maybe ignore However, I don't have experience regarding partitioning on Mac OS X systems, but from a "logic point of view", this sounds reasonable. I'm also not sure if repartitioning will cause partition numbers to change, or if the offset and size will be assigned accordingly (so the new partition would become ada0p7). > Should I format on OS X empty space to FAT? No, leave it untouched, "empty space", unallocated. A swap partition doesn't need a file system, in fact, is _has to be_ void of a file system. --=20 Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20161229130806.914b65a1.freebsd>