From owner-freebsd-current@freebsd.org Sun Jan 7 18:03:53 2018 Return-Path: Delivered-To: freebsd-current@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 F066DE78AD5 for ; Sun, 7 Jan 2018 18:03:53 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D47AA70C32 for ; Sun, 7 Jan 2018 18:03:53 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 06c9457b-f3d5-11e7-93a5-cd02e7dc7692 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 06c9457b-f3d5-11e7-93a5-cd02e7dc7692; Sun, 07 Jan 2018 18:03:13 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w07I3i4A004030; Sun, 7 Jan 2018 11:03:44 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1515348224.54935.3.camel@freebsd.org> Subject: Re: partitioning schemes: GPT <-> MBR From: Ian Lepore To: Wolfram Schneider , freebsd-current Date: Sun, 07 Jan 2018 11:03:44 -0700 In-Reply-To: References: Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jan 2018 18:03:54 -0000 On Sun, 2018-01-07 at 18:58 +0100, Wolfram Schneider wrote: > Hi guys, > > I have 2 small virtual machines running in data center, on similar > hardware. Both are running FreeBSD 12-current. The first one is based > on a 10.3 image, upgraded to current. The second one is based on > 11.1, > upgraded to current. > > I notice a difference in disk partitioning. 10.3 is using GPT, and > 11.1 MBR. > > [FreeBSD 10.3] > $ gpart show > =>      34  83886013  vtbd0  GPT  (40G) >        34      1024      1  freebsd-boot  (512K) >      1058   2097152      2  freebsd-swap  (1.0G) >   2098210  81787836      3  freebsd-ufs  (39G) >  83886046         1         - free -  (512B) > > [FreeBSD 11.1] > $ gpart show > =>      63  83886017  vtbd0  MBR  (40G) >        63         1         - free -  (512B) >        64  79691776      1  freebsd  [active]  (38G) >  79691840   4194240         - free -  (2.0G) > > I thought that MBR is outdated. But the hosting company told me that > FreeBSD 11.1 is using MBR by default. Is that correct? > > My problem with the MBR machine is that I cannot add a swap device. > There are 2GB free space, and I want add a 1GB swap device: > > $ gpart add -s 1G -t freebsd-swap vtbd0 > gpart: Invalid argument > > is this an MBR issue? > > thanks, Wolfram > You need to add a new freebsd slice, then add the freebsd swap partition within it:  gpart add -s 1g -t freebsd vtdb0  gpart create -s bsd vtdb0s2  gpart add -t freebsd-swap vtdb0s2 Now you should have a /dev/vtdb0s2b available for swap.  There will also be ~1g still available to create another slice. Another alternative is just create the vtdb0s2 slice, then don't subdivide it into BSD partitions at all, just add /dev/vtdb0s2 to fstab as a swap device. -- Ian