Remove a drive from unraid

Since I’ve had to do this at least once before, I thought I would borrow the info from the unraid wiki and put it here for my easy reference.  For some reason, unraid doesn’t provide this functionality built in.  Because “nobody needs to remove drives” and “why would you want to do that” and blah blah blah.  Well, I believe my system has gotten out of control with 14 drives and I want to slim it down.  Replace old drives with bigger drives and end up with less drives.

 

My version:

  1. Stop the array (wait till it finishes, unraid keeps a lot of data in RAM), Settings / Global Share Settings / Remove disk from “Included Disks”
  2. Record the disk number/names/SNs
  3. Settings / Disk Settings / change “Tunable (md_write_method) to “reconstruct write”
  4. Install the unbalance app and use it to move data from the disk.
  5. Write data to your array, kick off the mover, if you are using cache drives.  Make sure nothing is still using the disk.
  6. SSH in and create folder on the drive: clear-me
  7. Settings / User Utilities / User Scripts – Run in backgroud.  You can click on the log icon to verify it was happy with your folder and will start the clearing process.  Feel free to randomly check the logs, but it does take a long time.
  8. Once complete, stop the array
  9. Go to Tools then New Config, click on the Retain current configuration box (says None at first), click on the box for All, check the box “I want to do this” and then click Apply
  10. Go back to main, verify drives are correct, remove the one you just zeroed
  11. Start the array, check the box that the parity is already valid.
  12. Just to be safe, kick off a parity check.

 

Borrowed from here:  Shrink Array | Unraid Docs

Procedure
  1. Make sure that the drive you are removing has been removed from any inclusions or exclusions for all shares, including in the global share settings.
  2. Make sure the array is started, with the drive assigned and mounted.
  3. Make sure you have a copy of your array assignments, especially the parity drive. You may need this list if the “Retain current configuration” option doesn’t work correctly.
  4. It is highly recommended to turn on reconstruct write, as the write method (sometimes called ‘Turbo write’). With it on, the script can run 2 to 3 times as fast, saving hours! In Settings -> Disk Settings, change Tunable (md_write_method) to reconstruct write.
  5. Make sure ALL data has been copied off the drive; drive MUST be completely empty for the clearing script to work.
  6. Double check that there are no files or folders left on the drive. Note: one quick way to clean a drive is reformat it! (once you’re sure nothing of importance is left of course!)
  7. Create a single folder on the drive with the name clear-me – exactly 7 lowercase letters and one hyphen
  8. Run the clear an array drive script from the User Scripts plugin (or run it standalone, at a command prompt).
    • If you prepared the drive correctly, it will completely and safely zero out the drive. If you didn’t prepare the drive correctly, the script will refuse to run, in order to avoid any chance of data loss.
    • If the script refuses to run, indicating it did not find a marked and empty drive, then very likely there are still files on your drive. Check for hidden files. ALL files must be removed!
    • Clearing takes a loooong time! Progress info will be displayed, in 6.2 or later. Prior to 6.2, nothing will show until it finishes.
    • If running in User Scripts, the browser tab will hang for the entire clearing process.
    • While the script is running, the Main screen may show invalid numbers for the drive, ignore them. Important! Do not try to access the drive, at all!
  9. When the clearing is complete, click done and stop the array – do not remove the cleared disk yet.
  10. Go to Tools then New Config
  11. Click on the Retain current configuration box (says None at first), click on the box for All, then click on close
  12. Click on the box for Yes I want to do this, then click Apply then Done
  13. Return to the Main page, and check all assignments. If any are missing, correct them. Unassign the drive(s) you are removing. Double check all of the assignments, especially the parity drive(s)! If the cleared drive is “hot-swappable” you may now remove the cleared drive and follow the steps below. If it is not, follow the steps below.
  14. Click the check box for Parity is already valid, make sure it is checked!
  15. Start the array! Click the Start button then the Proceed button (on the warning popup that will pop up)
  16. Parity should still be valid, however it’s highly recommended to do a Parity Check
  17. If you do not have hot swappable drives, you may now safely shutdown your server and remove the cleared drive.

Comments are closed.