Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Oct 2012 15:42:11 -0600 (MDT)
From:      Warren Block <wblock@wonkity.com>
To:        freebsd@johnea.net
Cc:        freebsd-questions@freebsd.org
Subject:   Re: 9.1 and gmirror with GPT?
Message-ID:  <alpine.BSF.2.00.1210271530190.69926@wonkity.com>
In-Reply-To: <508C2043.8070205@johnea.net>
References:  <5082EAEE.4040609@johnea.net> <50833F78.1060609@bnrlabs.com> <alpine.BSF.2.00.1210210827530.70277@wonkity.com> <5085C743.8000508@johnea.net> <alpine.BSF.2.00.1210221631250.13158@wonkity.com> <5086C7EB.9020104@johnea.net> <alpine.BSF.2.00.1210231837130.21493@wonkity.com> <508C2043.8070205@johnea.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 27 Oct 2012, freebsd@johnea.net wrote:

> On 2012-10-23 17:46, Warren Block wrote:
>> On Tue, 23 Oct 2012, freebsd@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!
>
> johnea
>
> 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/
> gm0
> orsbackup# gpart add -t freebsd -a 4k mirror/gm0
> mirror/gm0s1 added, but partition is not aligned on 4096 bytes

This is new to me, I have not seen it before.  I had the impression that 
gpart put the bsdlabel partition table at a misaligned offset so that 
the actual filesystems in those partitions would land on an aligned 
block, but it never gave that message.  That comes from 
sys/geom/part/g_part.c, function g_part_ctl_add which starts at line 
645:

743         /* Provide feedback if so requested. */
744         if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
745                 sb = sbuf_new_auto();
746                 G_PART_FULLNAME(table, entry, sb, gp->name);
747                 if (pp->stripesize > 0 && entry->gpe_pp->stripeoffset != 0)
748                         sbuf_printf(sb, " added, but partition is not "
749                             "aligned on %u bytes\n", pp->stripesize);
750                 else
751                         sbuf_cat(sb, " added\n");
752                 sbuf_finish(sb);
753                 gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1);
754                 sbuf_delete(sb);
755         }
756         return (0);

> 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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1210271530190.69926>