Attach a new Drive to zpool

Status
Not open for further replies.

ObiTobi

Patron
Joined
Jul 12, 2013
Messages
316
Hi,

I have a t tis time a pool with only one drive (2TB). Now I have a new drive with 3TB. If I try to attach the new drive to my pool I receive a error message.

zpool status zpool02
pool: zpool02
state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
the pool may no longer be accessible by software that does not support
the features. See zpool-features(7) for details.
scan: scrub repaired 0 in 16h29m with 0 errors on Fri Apr 18 15:17:31 2014
config:

NAME STATE READ WRITE CKSUM
zpool02 ONLINE 0 0 0
gptid/72f87a58-efbe-11e2-b894-bc5ff4aca32b ONLINE 0 0 0

errors: No known data errors

zpool attach -f zpool02 gptid/72f87a58-efbe-11e2-b894-bc5ff4aca32b gptid/72dee3cc-efbe-11e2-b894-bc5ff4aca32b
cannot attach gptid/72dee3cc-efbe-11e2-b894-bc5ff4aca32b to gptid/72f87a58-efbe-11e2-b894-bc5ff4aca32b: device is too small

But this is wrong because the new drive has more capacity then the old.
I have FreeNAS-9.2.1.2-RELEASE-x64 running here.

Any hints?
 

eraser

Contributor
Joined
Jan 4, 2013
Messages
147
What happens if you try to add the new disk using the FreeNAS web GUI instead of the command line?
 

ObiTobi

Patron
Joined
Jul 12, 2013
Messages
316
I do not see any option that allows me add the new disk as a mirror for the old disk.
 

eraser

Contributor
Joined
Jan 4, 2013
Messages
147
I do not see any option that allows me add the new disk as a mirror for the old disk.

Ahh you are correct. The only option the Web GUI -> ZFS Volume Manager offers is to create a stripe (additional vdev), which is most likely not what you want to do.

What is your end goal with this new 3TB drive? Is it to just replace your 2TB drive or is it to convert your existing vdev into a mirror?
 

ObiTobi

Patron
Joined
Jul 12, 2013
Messages
316
Hi, my intention is:
1. Insert new drive with more capacity (3TB) as mirror for the old disk (2TB)
2. Then Replace the old disk (2TB) with a new disk (3TB)

What I want is to expand the capacity of 3 TB and simultaneously set up mirroring for this pool.

I'm not sure but - do I need first to create partitions with "gpart" on my new drive?
 

ObiTobi

Patron
Joined
Jul 12, 2013
Messages
316
OK I found my error :D

  1. gpart create -s gpt /dev/ada5
  2. gpart add -i 1 -b 128 -t freebsd-swap -s 2g /dev/ada5
  3. gpart add -i 2 -t freebsd-zfs /dev/ada5
  4. glabel status and find the gptid of the newly created partition. It is the gptid associated with ada5p2.
and then zpool attach...... and it works :D
 

eraser

Contributor
Joined
Jan 4, 2013
Messages
147
Ahh ok...

My guess as to the cause of your original error message is that you did not first create a partition on your new drive.

I believe that ZFS on FreeBSD works with partitions unlike Solaris ZFS which works with entire disks (I hope someone will correct me if I am wrong).

No partition = no free space = "device is too small" error message.

However I would caution against manually creating a partition on your new drive and continuing with the command line. Using the FreeNAS Web GUI method has several advantages -- it creates a 2 GB swap partition on the drive, it makes sure that the partitions created are correctly aligned for drives that use 4K sectors, and it keeps the FreeNAS configuration database up to date.

So... how far away are you from getting that second 3 TB drive? If you can get that second 3 TB drive soon, I would recommend simply creating a completely separate ZFS Pool using two mirrored 3 TB drives and using zfs send/receive commands to move your data across.
 

eraser

Contributor
Joined
Jan 4, 2013
Messages
147
ahhh cool, we replied at the same time! Glad you got a mirror set up. Having redundancy is important!
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
No, that's not the correct CLI commands...

  1. # gpart create -s gpt /dev/ada0
  2. # gpart add -a 4096 -i 1 -s 2g -t freebsd-swap /dev/ada0
  3. # gpart add -a 4096 -i 2 -t freebsd-zfs /dev/ada0
Gotta do the 4k alignment or you may find your pool is horrible in the performance department.
 

david kennedy

Explorer
Joined
Dec 19, 2013
Messages
98
eraser...

I was going to make the same post as you and recommend a new pool and zfs send |zfs receive.
Mirroring and breaking the mirror is extra work with no benefit, plus the cons you listed.

"I believe that ZFS on FreeBSD works with partitions unlike Solaris ZFS which works with entire disks (I hope someone will correct me if I am wrong)."

I believe you are correct here, but I've asked the question as to why before and haven't seen a response. Seems a little odd to go against SUN's recommendation of using entire disks and not partitions.

Putting a 2gb swap on each disk also could expose the system to stability issues.
Having a disk die in a raidz2 pool shouldn't be an issue, but if the system was swapping to that disk it most diffidently would be a problem.

Flip side, if the swap is not in use it is wasting disk space.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
FreeBSD and Solaris *can* work with either partitions or disks. But there's times when you want whole disk and times for whole partitions.

FreeNAS uses partitions, and using disks has been detrimental to pools in the past. In fact, if you aren't duplicating the pool creation exactly how FreeNAS normally does it from the GUI, it bring great risk that you may lose your pool suddenly one day in the future. Not a good position to be in, and for that reason we strictly recommend that you never do anything except through the WebGUI. If you can't do what you want in the WebGUI you are taking serious risk you'll be very unhappy later.
 
Status
Not open for further replies.
Top