SOLVED GPT Labels

Status
Not open for further replies.

rslocalhost

Dabbler
Joined
Jan 1, 2018
Messages
29
(FreeNAS 11.1 Release)
Having lots of drives, I'd like more descriptive names that ada10p2, so I can figure out which drive is in which bay easily without referring to the sheet I made. Reading up on this, gpt labels seem to be the answer. But apparently I'm doing something wrong. Can anyone spot why I'm getting the error?

I start by naming a partition:

Code:
[root@freenas ~]# gpart modify -i 1 -l disk10 /dev/ada10						
ada10p1 modified


Now to check it really worked:

Code:
[root@freenas ~]# gpart list ada10 |less
Geom name: ada10																																  
scheme: GPT																	
...	
Providers:																	
1. Name: ada10p1																
 ...						  
 label: disk10																
 ....


OK, it's there. Now to use it, to say attach to existing mirror in the pool named system.

Code:
[root@freenas ~]# zpool attach system gptid/6b5a6b36-ecab-11e7-8382-080027f18fef gpt/disk10																	
cannot open 'gpt/disk10': no such GEOM provider								
must be a full path or shorthand device name


What am I missing? If I use the gptid of the partition (edited out of the gpart list command above), it works.

Background if anyone cares:

I want to do this for two reasons:
  • It is recommended by the authors of the ZFS book. I figure they know better than me at this point.
  • I am starting to upgrade my mirrors to larger drives.
Sure I can break the mirror, then add the bigger drive, and wait for resilver and repeat for the other disk in the mirror. But I risk my production pool if the original disk picks this time to give me errors. There is no data redundancy anymore until the resilver completes (about 4.5 hours so far).

However, with mirrors, I can also attach a third disk to the mirror (not from the gui near as I can tell, has to be command line). I have both originals online while the new disk gets resilvered and less risk if one of the original disks decides to give me errors. Once the resilver is complete, I can then detach one of the originals and repeat. (Or just do the 2nd new disk before detaching the 2 originals.)

The problem is this involves typing in the gptid. Have you seen that? Easy to make a mistake. Bay numbers are easier to type, and type correctly. Yes, I understand I must make sure the labels are unique. Right now I'm trying this out on a test machine.
 
Last edited by a moderator:

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
Please don't modify the disk identifiers for your pool. This may have some adverse affects which may upset the middleware. Suggest you use the description field in the UI to identify the location.
 

rslocalhost

Dabbler
Joined
Jan 1, 2018
Messages
29
My production FreeNAS (9.10) seems to have the bug where only disks that aren't in use show up in the view disks. Therefore, until I have an outage where I can upgrade (hoping that's the problem), the description field is pretty much useless to me. But it's still a good suggestion and something I will do when it becomes available.

As for modifying the disk identifiers, changing the gpt label on the partition can really screw things up?!?! I ask only because the GUI doesn't seem to use them, nor does it seem to use the gptid. Further, by default, the gpt labels are blank/null. If all the disks have the same [default] label, how could they be used?
 
Last edited by a moderator:

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
Giving disks numbered names without realizing that disk numbering is dynamic seems like a recipe for breaking a pool. If you want to use something meaningful, use the disk serial number for the label. diskinfo -v da10 shows it.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Having lots of drives, I'd like more descriptive names that ada10p2, so I can figure out which drive is in which bay easily without referring to the sheet I made. Reading up on this, gpt labels seem to be the answer. But apparently I'm doing something wrong. Can anyone spot why I'm getting the error?
What you are reading about is FreeBSD or ZFS. FreeNAS is an appliance built on FreeBSD and ZFS, but it has significant modifications because it is intended to be used as an appliance. If you can't do it through the Web GUI, you probably shouldn't try to do it.
 

rslocalhost

Dabbler
Joined
Jan 1, 2018
Messages
29
In case anyone finds this in the future, the problem fixed itself when I upgrade to FreeNAS 11.1-U4. The upgrade did wipe out the one label I had created, but now I can put the bay number as a description.
 
Status
Not open for further replies.
Top