GPT disk label change

Moderators: jhartley, MSR734, nola

GPT disk label change

Post by mgrosman » Sat Mar 16, 2013 11:35 am

Hello,
I'm trying to setup a ZFS volume on my Mac. I have some experience for FreeBSD and it was pretty easy to label the devices I give to the pool as I want. I usually prefer using the drive's serial number for the label.
Is there a possibility of doing that in ZEVO. I tried the command "gpt -l <label> <device>" to label but after zpool create it still creates its own unreadable labels in the form of GPTE_XXXXX.
I also tried "gpt" command after spool create without any success.

Is there any way to label the devices that comprise the ZFS pool as I want?

Thanks
mgrosman Offline


 
Posts: 7
Joined: Sun Oct 07, 2012 3:53 pm

vdev labels with ZEVO Community Edition

Post by grahamperrin » Sat Mar 23, 2013 4:27 am

This is not a direct answer to your question, but …

If your concern is identification of a physical device in an error situation

See for example this post and others under how does one identify GPTE back to /dev/diskn when faulted?.

Also, from viewtopic.php?p=240#p240 under MacZFS-oriented topic read-only:

dbrady wrote:… ZEVO writes vdev labels (using persistent /dev/dsk/GPTE..." device paths) …


Here,
/dev/dsk is a symbolic link to
/var/zfs/dsk
and for example:

Code: Select all
macbookpro08-centrim:~ gjp22$ ls -l /var/zfs/dsk
total 48
lrwxr-xr-x  1 root  wheel  12 23 Mar 02:17 GPTE_64F61AFF-9EBC-4661-9520-7803CD1B8EE4 -> /dev/disk4s2
lrwxr-xr-x  1 root  wheel  12 23 Mar 01:03 GPTE_71B8BDA2-3EBA-4B91-9E1C-2AE2B1DAAD06 -> /dev/disk2s2
lrwxr-xr-x  1 root  wheel  12 23 Mar 02:17 GPTE_78301A52-4AFF-4D96-8DE9-E76ABC14909C -> /dev/disk7s2
lrwxr-xr-x  1 root  wheel  12 23 Mar 02:17 GPTE_99056308-F5E2-4314-852C-4DA04732A2D0 -> /dev/disk9s2
lrwxr-xr-x  1 root  wheel  12 23 Mar 02:17 GPTE_A54431D5-B46F-44A9-83B4-76802A584C6E -> /dev/disk5s2
lrwxr-xr-x  1 root  wheel  12 28 Dec 15:18 GPTE_A9A6E403-30B1-4A3C-8EC9-5659F11033FE -> /dev/disk0s2


As (with ZEVO Community Edition 1.1.1) vdev labels are persistent, so we might physically label each device (or enclosure) with the vdev labels that apply.

Hope that helps
Graham

----

Side note: Link GPT ids to hardware devices
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Re: GPT disk label change

Post by mgrosman » Sat Mar 23, 2013 10:17 am

Yes, that is my primary objective with labeling the disk after the serial number. So that I can quickly look inside my enclosure and remove the failing disk.
So the matching of GPTE_XX label to /dev/diskn name is not exactly what since /dev/diskn names could change after reboot.
Here's my setup:
# ls -l /dev/dsk/
total 40
lrwxr-xr-x 1 root wheel 12 Mar 20 21:33 GPTE_4B221FCD-25E0-4390-8B0D-4228356956D7 -> /dev/disk5s2
lrwxr-xr-x 1 root wheel 12 Mar 20 21:33 GPTE_5EBE08FC-3BFE-41F8-9EEB-A2E6EA6A518D -> /dev/disk7s2
lrwxr-xr-x 1 root wheel 12 Mar 23 10:14 GPTE_9F677A0D-08FA-42F4-9C3B-0B028F616A45 -> /dev/disk8s2
lrwxr-xr-x 1 root wheel 12 Mar 20 21:33 GPTE_A0C901EE-59F6-4C8C-8783-20F000FFC4DC -> /dev/disk0s2
lrwxr-xr-x 1 root wheel 12 Mar 20 21:33 GPTE_AD64B127-015F-4373-89E8-52CA0F098685 -> /dev/disk6s2

and those disk5, disk7, disk0, disk6 and disk8 could change depending on what exactly is connected to my Mac. So if, say, the las

I wish there was a way to just label devices with "gpt -l" and in "zpool create" to specify those labels instead of disk names just like I'm doing in FreeBSD.

Alternatively if there was a way to get a serial number of the drive by its GPTE_XX or disk name it would help in those situations as well.

Thanks,
Mike
mgrosman Offline


 
Posts: 7
Joined: Sun Oct 07, 2012 3:53 pm

Re: GPT disk label change

Post by mgrosman » Sat Mar 23, 2013 10:19 am

In my prevous post the sentence: "So the matching of GPTE_XX label to /dev/diskn name is not exactly what since /dev/diskn names could change after reboot." meant
"So the matching of GPTE_XX label to /dev/diskn name is not exactly what I want since /dev/diskn names could change after reboot."
mgrosman Offline


 
Posts: 7
Joined: Sun Oct 07, 2012 3:53 pm

Persistent vdev labels, non-persistent disk numbers

Post by grahamperrin » Sat Mar 23, 2013 12:06 pm

Whilst the disk number given (by the OS) to a physical device may change following a reboot, the vdev label given (by ZEVO) to any slice should persist.

So now if you write a label
    GPTE_4B221FCD-25E0-4390-8B0D-4228356956D7
and affix it to the device that's currently at
/dev/disk5
then shut down the Mac, disconnect devices, start the Mac and attach devices in a different order:

  • you should find that the same vdev label is used (by ZEVO) for that slice of physical device – with the device at something other than /dev/disk5

If you find anything to the contrary, please let us know.

Hint

There's the option to edit your own posts, should you wish. Also, you can switch to the full editor to paste as code and so on.
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Re: GPT disk label change

Post by mgrosman » Sat Mar 23, 2013 5:54 pm

Yes, the labels do not change. Now I wish there was a way to find a disk's serial number based on its /dev/diskn name. My drives are in a 4-bay USB3 enclosure and those numbers are not shown in DiskUtility or in the system information tool. I guess the enclosure is hiding them.

Thanks for the hint, BTW, I didn't notice the option to edit my posts :)

If the guys from ZEVO development team are watching this, here's the suggestion for one of the next versions - custom labelling of devices when creating a ZFS pool.

Regards,
Mike
mgrosman Offline


 
Posts: 7
Joined: Sun Oct 07, 2012 3:53 pm

Re: GPT disk label change

Post by grahamperrin » Sun Mar 24, 2013 10:16 am

mgrosman wrote:… custom labelling of devices when creating a ZFS pool …


From the quick start guide:

> … based on the GPT UUID of the device and will always uniquely identify a
> zfs virtual device regardless of how it is attached to the system. These
> persistent alternate names are created on demand whenever a
> ZFS labeled device is discovered by the system. …

I'm not a developer, but I suspect that a need for universal uniqueness will take priority over wishes for manual naming.

(Can anyone or anything be certain that a name given by you will never be given by someone else to a slice of a different device? And so on.)
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Re: GPT disk label change

Post by mgrosman » Sun Mar 24, 2013 10:39 am

I understand the need for uniqueness, but somehow ZFS on FreeBSD doesn't have a problem with that, so I'm sure something could be arranged, e.g. a custom part with a unique prefix/suffix.
mgrosman Offline


 
Posts: 7
Joined: Sun Oct 07, 2012 3:53 pm

Re: GPT disk label change

Post by grahamperrin » Sun Mar 24, 2013 11:40 am

A custom slice alongside (or near) the slice that's for ZFS?
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Re: GPT disk label change

Post by mgrosman » Sun Mar 24, 2013 12:02 pm

That could be a possible workaround if a direct custom label would prove to be impossible for some internal technical reasons.
mgrosman Offline


 
Posts: 7
Joined: Sun Oct 07, 2012 3:53 pm


Return to General Discussion

Who is online

Users browsing this forum: ilovezfs and 1 guest

cron