Hot spare shown as gpt/rz2_disk7 instead of gptid

Status
Not open for further replies.

Ravefiend

Dabbler
Joined
Jun 1, 2011
Messages
37
Using FreeNAS 8, I've got an RAIDZ2 pool with one hot spare disk in place. Been upgrading FreeNAS as new versions are released, currently at the latest 8.3.1-p2. There's one thing that just won't seem to go away automatically:

Code:
  pool: rpool
 state: ONLINE
  scan: scrub repaired 0 in 16h25m with 0 errors on Sun Apr 21 03:18:56 2013
config:

	NAME                                            STATE     READ WRITE CKSUM
	rpool                                           ONLINE       0     0     0
	  raidz2-0                                      ONLINE       0     0     0
	    gptid/ac3474a9-804d-11e0-b1a2-0025903071b4  ONLINE       0     0     0
	    gptid/ac51b1c0-804d-11e0-b1a2-0025903071b4  ONLINE       0     0     0
	    gptid/ac7236c2-804d-11e0-b1a2-0025903071b4  ONLINE       0     0     0
	    gptid/ac8d49be-804d-11e0-b1a2-0025903071b4  ONLINE       0     0     0
	    gptid/acaa342a-804d-11e0-b1a2-0025903071b4  ONLINE       0     0     0
	    gptid/acc76f9b-804d-11e0-b1a2-0025903071b4  ONLINE       0     0     0
	spares
	  gpt/rz2_disk7                                 AVAIL   


As you can see, my other disks got renamed to use the gptid whereas my hot spare disk has kept its rz2_disk7 name. How come FreeNAS hasn't renamed this one just as it did for the others? Can I get this done manually now?
 
I

ixdwhite

Guest
I replied to the ticket (which I will close as not a bug), but FreeNAS does not use GPT partition labels so the label must have existed on the drive prior to it being attached as a spare.

To rectify the situation, detach the spare, use 'gpart destroy -F da6' to erase the entire partition table, then reattach the device as a spare and it should come back with its GUID partition ID. You may need to check 'swapinfo' to see if any swap partitions have been allocated on the device and use 'swapoff' to detach any swap partition before 'gpart destroy' will be able to erase the table.
 

Ravefiend

Dabbler
Joined
Jun 1, 2011
Messages
37
Allow me to clarify that all 7 disks (6+1) are Western Digital Caviar Green (WD20EARS), and I had initially created the RAIDZ2 as:

Code:
gpart create -s GPT /dev/da0
gpart add -b 2048 -s 3906824192 -t freebsd-zfs -l rz2_disk1 /dev/da0
gpart create -s GPT /dev/da1
gpart add -b 2048 -s 3906824192 -t freebsd-zfs -l rz2_disk2 /dev/da1
gpart create -s GPT /dev/da2
gpart add -b 2048 -s 3906824192 -t freebsd-zfs -l rz2_disk3 /dev/da2
gpart create -s GPT /dev/da3
gpart add -b 2048 -s 3906824192 -t freebsd-zfs -l rz2_disk4 /dev/da3
gpart create -s GPT /dev/da4
gpart add -b 2048 -s 3906824192 -t freebsd-zfs -l rz2_disk5 /dev/da4
gpart create -s GPT /dev/da5
gpart add -b 2048 -s 3906824192 -t freebsd-zfs -l rz2_disk6 /dev/da5
gpart create -s GPT /dev/da6
gpart add -b 2048 -s 3906824192 -t freebsd-zfs -l rz2_disk7 /dev/da6
zpool create -fm /mnt/rpool rpool raidz2 gpt/rz2_disk1 gpt/rz2_disk2 gpt/rz2_disk3 gpt/rz2_disk4 gpt/rz2_disk5 gpt/rz2_disk6 spare gpt/rz2_disk7


Code:
[root@storage] ~# gpart show /dev/da0
=>        34  3907029101  da0  GPT  (1.8T)
          34        2014       - free -  (1M)
        2048  3906824192    1  freebsd-zfs  (1.8T)
  3906826240      202895       - free -  (99M)

[root@storage] ~# gpart show /dev/da6
=>        34  3907029101  da6  GPT  (1.8T)
          34        2014       - free -  (1M)
        2048  3906824192    1  freebsd-zfs  (1.8T)
  3906826240      202895       - free -  (99M)


FreeNAS has automatically converted the label on all 6 other disks, but not the spare. I would have expected the same renaming for the spare disk as it did with the others.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I'm presuming that the ticket is being closed as "not a bug" is because you didn't use the GUI. Many issues won't occur if you use the GUI because the GUI handles a lot of edge conditions that you might not have expected, or realized, you were in.

It is always recommended that if the GUI can do what you want to do you should use it over the CLI. The CLI should only be used when the GUI can't do what you need it to do. In this case, the GUI was more than capable of doing what you wanted.
 
Status
Not open for further replies.
Top