Upgrade Raid1 disks

Status
Not open for further replies.

zemun2

Explorer
Joined
Mar 15, 2017
Messages
72
Hi All,

Is there away to upgrade 2x2tb drives in Raid1 configuration to 2x4tb drives without manually copying all the data? There are no empty slots to plug in new hard drives.

Thanks
 

Vito Reiter

Wise in the Ways of Science
Joined
Jan 18, 2017
Messages
232
Absolutely, you can go into the GUI and 'View Disks' under storage and offline one of your disks, pull it out of the system and put the 4TB in its place, go under Volumes, select the Volume, bottom left will be a status button once you click that you'll see the disk that's in and a string of numbers where the other disk was, click that and click 'Replace' at the bottom and select the new 4TB disk. It will resilver the data and once it's complete do the same with the other disk.
 

zemun2

Explorer
Joined
Mar 15, 2017
Messages
72
Awesome.

Thanks for the super quick reply...
 

Dice

Wizard
Joined
Dec 11, 2015
Messages
1,410
While Vito's suggestion is accurate, it puts your data at risk.
What sort of system does only have 2 sata ports?
 

Vito Reiter

Wise in the Ways of Science
Joined
Jan 18, 2017
Messages
232
Yeah, let me add redundancy is NOT a backup, it's the best way to do it if your situation is tight like that, but obviously, the best way to do it would be either setting up a new mirror for more space or attaching the drive in a third spot. However, the data on the offline disk won't be affected and since it's a mirror can be plugged back in and accessed in case of failure, no?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Hardware specs and freenas version required for every new thread.

Sent from my Nexus 5X using Tapatalk
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
...and the hardware specs matter here why?
I don't care. More often than not it changes the advice we give. It's also part of the rules for being here and playing nice.

Sent from my Nexus 5X using Tapatalk
 

zemun2

Explorer
Joined
Mar 15, 2017
Messages
72
It's ACER AC100 running FreeNAS-9.10.2-U3 (e1497f269). 2 slots are used for mirroring drives, 1 for FreeNAS and 1 for Jails.

It's only being user as media server for plex, nothing really important.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
it puts your data at risk
Technically true, but the cool thing about a mirror is that if the drive you leave installed fails during the resilver of the new drive, the drive you pulled has all the data.
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
Technically true, but the cool thing about a mirror is that if the drive you leave installed fails during the resilver of the new drive, the drive you pulled has all the data.

Are you sure you can actually re-online the offlined drive to recover the data?

You can certainly recover the data if you split the mirror instead.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
Are you sure you can actually re-online the offlined drive to recover the data?
No, I haven't actually tested this theory in practice, but I'm confident. I won't be testing it today, but if/when I do I'll post confirmation.

EDIT: I assume the process would be a zpool import with suitable options.
EDIT2: which only makes sense for a single vdev, which is what the OP has but hardly represents a general case. Hm.
EDIT3: nope, didn't work for me (see later post).
split the mirror
I was reminded of that just the other day when browsing the zpool docs. What an awesome way to clone or backup a pool :cool:
 
Last edited:

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
No, I haven't actually tested this theory in practice, but I'm confident. I won't be testing it today, but if/when I do I'll post confirmation.

EDIT: I assume the process would be a zpool import with suitable options.

I was reminded of that just the other day when browsing the zpool docs. What an awesome way to clone or backup a pool :cool:

Its also a great way to convert a mirror to a stripe. You can convert a triple mirror to a dual mirror very easily in ZFS by simply detaching (iirc) one of the mirror members, but you can't convert a dual mirror to stripe the same way (a stupid limitation imo, as zfs can obviously remove the second member), but you can accomplish the same thing with zpool split, and as a side effect, you now have a backup of the original pool.
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
Are you saying zpool detach doesn't work for a 2-way mirror? That's not how I read the docs.

Unless its changed in the last 6 months, that's how it works.

http://docs.oracle.com/cd/E19253-01/819-5461/6n7ht6qvl/index.html
You can use the zpool detach command to detach a device from a mirrored storage pool. However, this operation fails if no other valid replicas of the data exist.

Which means that it won't work on a dual-mirror.

Also, http://docs.oracle.com/cd/E19253-01/819-5461/gjooc/index.html
You can use the zpool split command to detach disks from a mirrored ZFS storage pool to create a new pool with one of the detached disks. The new pool will have identical contents to the original mirrored ZFS storage pool.


I'm wrong.
 
