Re: partitioning schemes: GPT <-> MBR

From: Ian Lepore <ian_at_freebsd.org>
Date: Sun, 07 Jan 2018 11:03:44 -0700
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
Received on Sun Jan 07 2018 - 17:03:53 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:14 UTC