glabel, gmirror, and gpart

43 views
Skip to first unread message

Warren Block

unread,
Aug 26, 2011, 9:09:21 PM8/26/11
to ques...@freebsd.org
Trying to use labeled devices and filesystems where possible, and adding
gmirror into the mix. (This is with 8-STABLE, i386.)

glabel two disks "primary" and "secondary".

gmirror the two:
gmirror label -v -b round-robin data /dev/label/primary /dev/label/secondary

Use gpart to create *and label* partitions on the mirror device:

=> 34 1465149099 mirror/data GPT (698G)
34 64 1 gpboot (32k)
98 1950 - free - (975k)
2048 4194304 2 gprootfs (2.0G)
4196352 8388608 3 gpswap (4.0G)
12584960 16777216 4 gpvarfs (8.0G)
29362176 16777216 5 gptmpfs (8.0G)
46139392 251658240 6 gpusrfs (120G)
297797632 419430400 7 gpotherfs (200G)
717228032 747921101 - free - (356G)

Then install/restore as usual, refer to /dev/gpt/labelname in
/etc/fstab.

So far, it works. My concerns are with correctness, doing it right the
first time to avoid unpleasant surprises later.

Question 1 is whether using slashes in labels is going to be a problem
later? gpart can find /dev/mirror/data and mirror/data, but not just
"data". gmirror status shows the, uh, path-like labels in both the Name
and the Components:

Name Status Components
mirror/data DEGRADED label/primary (ACTIVE)
label/secondary (SYNCHRONIZING, 23%)

Question 2 is maybe simpler. On boot, it shows this:
gptboot: invalid backup GPT header

I can speculate on what causes that (whether the various g-things use
the absolute last block of the device, or the last block of their area
and provide their total minus one block; or it could be that gptboot
is seeing the disk rather than the gmirror device). Can it be fixed?
_______________________________________________
freebsd-...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questi...@freebsd.org"

Adam Vande More

unread,
Aug 26, 2011, 10:57:02 PM8/26/11
to Warren Block, ques...@freebsd.org
On Fri, Aug 26, 2011 at 8:09 PM, Warren Block <wbl...@wonkity.com> wrote:

> Question 2 is maybe simpler. On boot, it shows this:
> gptboot: invalid backup GPT header
>
> I can speculate on what causes that (whether the various g-things use the
> absolute last block of the device, or the last block of their area and
> provide their total minus one block; or it could be that gptboot is seeing
> the disk rather than the gmirror device). Can it be fixed?
>

This is a long standing issue that still isn't fixed to the best of my
knowledge. The problem is with gmirror and GPT.

http://translate.google.com/translate?js=n&prev=_t&hl=en&ie=UTF-8&layout=2&eotf=1&sl=auto&tl=en&u=http%3A%2F%2Fbu7cher.blogspot.com%2F2011%2F03%2Ffreebsd-gmirror-gpt-ufs.html&act=url

is the best I can do.

--
Adam Vande More

Warren Block

unread,
Aug 27, 2011, 12:04:58 AM8/27/11
to Adam Vande More, ques...@freebsd.org
On Fri, 26 Aug 2011, Adam Vande More wrote:

> On Fri, Aug 26, 2011 at 8:09 PM, Warren Block <wbl...@wonkity.com> wrote:

> Question 2 is maybe simpler. ᅵOn boot, it shows this:
> ᅵgptboot: invalid backup GPT header


>
> I can speculate on what causes that (whether the various g-things use the absolute last block of the device, or the last block of their area and provide their total minus

> one block; or it could be that gptboot is seeing the disk rather than the gmirror device). ᅵCan it be fixed?
>
>
> This is a long standing issue that still isn't fixed to the best of my knowledge.ᅵ The problem is with gmirror and GPT.ᅵ

Thanks!

So it's cosmetic, but not really the kind of message that instills
confidence. gptboot needs to be able to tell if it's reading from a
gmirror. Or gmirror should provide one block less than it does, so it
doesn't overwrite the GPT backup.

