Hi Ivailo,
The FreeBSD glabel is in bit of a mess, indeed. It is a mess not because
the tech is bad or buggy (although there are caveats), but because the
glabel tool had made it all too confusing by displaying them all
together. Or perhaps our assumptions are wrong if one needs to be more
precise.
We have several kinds of labels. Each of them lives under it's own
namespace (a subdir of /dev). There are the glabel type, which you
manipulate with glabel - this lives under /dev/label. There are the geom
labels that you manipulate via gpart that live under /dev/gpt. There are
the gmirror labels that you manipulate with gmirror and live under
/dev/mirror. There are the disk ID labels that live under /dev/diskid.
There are the UFS labels that you manipulate with newfs/tunefs that live
under /dev/ufs. Perhaps there are others I missed..
Then comes ZFS. For it's own sanity, ZFS would label the devices it's
given with it's own labels -- so that when you reboot or move the pool
to another machine it still finds it's members and structure.
If it can find its own labels, that is...
As a consequence of this, the safest way to use ZFS is with whole
devices. This pretty much guarantees your ZFS pool will be portable
across any system and ZFS will *always* be able to find it, no matter
what. The drawback is you might not know for sure which device id is
which physical drive, because many factors might influence device name
reordering. But this is pretty much the only drawback.
The diskid should work in a similar way. On systems that don't have disk
ids, you will fall back to the device name, so no big deal.
The next "safest" thing is the GPT label, which you create with gpart.
Many systems (non FreeBSD) support it and your pool will be just fine there.
Worst are glabel and gmirror, mostly because they have trouble being
nested. But as long as you stick to some simple rules, these work ok too.
What you are seeing is when you destroy the label, ZFS can no longer
find it's own labels. This is because when you destroy the label ZFS has
no idea w where to look for it -- what the offset would be.
If in your example, you recreate the label again, that pool will
suddenly work again -- even if you use different name for the new label
-- the ZFS's own label will be then discoverable again.
I myself prefer either raw disks or GPT. The later especially in smaller
systems, where I would use GPT for boot partitions anyway.
But also on systems with tens of drives, where I need to know the
physical location of the drive (and not care much about it's serial
number at that moment, which would be the case of using diskid labels).
On these systems, I would label the GPT partition with chasis/position name.
By the way, I still have few systems that use glabels (dev/label).
Daniel