Disable gpt/gptid labels

Status
Not open for further replies.

Brand

Moderator
Joined
May 27, 2011
Messages
142
Purpose: To make it easier to differentiate between the hard drives.

Old labels shown with gpt/gptid
Code:
freenas# zpool status Data
  pool: Data
 state: ONLINE
 scrub: none requested
config:

        NAME                                            STATE     READ WRITE CKSUM
        Data                                            ONLINE       0     0     0
          raidz2                                        ONLINE       0     0     0
            gptid/b89a9716-76a0-11e0-8ff6-90e6ba604f9d  ONLINE       0     0     0
            gptid/2be4d49a-ae8d-11e0-a752-90e6ba604f9d  ONLINE       0     0     0
            gptid/b908c5ed-76a0-11e0-8ff6-90e6ba604f9d  ONLINE       0     0     0
            gptid/b9412842-76a0-11e0-8ff6-90e6ba604f9d  ONLINE       0     0     0
            gptid/b97f6d34-76a0-11e0-8ff6-90e6ba604f9d  ONLINE       0     0     0
            gptid/b9bb3dbb-76a0-11e0-8ff6-90e6ba604f9d  ONLINE       0     0     0
            gptid/b9f5343f-76a0-11e0-8ff6-90e6ba604f9d  ONLINE       0     0     0
            gptid/ba321d96-76a0-11e0-8ff6-90e6ba604f9d  ONLINE       0     0     0
            gptid/ba707005-76a0-11e0-8ff6-90e6ba604f9d  ONLINE       0     0     0
            gptid/a8787576-7738-11e0-9524-90e6ba604f9d  ONLINE       0     0     0

errors: No known data errors


To disable gpt/gptid labels you will need to modify either the /boot/device.hints or /boot/loader.conf file. In order to modify those files the file system will need to be made writable which can only be done as the root user.

1. Change to the super user
Code:
su -


2. Make file system writeable
Code:
mount -uw /


3. Open loader.conf in the vi text editor
Code:
vi /boot/loader.conf


4. Add the following lines to the loader.conf file and save
Code:
# Disable gpt/gptid labels
kern.geom.label.gptid.enable=0
kern.geom.label.gpt.enable=0


5. Reboot for the changes to take effect
Code:
reboot


6. New labels shown with device name
Code:
freenas# zpool status Data
  pool: Data
 state: ONLINE
 scrub: none requested
config:

	NAME        STATE     READ WRITE CKSUM
	Data        ONLINE       0     0     0
	  raidz2    ONLINE       0     0     0
	    ada0p2  ONLINE       0     0     0
	    ada1p2  ONLINE       0     0     0
	    da0p2   ONLINE       0     0     0
	    da1p2   ONLINE       0     0     0
	    da2p2   ONLINE       0     0     0
	    da3p2   ONLINE       0     0     0
	    da4p2   ONLINE       0     0     0
	    da5p2   ONLINE       0     0     0
	    da6p2   ONLINE       0     0     0
	    da7p2   ONLINE       0     0     0

errors: No known data errors


The idea for this How-To came from a post by Andrey V. Elsukov in another forum.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Will this have any impact on importing volumes or cause problems if the device names change say for example you switch to new hardware?
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
First, Nice posting and yes you beat me to it :p

My only comment is I like ee vice vi as an editor.

I don't believe so, it only seems to use the device name vice the gptid label and I did this while doing all kinds of weird zpool commands so I could export, swap a drive, import, resilver, etc... The pool names are unaffected.
 

William Grzybowski

Wizard
iXsystems
Joined
May 27, 2011
Messages
1,754
No, no, no and no, and one more NO!

protsd is right.

Do not use this if you care about your data and how FreeNAS manage your volumes.

There is a reason for using gptid and a good one, and this reason is about device name renaming. FreeNAS WON'T like it if you add new disks to the nas to the wrong ports, or mix them.

You have been warned
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I was able to produce a failure.

I created mirrored pairs, copied a few movies to them, swapped the drives around and now they are the incorrect mirrors. I will have to try this test with the gptid enabled to see how it goes.

Start:
mirror1
ada0p2
ada2p2

mirror2
ada1p2
ada3p2

After Swap:
mirror1
ada1p2
ada3p2

mirror2
ada0p2
ada2p2

The movies still play, I can write data, no pool errors but why not? With the pool names changing for the drives being used which are mapped to a drive name, this makes no sense to me. Something is smarter than I am.

If everything is a RaidZ I don't think it makes a difference. I tested it and no failures.

Before Swap:
raidz1
ada0p2
ada1p2
ada2p2
ada3p2

After swap:
raidz1
ada1p2
ada0p2
ada3p2
ada2p2

If there is a scenario which causes a failure that I could reproduce using 4 identical drives, I'd like to try it out.

I'm running Beta-4 for this test.

-Mark
 

William Grzybowski

Wizard
iXsystems
Joined
May 27, 2011
Messages
1,754
I was able to produce a failure.

I created mirrored pairs, copied a few movies to them, swapped the drives around and now they are the incorrect mirrors. I will have to try this test with the gptid enabled to see how it goes.

Start:
mirror1
ada0p2
ada2p2

mirror2
ada1p2
ada3p2

After Swap:
mirror1
ada1p2
ada3p2

mirror2
ada0p2
ada2p2

The movies still play, I can write data, no pool errors but why not? With the pool names changing for the drives being used which are mapped to a drive name, this makes no sense to me. Something is smarter than I am.

If everything is a RaidZ I don't think it makes a difference. I tested it and no failures.

Before Swap:
raidz1
ada0p2
ada1p2
ada2p2
ada3p2

After swap:
raidz1
ada1p2
ada0p2
ada3p2
ada2p2

If there is a scenario which causes a failure that I could reproduce using 4 identical drives, I'd like to try it out.

I'm running Beta-4 for this test.

-Mark

Of course, the data will _always_ work. Thats a problem with the GUI and how/what we use to keep track of which HDD belong to which Volume.
You might endup as GUI saying ada3 is an unused disk, but it is actually part of a zpool "tank".
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I have seen the error of my ways and will not be changing the gptid.
 
Status
Not open for further replies.
Top