Best way to increase storage by switching pools.

victort

Guru
Joined
Dec 31, 2021
Messages
973
What is the best way to increase storage by switching pools?
I’ve read about expanding pools and such, but my aim is to eliminate the Z1 pool and replace it with the Z2 pool.

Say I have a Z1 pool with 4 10TB drives.
I purchase 5 14TB drives and would like to create a Z2 pool with these drives, and copy the data from the old pool to the new pool, as I learn that Z2 is better than Z1.

Assuming that I have enough space on the new pool, is there a way to “swap pools” in a speedy manner?

Is zfs send | zfs recieve the best option?
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
Theoretically you do this;
Code:
zfs snapshot -r ${MY_SRC_POOL}@${MY_SNAP}
zfs send  -Rpv  ${MY_SRC_POOL}@${MY_SNAP} | \
  zfs receive -dFu ${MY_DEST_POOL}
zfs destroy -rv ${MY_SRC_POOL}@${MY_SNAP}
zfs destroy -rv ${MY_DEST_POOL}@${MY_SNAP}

This is exactly what I use to clone my OS pool to alternate boot media, in case recovery is needed. I have proven to myself several times that this method works perfectly for me. Obviously any file still being updated won't be copied completely. So you want a static source pool.

It is also possible to do it from the GUI, but I am more familiar with SHELL command line.

If you need the exact same pool name, that is possible too. After the copy to the new pool, with new pool name, export your old pool. Then export your new pool. Import your new pool using alternate name.

Be sure to move your system Dataset to your boot media before starting. Then after the move is complete, you can switch it back.


Is this the best option?
I don't know.
 
Top