GUI Based Shrink Array Functionality


Recommended Posts

Here is the current official guidance on how to shrink your array: https://docs.unraid.net/legacy/FAQ/shrink-array/

 

Our Current Scenario:

There are 2 options when it comes to removing drives, and both are very involved with multiple (9 or 17 steps + 5 subnotes) steps and involves updating your disk configuration list manually which risks data loss if the user mistakenly swaps a data disk as parity, or puts a pool drive in the wrong slot.

 

Additionally, this FORCES the user to start the array with it warning them if they messed up, they risk data loss (without knowing necessarily if they messed up before the array starts).

 

Request:

I would want a simple "disk removal" button in the instance there are 0 reachable files on the disk (no shares data). I, as a user, can manually move all my files off of the disk to be removed, and once complete, I can stop the array and remove the disk via. the GUI. As simple as:

 

  1. Move all files from the disk you wish to remove to other disks in the array
  2. Once all files are removed, and looking at the disk content shows 0 files or shares, stop the array
  3. Click the "remove disk" button next to the disk in the array"
  4. Start the array

 

Where the user does not have to be concerned with disk configurations or risking assigning a disk incorrectly resulting in data loss.

Request (Stretch Goal)

I, as an UNRAID user, would want the ability to mark a disk from the array as "to be removed", where UNRAID will automatically move files off of that disk.

 

Once there are 0 files remaining on the disk, UNRAID would

  1. (Option 1): Automatically remove the disk and populate it as an unassigned device while the array is still running
  2. (Option 2): When the array is shut down, check the contents of the marked disk and if there are 0 share files, move it to an unassigned device.

(Unsure on backend technical limitations for removing a disk from the array while in a non-stopped state or checking the folder structure of a disk while in a stopped state).

 

-------------------------------------------------

 

(In case the link updates, current instructions on how to clear array):

 

1. The "Remove Drives Then Rebuild Parity" Method

Quote
  1. Make sure that the drive or drives you are removing have been removed from any inclusions or exclusions for all shares, including in the global share settings. Shares should be changed from the default of "All" to "Include". This include list should contain only the drives that will be retained.
  2. 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
  3. Stop the array (if it is started)
  4. Go to Tools then New Config
  5. Click on the Retain current configuration box (says None at first), click on the box for All, then click on close
  6. Click on the box for Yes I want to do this, then click Apply then Done
  7. 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)!
  8. Do not click the check box for Parity is already valid; make sure it is NOT checked; parity is not valid now and won't be until the parity build completes
  9. Start the array to commit the changes; system is usable now, but it will take a long time rebuilding parity

 

 

2. The "Clear Drive Then Remove Drive" Method

Quote
  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).
    1. 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.
    2. 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!
    3. 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.
    4. If running in User Scripts, the browser tab will hang for the entire clearing process.
    5. 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.

 

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.