Jump to content

BTRFS cache pool reorganization


boxer74

Recommended Posts

Question on reworking my cache pool. Points as follows:

  • Currently I have 4x 400gb SSDs in a BTRFS RAID10 pool.
  • Would like to replace with 2x 1TB NVME drives in BTRFS RAID1 pool.
  • To avoid using the old approach of having the mover temporarily move shares off the old pool and then back onto the new pool, I'd like to avoid downtime (wife+kids+friends need their plex) as follows and need to know if this will work:
    • Convert current pool to RAID1 using balance command in GUI.
    • Stop array.
    • Add 2x 1TB NVME drives to pool, let rebalance.
    • Stop array.
    • Unassign first 400gb SSD from pool.
    • Start array.
    • Let rebalance finish.
    • Stop array.
    • Unassign second 400gb SSD from pool.
    • Start array.
    • Let rebalance finish.
    • Stop array.
    • Unassign third 400gb SSD from pool.
    • Start array.
    • Let rebalance finish.
    • Stop array.
    • Unassign fourth 400gb SSD from pool.
    • Start array.
    • Let rebalance finish.
    • Stop array.

 

In hindsight after writing the above steps, I'm not sure this is any less disruptive to my plex viewers, though the start/stop processes are quick. Moving 400GB off and back onto the pool could take hours.

 

Any thoughts on which method is best?

 

Link to comment

Fastest and least intrusive way would be to do an online device replacement using the command line, replace cache1 with an NVMe, then replace the other one, balance the pool to raid1 and then remove the 2 extra devices, after all is done stop the array, unassign all the SSDs, assign the two NVMe devices and start the array.

Link to comment

Well, turns out this don't work on the latest releases since unRAID will consider the new devices new and delete part of the btrfs info, you'll need to do it using the GUI.

 

Note, as long as the pool is healthy this should be a low risk operation, but it's always a good idea to backup any irreplaceable data before beginning.

 

If profile is already raid1 you can start:

 

-stop the array

-on the GUI replace cache1 with 1st NVMe device

-start the array, balance will start, wait for it to finish, you won't be able to stop the array before it's finished, you'll see a "btrfs operation running", as long as you're using latest stable or rc, and you should be using one or the other.

-when done stop array

-replace cache2 with 2nd NVMe device

-start array

-when balance done stop array

-unassign one of the extra SSDs

-start the array, wait for balance to finish

-stop array

-unassign remaining SSD

-start the array, when balance finishes you're done.

 

I'm going out for a couple of hours but will check in later if you have any issues.

 

 

 

 

 

 

Link to comment

After some testing the online replacement/removal can still be done, it just needs an extra step in the end, but the procedure above works just as well, the main advantage of the this one is not needing all those array stop/starts, I'm going to post it anyway, also for my future reference, you can use either one.

 

Again like the other one, this should be a low risk operation, but it's always a good idea to backup any irreplaceable data before beginning.

 

To do the online replacement both NVMe devices need to be already partitioned, if you haven't yet install the Unassigned devices plugin and format both devices, any filesystem will do, then you can start:

 

btrfs replace start -f /dev/sdX1 /dev/nvmeXXXp1 /mnt/cache

Replace X with cache1 identifier, note the 1 in the end, replace XXX with first NVMe identifier, note p1 in the end.

 

You can check replacement progress with:

btrfs replace status /mnt/cache

When done repeat the command for cache2 and NVMe 2.

 

Again check status and when done you can remove the extra devices, you can remove both at the same time, if there's lots of data and it fails remove one at a time:

btrfs dev remove /dev/sdX1 /dev/sdY1 /mnt/cache

Replace X with cache3 and Y with cache 4, again note the 1 in the end.

 

When done you'll get the cursor back, stop the array, unassign all old cache devices, and this is very important, start the array with no cache devices assigned so that unRAID "forgets" the old cache pool, stop the array, only after doing can you assign the new cache devices, start the array and you're done.

 

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...