SOLVED Migrate zpool on single SSD to new drive

Status
Not open for further replies.

short-stack

Explorer
Joined
Feb 28, 2017
Messages
80
I'm sure I'll get lectured by many of you :) but I run all of my jails/vms off of a single SSD. My primary storage in FreeNAS is on 4x4TB spinning disks, but I wanted faster access for the data that is actually r/w on a regular basis.

A few weeks ago my old 80 GB SSD gave me a single SMART error, which it 'fixed' but I am still paranoid about.

Because of that error and it being very small, I decided to buy a larger 500 GB SSD to replace it. So now I want to move the data from my old 80GB SSD to the new 500GB SSD.

What would be the easiest way? Add the drive as a mirror, and then remove the old one? Export/import the volume? I've been reading around but it seems everyone expects import/export to be to new hardware and not inside the same machine.
 

bigphil

Patron
Joined
Jan 30, 2014
Messages
486
Your best option would be to perform a zfs send/recv to replicate the filesystem to the new mirrored SSD pool from within the same box. there is plenty of documentation on how to use those commands.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
I'm sure I'll get lectured by many of you :) but I run all of my jails/vms off of a single SSD. My primary storage in FreeNAS is on 4x4TB spinning disks, but I wanted faster access for the data that is actually r/w on a regular basis.

A few weeks ago my old 80 GB SSD gave me a single SMART error, which it 'fixed' but I am still paranoid about.

Because of that error and it being very small, I decided to buy a larger 500 GB SSD to replace it. So now I want to move the data from my old 80GB SSD to the new 500GB SSD.

What would be the easiest way? Add the drive as a mirror, and then remove the old one? Export/import the volume? I've been reading around but it seems everyone expects import/export to be to new hardware and not inside the same machine.
I did this before, to move to a larger drive, same as you are asking for. The simple, easy way to go, add the new, larger, drive to the existing one as a mirror.
Once it is done with the resilver, just split the old drive out.
Done.

Sent from my SAMSUNG-SGH-I537 using Tapatalk
 

short-stack

Explorer
Joined
Feb 28, 2017
Messages
80
The simple, easy way to go, add the new, larger, drive to the existing one as a mirror.
Once it is done with the resilver, just split the old drive out.

Thanks, that's what I thought would end up being the easiest, but wasn't sure if there was a more proper way to do it.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Thanks, that's what I thought would end up being the easiest, but wasn't sure if there was a more proper way to do it.
It is actually documented in the Sun ZFS reference material as the appropriate way to duplicate a disc.
If you have a mirrored pair, you can add a third disk to the mirror, and when the resilver is done, you can split one of those disks out. In one of the examples I remember reading, it was to duplicate the boot pool to make a backup.

Sent from my SAMSUNG-SGH-I537 using Tapatalk
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,298
The simple, easy way to go, add the new, larger, drive to the existing one as a mirror.
No, the simple, easy way to go is to simply replace the first SSD with the second. You can do it all in the GUI with a few clicks.

Edit: If you went the mirror route, you'd want to detach the original SSD, not split it.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Edit: If you went the mirror route, you'd want to detach the original SSD, not split it.
You could use detach, but the thing I was thinking about is the command zpool split which is used to split a mirrored storage pool. It detaches a disk or disks in the original mirrored pool to create another identical pool.
The zpool detach command would also work, but the split command leaves the removed disk in a usable state where it could be mounted again in another system. I don't know if the detach command does that because it is not stated as such in the documentation.
The last time I did what the OP was asking about, I did it from the command line because I didn't even think about being able to do a replace in the GUI. When I do a replace, it is usually for a failed drive and I offline the failed drive, remove it, insert the new drive in the same bay, then do the replace. So, I never considered doing a replace with a single drive. Sorry, not thinking of all the options.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,298
I was thinking about is the command zpool split which is used to split a mirrored storage pool. It detaches a disk or disks in the original mirrored pool to create another identical pool.
Sure, I'm familiar with that. I just wouldn't think that's the desired behavior in this case--it leaves you with two identical live pools with the same names, which sounds like a recipe for confusion. zpool detach doesn't leave the detached disk as a usable pool.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
it leaves you with two identical live pools with the same names
The disk that is split is not automatically mounted. It is in an offline state so it can be removed. The example I remember from the documentation was to duplicate the boot pool to make another server with the same configuration and I used this method when I wanted to create a second, identical NAS a few years ago. I just had to boot the new system, not connected to the network and change the IP address and name, then it had everything else was already configured the way I wanted.
 

short-stack

Explorer
Joined
Feb 28, 2017
Messages
80
My SSD pool is creatively called 'SSD'.
This ended up being super quick and easy.

The only weird thing was it only worked with the GPT GUID for the old drive, and the device name for the new one.
Code:
zpool attach SSD gptid/cd431f48-1ba6-11e7-8f07-001517d6681e ada0


It took less than a minute to resilver the 50 or so gigs of data.
Code:
zpool detach SSD gptid/cd431f48-1ba6-11e7-8f07-001517d6681e


Bam new 500 GB pool up and running happily, no downtime of services or anything.

Thanks for the help!
 
Status
Not open for further replies.
Top