9.1 and gmirror with GPT?

freebsd at johnea.net freebsd at johnea.net
Sat Oct 27 17:56:26 UTC 2012

On 2012-10-23 17:46, Warren Block wrote:
> On Tue, 23 Oct 2012, freebsd at johnea.net wrote:
>> To create a swap and then a root that fills the rest of the disk, must the swap be created first, like this:
>> gpart add -t freebsd-swap -a 4k -s 4g mirror/gm0s1
>> gpart add -t freebsd-ufs  -a 4k       mirror/gm0s1
>> Is there any other way to tell gpart to create the / partition using all space except 4G?
> I'm afraid it requires one to Use Math(tm).  gpart show will at least show the real capacity of a drive, instead of the diagonally-measured inflated units used by drive vendors.

Thanks for your guidance Warren! I've also been reading a number of threads on the forums on this subject, to which you contributed.

Rather than face the scary prospect of using actual Math(tm) 8-) I was just going to create swap first at 8G, and let the freebsd partition fill the rest of the disk, however as I try to destroy previous non-aligned MBR and gmirror metadata, I'm running into issues:

"mirror/gm0s1 added, but partition is not aligned on 4096 bytes"

Below is a short screen shot of the commands used to destroy and then recreate gmirror. I'm currently running with non-geom ada0 as root, and am attempting to create the aligned partitions of gm0 on ada1. 

I'm not sure what to do to cause the MBR scheme to be aligned. Thanks for any feedback!


orsbackup# mount
/dev/ada0s1a on / (ufs, local, journaled soft-updates)
devfs on /dev (devfs, local, multilabel)
orsbackup# gmirror status
      Name    Status  Components
mirror/gm0  COMPLETE  ada1 (ACTIVE)
orsbackup# gpart destroy -F mirror/gm0
mirror/gm0 destroyed
orsbackup# gpart create -s MBR mirror/gm0
mirror/gm0 created
orsbackup# ls /dev/mirror/
orsbackup# gpart add -t freebsd -a 4k mirror/gm0
mirror/gm0s1 added, but partition is not aligned on 4096 bytes
orsbackup# gpart show
=>        63  3907029105  ada0  MBR  (1.8T)
          63          63        - free -  (31k)
         126  3906994077     1  freebsd  [active]  (1.8T)
  3906994203       34965        - free -  (17M)

=>         0  3906994077  ada0s1  BSD  (1.8T)
           0  3890216960       1  freebsd-ufs  (1.8T)
  3890216960    16777116       2  freebsd-swap  (8G)
  3906994076           1          - free -  (512B)

=>        63  3907029104  mirror/gm0  MBR  (1.8T)
          63          63              - free -  (31k)
         126  3907028979           1  freebsd  (1.8T)
  3907029105          62              - free -  (31k)

=>         0  3907028979  mirror/gm0s1  BSD  (1.8T)
           0  3890216960             1  freebsd-ufs  (1.8T)
  3890216960    16777116             2  freebsd-swap  (8G)
  3906994076       34903                - free -  (17M)

More information about the freebsd-questions mailing list