# glabel won't stick



## tab2tab (Sep 18, 2010)

Hi

I'm running freebsd 8.1 with zfs. I've a zpool with 4 disks, all labeled with glabel. After a disk failure I had to replace one of the disks. At the moment I seem unable to get the label working.

I've tried

`glabel label -v WDC3 /dev/ad22`

and also 

`glabel label WDC3 /dev/ad22`

When I check the /dev/label directory its there and everything seems to work just find. After I reboot the label is gone. I've tried several times. Is there anything I've forgotten? Should the drive be formated is any particular way? The formation will be lost once I add it to the zpool, wont it?

I'm getting desperate! Can someone please end my misery? :s

thanx

Oskar


----------



## graudeejs (Sep 18, 2010)

Do you load geom_label at boot?


----------



## Beastie (Sep 18, 2010)

tab2tab said:
			
		

> Should the drive be formated is any particular way? The formation will be lost once I add it to the zpool, wont it?


The only alternatives to glabel are newfs(8)/tunefs(8), which obviously create UFS-specific labels.


----------



## fronclynne (Sep 20, 2010)

Humm, have you tried it in single user mode?  A general idea (& mind, I think the system is mildly D to the fec to the tive) is to label without mounting and then reboot and mount, yeah, cheers.


----------



## sub_mesa (Sep 20, 2010)

Use GPT labels when possible. Or geom labels if you use DD (dangerously dedicated) mode.

I noticed that if you add a label after you've added the disk to a pool, ZFS will continue using the device you specified ("ad4") and not the new label. Now if ZFS locks the ad4 device, the label will disappear as well.

Thus, you might need to recreate the pool and give ZFS labels directly:

`zpool create tank raidz1 /dev/label/disk{1..4}`

That should work. geom_label should be part of your kernel so no need to load it in loader.conf.


----------



## User23 (Sep 20, 2010)

Shouldnt Shouldn't a


```
zfs export

glabel label the drives

zfs import
```

just work?


----------



## tab2tab (Oct 4, 2010)

it It still doesnt doesn't work.  i I tried the single user and to load geom_label at boot. the The label still doesnt doesn't stick. after After a reboot its it's all gone... BUT only on the new drive! WTF?


----------



## Savagedlight (Oct 5, 2010)

I had a labeled partiton in a zfs pool, which suddenly became unlabeled. I found out that I had a duplicate label at some point. Labeling a bunch of drives/partitions is prone to human error, right?

I ended up using the redundancy of my pool to do the following:
`# zfs offline pool drive`
`# zfs export pool`
{label the drive/partition}
`# zfs import pool`
`# zfs replace pool drive label`

It made zfs respect the label from there on.


----------

