Date: Sun, 07 Jan 2018 11:03:44 -0700 From: Ian Lepore <ian@freebsd.org> To: Wolfram Schneider <wosch@freebsd.org>, freebsd-current <freebsd-current@freebsd.org> Subject: Re: partitioning schemes: GPT <-> MBR Message-ID: <1515348224.54935.3.camel@freebsd.org> In-Reply-To: <CAMWY7CAjHyPfXEyYoQbYdAZf4bbG41MVxYgQ7ApCHcxh9QgeQg@mail.gmail.com> References: <CAMWY7CAjHyPfXEyYoQbYdAZf4bbG41MVxYgQ7ApCHcxh9QgeQg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1515348224.54935.3.camel>