From owner-freebsd-questions@freebsd.org Thu Dec 29 12:49:24 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D42BC94E69 for ; Thu, 29 Dec 2016 12:49:24 +0000 (UTC) (envelope-from starikarp@yandex.com) Received: from forward4h.cmail.yandex.net (forward4h.cmail.yandex.net [87.250.230.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1041B1E2D for ; Thu, 29 Dec 2016 12:49:23 +0000 (UTC) (envelope-from starikarp@yandex.com) Received: from smtp3h.mail.yandex.net (smtp3h.mail.yandex.net [IPv6:2a02:6b8:0:f05::117]) by forward4h.cmail.yandex.net (Yandex) with ESMTP id A3EED20C46; Thu, 29 Dec 2016 15:49:19 +0300 (MSK) Received: from smtp3h.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp3h.mail.yandex.net (Yandex) with ESMTP id EEE12440ED5; Thu, 29 Dec 2016 15:49:18 +0300 (MSK) Received: by smtp3h.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id GL56qaXKSQ-nHxGq5CP; Thu, 29 Dec 2016 15:49:17 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail; t=1483015758; bh=E91FaIkP/DBaxPG5vKRNpywjyni7OoK3KQB7O2G8Og8=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References; b=L5hw+biw2wHj5RjYPPIbpja7Vk1rMPWz2tQ1Jp4k0nLTLd6wqlV/rH1qB6LWv5/Li KxCqCEKXR6aapYwF5TKAXtpOFtmEz89gtJe9KLzyDisnrHs0EUROmowRbblrNvHuqh YmrmWLnQ6tCP/ozB3OE+QtonW7wJQsGulIEH2f/Y= Authentication-Results: smtp3h.mail.yandex.net; dkim=pass header.i=@yandex.com X-Yandex-Suid-Status: 1 0,1 0 Message-ID: <1483015755.95305.5.camel@yandex.com> Subject: Re: swap partition From: Stari Karp To: Polytropon Cc: FreeBSD Questions Date: Thu, 29 Dec 2016 07:49:15 -0500 In-Reply-To: <20161229130806.914b65a1.freebsd@edvax.de> References: <1483012420.95172.9.camel@yandex.com> <20161229130806.914b65a1.freebsd@edvax.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 12:49:24 -0000 On Thu, 2016-12-29 at 13:08 +0100, Polytropon wrote: > 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). > > > > gpart show > > =>        34  1953525101  ada0  GPT  (932G) > >           34           6        - free -  (3.0K) > >           40      409600     1  efi  (200M) > >       409640  1216587112     2  apple-hfs  (580G) > >   1216996752     1269536     3  apple-boot  (620M) > >   1218266288        1024     4  freebsd-boot  (512K) > >   1218267312   727710720     5  freebsd-ufs  (347G) > >   1945978032     7547102     6  freebsd-swap  (3.6G) > >   1953525134           1        - free -  (512B) > > > > 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 > > > > 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  efi  (200M) > ada0p2  apple-hfs  (580G - 64G) <--- shrink > ada0p3  freebsd-swap  (64G) <--- create in "hole" > ada0p4  apple-boot  (620M) > ada0p5  freebsd-boot  (512K) > ada0p6  freebsd-ufs  (347G) > ada0p7  freebsd-swap  (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. > Resizing apple-hfs is not a problem, what I am scary more is changes of partition numbers. It will be nice if I could add empty space to the end. I didn't ose OS X years and I need to check what can I do. I just know that was easy when I shrink hfs for Installed FreeBSD. Thank you very much.