Last edited:

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
Just tested it, and I can confirm that you can detach all the way back to a non-redundant slice :)

I swear, last time I tried this (circa 9.10 release) you couldn't, but this test was on 11-RC

root@rhea:~ # mkdir test
root@rhea:~ # cd test
root@rhea:~/test # dd if=/dev/zero of=slice1 bs=1m count=100
root@rhea:~/test # dd if=/dev/zero of=slice2 bs=1m count=100
root@rhea:~/test # dd if=/dev/zero of=slice3 bs=1m count=100
root@rhea:~/test # ls -alt
total 5
-rw-r--r-- 1 root wheel 104857600 May 11 12:43 slice3
drwxr-xr-x 2 root wheel 5 May 11 12:43 .
-rw-r--r-- 1 root wheel 104857600 May 11 12:43 slice2
-rw-r--r-- 1 root wheel 104857600 May 11 12:43 slice1
drwxr-xr-x 4 root wheel 16 May 11 12:40 ..
root@rhea:~/test # zpool create testpool /root/test/slice1
root@rhea:~/test # zpool status testpool
pool: testpool
state: ONLINE
scan: none requested
config:

NAME STATE READ WRITE CKSUM
testpool ONLINE 0 0 0
/root/test/slice1 ONLINE 0 0 0

errors: No known data errors
root@rhea:~/test # zpool attach testpool /root/test/slice1 /root/test/slice2
root@rhea:~/test # zpool status testpool
pool: testpool
state: ONLINE
scan: resilvered 268K in 0h0m with 0 errors on Thu May 11 12:45:01 2017
config:

NAME STATE READ WRITE CKSUM
testpool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
/root/test/slice1 ONLINE 0 0 0
/root/test/slice2 ONLINE 0 0 0

errors: No known data errors
root@rhea:~/test # zpool attach testpool /root/test/slice1 /root/test/slice3
root@rhea:~/test # zpool status testpool
pool: testpool
state: ONLINE
scan: resilvered 268K in 0h0m with 0 errors on Thu May 11 12:45:09 2017
config:

NAME STATE READ WRITE CKSUM
testpool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
/root/test/slice1 ONLINE 0 0 0
/root/test/slice2 ONLINE 0 0 0
/root/test/slice3 ONLINE 0 0 0

errors: No known data errors
root@rhea:~/test # zpool detach testpool /root/test/slice3
root@rhea:~/test # zpool status testpool
pool: testpool
state: ONLINE
scan: resilvered 268K in 0h0m with 0 errors on Thu May 11 12:45:09 2017
config:

NAME STATE READ WRITE CKSUM
testpool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
/root/test/slice1 ONLINE 0 0 0
/root/test/slice2 ONLINE 0 0 0

errors: No known data errors
root@rhea:~/test # zpool detach testpool /root/test/slice2
root@rhea:~/test # zpool status testpool
pool: testpool
state: ONLINE
scan: resilvered 268K in 0h0m with 0 errors on Thu May 11 12:45:09 2017
config:

NAME STATE READ WRITE CKSUM
testpool ONLINE 0 0 0
/root/test/slice1 ONLINE 0 0 0

errors: No known data errors
root@rhea:~/test # zpool destroy testpool
root@rhea:~/test # cd ..
root@rhea:~ # rm -rf test
root@rhea:~ #

Also works in 9.10.2-U3
 
Last edited:

Dice

Wizard
Joined
Dec 11, 2015
Messages
1,410
Technically true, but the cool thing about a mirror is that if the drive you leave installed fails during the resilver of the new drive, the drive you pulled has all the data.
Ah, well that is a point after all.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
I'll post confirmation
Just did some testing:
  • created a pool with two disks in a mirror - call them A and B
  • copied some data onto pool
  • offlined disk B
  • began zpool replace of disk B with a new disk C
  • before resilver was complete, physically disconnected disk A
Reasonably enough, this left the pool faulted and locked.

I could not figure out a way to recover from here. Connecting only disk B gave no results for zpool import. Connecting A and B was no better. Connecting A and C, followed by zpool clear got the pool back, but after resilver, it was empty :eek:

Maybe photorec on B would be a recovery option.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
This leads me to a though about upgrading a pool that consists of a single mirror vdev. Instead of:
  • offline B
  • replace B with C
a safer procedure would be
  • split B
  • attach C
so that if A fails during resilver, the pool remains intact on B.
 
Status
Not open for further replies.
Top