Adam Vande More

unread,
Aug 27, 2011, 1:06:02 AM8/27/11
to Warren Block, ques...@freebsd.org
On Fri, Aug 26, 2011 at 11:04 PM, Warren Block <wbl...@wonkity.com> wrote:

> So it's cosmetic, but not really the kind of message that instills
> confidence. gptboot needs to be able to tell if it's reading from a
> gmirror. Or gmirror should provide one block less than it does, so it
> doesn't overwrite the GPT backup.


I would sort of agree with the latter although I'm afraid of what I don't
know. One example is that in a transparent vs hardcoded gmirror, the -1
would have to apply to both to allow "gmirror configure" to continue to work
without accidentally destroying something.

While we're on the topic of desired gmirror changes I'd like an easier
method to "right-size" a mirror so that mirroring similar sized hard drives
from different manufacturers doesn't create an Uff Da when the number of
bytes isn't consistent. You can do this with gnop, but that requires extra
steps.

Johan Hendriks

unread,
Aug 27, 2011, 7:51:56 AM8/27/11
to Warren Block, ques...@freebsd.org

>On Fri, Aug 26, 2011 at 11:04 PM, Warren Block <wbl...@wonkity.com> wrote:

> So it's cosmetic, but not really the kind of message that instills
> confidence. gptboot needs to be able to tell if it's reading from a
> gmirror. Or gmirror should provide one block less than it does, so it
> doesn't overwrite the GPT backup.

I use the whole disk to gmirror setup on all my servers.

And one day i thought i could try the gpart stuff.
I also saw the message at startup, and disgarded it.
This was on 8.1

But when i did an upgrade to 8.2 later on, the system could not boot.
So i had to find another way.

So i would not do it like you do now, it could turn against you in the long run.
The thing i did was to mirror each partition.
Like so http://unix-heaven.org/node/24
that way it worked.
Do not forget to make your second disk bootable also

regards,
Johan Hendriks_______________________________________________

Warren Block

unread,
Aug 27, 2011, 9:18:20 AM8/27/11
to Johan Hendriks, Adam Vande More, ques...@freebsd.org
On Sat, 27 Aug 2011, Johan Hendriks wrote:

>> On Fri, Aug 26, 2011 at 11:04 PM, Warren Block <wbl...@wonkity.com> wrote:
>
>> So it's cosmetic, but not really the kind of message that instills
>> confidence. gptboot needs to be able to tell if it's reading from a
>> gmirror. Or gmirror should provide one block less than it does, so it
>> doesn't overwrite the GPT backup.
>
> I use the whole disk to gmirror setup on all my servers.
>
> And one day i thought i could try the gpart stuff.
> I also saw the message at startup, and disgarded it.
> This was on 8.1
>
> But when i did an upgrade to 8.2 later on, the system could not boot.
> So i had to find another way.
>
> So i would not do it like you do now, it could turn against you in the long run.
> The thing i did was to mirror each partition.
> Like so http://unix-heaven.org/node/24
> that way it worked.
> Do not forget to make your second disk bootable also

That was the idea I had last night trying to go back to sleep. Use
gpart to partition the disks, and use gmirror to mirror the partitions.
A little more setup, because you have to create multiple mirrors instead
of one with partitions inside it.

It also addresses Adam's question. For two dissimilar disks, create
partitions of the same size and mirror them instead of the whole disk.

gmirror apparently doesn't keep a list of outstanding writes, so smaller
mirrors should be faster to sync.

Warren Block

unread,
Sep 18, 2011, 12:12:19 AM9/18/11
to Johan Hendriks, Adam Vande More, ques...@freebsd.org
Notes on a gmirrored partitions setup written into a draft
article:

http://www.wonkity.com/~wblock/docs/html/gmirror.html

Reply all
Reply to author
Forward
0 new messages