Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Replace drive in btrfs cache pool

Featured Replies

Hi all,

 

I have a drive in my cache pool that is steadily gaining reallocated sectors (~5-10 per week). I know it's going to fail soon so I got a new drive to replace it when the time comes. I've looked around for how to replace drives in the cache pool, but I have been unable to find an answer. Has anybody gone through this procedure? If so, can you provide me with some guidance on the best way to do it without losing data. Of course I have backed up the cache drive to the array, so I'll be fine if I end up having to format the cache pool altogether. However, it would be better to avoid having to go down that route. Thanks in advance.

  • Author

Can anybody provide any guidance here? I just tried the procedure guessing at how to do it and failed. Luckily I got back to where I started and lost nothing. Any help would be greatly appreciated! Thanks.

  • 2 weeks later...
  • Author

I figured out how to do this successfully and thought I'd share my steps in case anybody else needed them. Here are my steps:

 

[*]BACKUP YOUR CACHE DRIVE!

[*]Stop the array using the webUI

[*]Add the replacement drive to the cache pool

[*]Start the array

[*]Wait for the updated pool to rebalance

[*]Open a terminal window and run: btrfs device delete /dev/sdX /mnt/cache. Replace sdX with the disk assignment of the failed drive.

[*]Wait for the drive to be deleted from the pool (this will take a while)

[*]Stop the array

[*]Reorder the cache drives in the pool through the webUI. This step is primarily for cleanliness.

[*]Start the array

 

It has been over a week since I did this process, but I'm pretty sure the order of the steps above is correct. I may be able to assist if any of you go through this process and have any issues.

 

  • 8 months later...

Bungy,  I'm about to go through this procedure as my drive is reallocating a sector or two each day, (currently up to 7 reallocated sectors).  yesterday I had only one drive as cache, last night I added another drive so now I have a 2 disk cache pool (and a backup of the data on the array). I'm using my cache drive for recording mythtv, so there's quite a bit to backup (>500GB)

 

Step 5 below is "Wait for the updated pool to rebalance"  - How do I know when this is done?

 

Step 7, similar question, does it show delete progress on the terminal window after running the delete command?

 

Did you replace your drive before complete drive failure?

 

thanks

Everend

  • 6 years later...
On 5/11/2015 at 12:43 AM, Bungy said:

I figured out how to do this successfully and thought I'd share my steps in case anybody else needed them. Here are my steps:

 

...

[*]Open a terminal window and run: btrfs device delete /dev/sdX /mnt/cache. Replace sdX with the disk assignment of the failed drive.

...

 

It has been over a week since I did this process, but I'm pretty sure the order of the steps above is correct. I may be able to assist if any of you go through this process and have any issues.

 

The command of step 6 is not complete: it should state btrfs device delete /dev/sdX# /mnt/cache, or else it gives an error. sdX# needs the partition number on that failing drive. Mostly it is 1. So for example: if you want to remove drive sdf than you should input sdf1

Still seems to be relevant on Unraid 6.11.5 in almost 2023. 

On 1/12/2016 at 9:22 PM, Everend said:

Bungy,  I'm about to go through this procedure as my drive is reallocating a sector or two each day, (currently up to 7 reallocated sectors).  yesterday I had only one drive as cache, last night I added another drive so now I have a 2 disk cache pool (and a backup of the data on the array). I'm using my cache drive for recording mythtv, so there's quite a bit to backup (>500GB)

 

Step 5 below is "Wait for the updated pool to rebalance"  - How do I know when this is done?

You can see the process in the Main tab when you click on the first hard drive in de SSD pool at the Balance status part. Not sure if this applies to older Unraid versions. 

 

On 1/12/2016 at 9:22 PM, Everend said:

Step 7, similar question, does it show delete progress on the terminal window after running the delete command?

I wasn't able to see it other than seeing disks being active in the cache pool on te Main page. I just checked progress the day after if the command line returned the prompt. 

 

I have seen another thread about BTRFS replace commands, but Bungy's step-by-step plan seemed more easily doable. 

 

Cheers!

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...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.