Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Feb 2011 14:26:36 +0200
From:      Marin Atanasov Nikolov <dnaeon@gmail.com>
To:        freebsd-stable@freebsd.org
Cc:        freebsd-hackers@freebsd.org
Subject:   8.2-RELEASE - gmirror and gpart issue. Metadata overlap?
Message-ID:  <AANLkTimsRDV=Z4Ansd2seWUGN7C7f-5SZB=6w13kAK%2BY@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hello,

I updated a system from 8.1-RELEASE to 8.2-RELEASE today and now I'm
having issues with gpart and gmirror.

In the past I had two non-identical disks (one 250gb and one 750gb),
which I wanted to create a mirror for them, so to do this, I gpart'ed
them to equal sizes and then gmirror'ed them, without any issues.

Of course that means that the rest 500gb of the bigger disk is not
mirrored, but that wasn't a problem, since I was keeping non-important
data there.

Now I've got a second 750gb disk and updated to 8.2-RELEASE, and I
wanted to create a full mirror of the two disks and the problems
popped up. Hope you can help me a bit here.

What I did is:

1. Backed up my system
2. Booted from FixIt image
3. Removed all previous partitions for gpart.
4. Did a gmirror for ad0

Fixit# gmirror label -vb round-robin gm0 /dev/ad0

5. gpart'ed the gm0 device, so I have gm0pN partitions
6. Restored everything from the backup to the gmirror'ed partitions
7. Reboot

After a reboot I get this right before the FreeBSD bootloader starts:

gptboot:=A0invalid GPT backup header

I suppose this error simply means that gpart can't find it's backup
header, because gmirror and gpart both are using the last sectors for
a provider to write it's metadata.

Which would mean that gmirror and gpart metadata overlap, and that's
why I see this message?

Anyway, I can still boot from the primary GPT header, and here's the
second message I get during boot:

GEOM: ad0: secondary GPT header is not in the last LBA.

Why does GEOM reports ad0, and not mirror/gm0 as the provider? I've
used the gmirror'ed device for gpart, not ad0.

I still have another option, and that is to create partitions on the
disks and then gmirror them, just like a did before without issues,
and my explanation for this would be that gpart would use the last
sectors of ad0 and ad1, while gmirror would use the last sectors of
the partitions - ad0pN. That way I don't get any issues, but why when
I want to create mirror of the whole disks I get this?

Shouldn't gmirror and gpart store it's data on different sectors in
that case? What would happen if I try to glabel the disks first, then
gmirror and then gpart them? I guess I would mess up everything again.

Should I go back to my previous setup with mirroring partitions,
instead of disks? gpart now supports a `backup' option, so inserting a
new disk in case of disk crash is just as simple as putting the new
disk, restoring GPT tables from backup and putting the partitions in a
mirror.

Thanks for any feedback.

Marin


--
Marin Atanasov Nikolov

dnaeon AT gmail DOT com
daemon AT unix-heaven DOT org
http://www.unix-heaven.org/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimsRDV=Z4Ansd2seWUGN7C7f-5SZB=6w13kAK%2BY>