Re: glabel metadata protection (WAS: ZFS: drive replacement performance)

2009-07-08 Thread Pete French
> I would say in this case you're *not* giving the entire disk to the 
> pool, you're giving ZFS a geom that's one sector smaller than the disk. 
>   ZFS never sees or can touch the glabel metadata.

Is ZFS happy if the size of it's disc changes underneath it ? I have
expanded a zpool a couple of times simply by changing the size of
the partition and rebooting the machine - it comes up with the new
amount of free space fine. Never tried it the other way though. The
reason I mention it is that someone suggested glabeling a drive in
an existing pool and using replace to swap it over. Which should be good
I guess unless the last sector was in use. ZFS spreads stuff all over the
disc as I unserdtand it though, so that might not be a good assumption,
even on a fairly empty filesystem.

-pete.
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: glabel metadata protection (WAS: ZFS: drive replacement performance)

2009-07-07 Thread Barry Pederson

Dan Naumov wrote:

If I use glabel to label a
disk and then create a pool using /dev/label/disklabel, won't ZFS
eventually overwrite the glabel metadata in the last sector since the
disk in it's entirety is given to the pool? 


I would say in this case you're *not* giving the entire disk to the 
pool, you're giving ZFS a geom that's one sector smaller than the disk. 
 ZFS never sees or can touch the glabel metadata.




So what happens if I was to do the following (for the same of example):

gpart create -s GPT /dev/ad1
glabel label -v disk01 /dev/ad1
gpart add -b 1 -s  -t freebsd-zfs /dev/ad1

Does "gpart add" automatically somehow recognize that the last sector
of  contains the glabel and automatically re-adjusts this
command to make the freebsd-zfs partition take "entiredisk minus last
sector" ? I can understand the logic of metadata being protected if I
do a: "gpart add -b 1 -s  -t freebsd-zfs
/dev/label/disk01" since gpart will have to go through the actual
label first, but what actually happens if I issue a gpart directly to
the /dev/device?


I'd guess bad stuff would happen here, with a conflict between what gpt 
and glabel would want to do with the end of the disk.


If you wanted to use glabel with a GPT partition, I'd think you'd want to

  gpart create -s GPT /dev/ad1
  (use "gpart show" to see what space is now available for GPT
   partitions, it won't start at 1 and won't go to the very end of the
   disk)
  gpart add -b 34 -s  -t freebsd-zfs /dev/ad1
  glabel label -v disk01 /dev/ad1p1

  (and then use label/disk01 in a zpool)

Barry
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


glabel metadata protection (WAS: ZFS: drive replacement performance)

2009-07-07 Thread Dan Naumov
>> Not to derail this discussion, but can anyone explain if the actual
>> glabel metadata is protected in any way? If I use glabel to label a
>> disk and then create a pool using /dev/label/disklabel, won't ZFS
>> eventually overwrite the glabel metadata in the last sector since the
>> disk in it's entirety is given to the pool? Or is every filesystem
>> used by FreeBSD (ufs, zfs, etc) hardcoded to ignore the last few
>> sectors of any disk and/or partition and not write data to it to avoid
>> such issues?
>
> Disks labeled with glabel lose their last sector to the label.  It is not
> accessible by ZFS.  Disks with bsdlabel partition tables are at risk due to
> the brain dead decision to allow partitions to overlap the first sector,
> but modern designs like glabel avoid this mistake.
>
> -- Brooks

So what happens if I was to do the following (for the same of example):

gpart create -s GPT /dev/ad1
glabel label -v disk01 /dev/ad1
gpart add -b 1 -s  -t freebsd-zfs /dev/ad1

Does "gpart add" automatically somehow recognize that the last sector
of  contains the glabel and automatically re-adjusts this
command to make the freebsd-zfs partition take "entiredisk minus last
sector" ? I can understand the logic of metadata being protected if I
do a: "gpart add -b 1 -s  -t freebsd-zfs
/dev/label/disk01" since gpart will have to go through the actual
label first, but what actually happens if I issue a gpart directly to
the /dev/device?

- Sincerely,
Dan Naumov
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"