Jump to content

Expanding ZFS pool from 1 device to 2 (mirror)


Go to solution Solved by JorgeB,

Recommended Posts

Hi,

 

I'm trying to expand a pool (1 device, nvme, ZFS formatted) to a ZFS mirror, adding another identical nvme.

 

Array stopped, I just expand the pool to 2 devices, assing new nvme to slot 2, set "ZFS - mirror - 1 group of 2 devices" (from "ZFS - single", as until today it was only 1 device) in the pool settings, fire up the array, and I got the following error:

 

Wrong Pool State 

nvme - invalid expansion

 

And in the logs...

 

Jun 29 19:40:51 Rei emhttpd: nvme: invalid expansion: adding devices to hybrid pool

 

How is the process of converting a single device ZFS pool to a 2 devices mirror without losing data?

 

 

  • Like 1
Link to comment
  • Solution

Pool cfg is not correct, try this, unassign the current pool device, change pool slots to 2 but don't assign any device for now, start array, stop array to reset the pool, assign the original pool device only (don't touch the filesystem setting, leave it in auto), start array, pool should mount normally, stop array, now add the 2nd device and start array, again don't touch the filesystem setting, a mirror should be created.

  • Like 1
Link to comment
6 minutes ago, JorgeB said:

Pool cfg is not correct, try this, unassign the current pool device, change pool slots to 2 but don't assign any device for now, start array, stop array to reset the pool, assign the original pool device only (don't touch the filesystem setting, leave it in auto), start array, pool should mount normally, stop array, now add the 2nd device and start array, again don't touch the filesystem setting, a mirror should be created.

Solved, really thanks for your help.

  • Like 1
Link to comment
  • 2 months later...
On 6/29/2023 at 2:02 PM, JorgeB said:

Pool cfg is not correct, try this, unassign the current pool device, change pool slots to 2 but don't assign any device for now, start array, stop array to reset the pool, assign the original pool device only (don't touch the filesystem setting, leave it in auto), start array, pool should mount normally, stop array, now add the 2nd device and start array, again don't touch the filesystem setting, a mirror should be created.

 Jorge,

I am going to be adding another ssd to my single device zfs pool.  Is this the process we should be following or did OP do something wrong when he added the mirror?

 

Edit:

Should I follow the procedure for adding with BTRFS?

 

To add disks to the BTRFS pool perform the following steps:

  1. Stop the array.
  2. Navigate to the Main tab.
  3. Scroll down to the section labeled Pool Devices.
  4. Change the number of Slots to be at least as many as the number of devices you wish to assign.
  5. Assign the devices you wish to the pool slot(s).
  6. Start the array.
  7. Click the checkbox and then the button under Array Operations to format the devices.

Make sure that the devices shown are those you expect - you do not want to accidentally format a device that contains data you want to keep.

Edited by B_Sinn3d
Added BTRFS documentation
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...