Replace A Cache Drive

From Unraid | Docs
Jump to: navigation, search
This page describes how to replace your Cache drive without losing anything

Replacing or upgrading your Cache drive - for unRAID v6.2 and above

Note: these procedures assume that there are Docker or VM related files on the Cache disk. If you are absolutely sure there aren't, the Docker or VM steps can be skipped.
Note: this procedure can be performed with unRAID versions prior to 6.2, but you won't have the Use cache disk: Prefer option. So instead of doing steps 11 and 12, you will have to manually move all files back to the new Cache drive.
  1. Prepare your new Cache drive first. If it's not an SSD, you may want to Preclear it
  2. All plugins, Dockers, and VM's that use the Cache disk in any way must be stopped
    In order to avoid interference, we are about to disable a number of things. You may want to make notes of what you change, so you can reverse it afterward.
    Go to Settings -> Scheduler and change the Mover schedule so it won't run for the next few days (once this procedure is done, you'll change it back)
    Stop all VM's, then go to Settings -> VM Manager and set Enable VMs to No, then click Apply
    Stop all Docker containers, then go to Settings -> Docker and set Enable Docker to No, then click Apply
    If it's installed, make sure the Community Applications Appdata Backup plugin is not scheduled to run during this procedure
  3. Click on Shares and set all shares present on your Cache disk to Use cache disk: Yes. This will cause the Mover to move all shares OFF the Cache drive!
  4. Check that there is enough free space on the array and invoke the Mover by clicking Move Now on the Main page
  5. When the Mover finishes, check that your Cache drive is empty. Any files in the root will not be moved as they are not part of any share. You can ignore any empty folders and Recycle Bin folders, and temporary and trash files, but if there is anything else that you want saved, now is the time! Copy it to a safe place, such as on an array drive.
  6. Stop the array and unassign the old Cache drive
  7. If the new Cache drive is not yet installed in your server, power down and install the new drive, then power back up. Note: you can save yourself a little time by first setting array auto-start temporarily to No (Disk Settings -> Enable auto start).
  8. Assign the new Cache drive
  9. Make sure the file system for the Cache drive is set as you wish (click on the Cache drive and check File system type)
  10. Start the array, and let unRAID format it
  11. Change all shares that you want to exist only on your Cache drive to Use cache disk: Prefer. This will cause the Mover to move these shares back to the Cache drive.
  12. On the Main page, click Move Now
  13. When the Mover finishes, check that the Cache drive is no longer empty, and has all the right shares on it.
  14. Now you can change all shares that you want to be ONLY on your Cache drive to Use cache disk: Only.
  15. Re-enable anything in Settings you disabled before, such as Dockers, VMs, the Mover schedule, and array auto-start
  16. And finally, you can restart any Docker containers and VMs. You are done!
Credit for above goes to John_M and

Replacing or upgrading your Cache drive - for unRAID v6.1 and below

Written for unRAID v5, not fully updated for v6 but should work OK
  1. Preclear the new cache drive
  2. Disable the Mover schedule. Stop all plugins, Dockers, and VM's that run on or use the Cache disk in any way (unsure, but you may also need to temporarily disable Dockers)
  3. Log into your server as root
  4. Run Midnight Commander ('mc' <enter>)
  5. Navigate to your current Cache drive, should be at /mnt/cache
  6. Select all of your Cache files and folders, using the <Insert> button. (.sickbeard, .sabnzbd, etc...)
  7. Make a new backup folder on a specific drive on your array, such as /mnt/disk7/cachebackup
  8. Copy all of the Cache drive files and folders to the folder you just created
  9. Stop the array
  10. Go to the Main tab in the web GUI, and use the drop down for the Cache drive, at the bottom, to reassign the cache drive(s)
  11. Start the array
  12. The new cache drive will show up as unformatted, so go to the bottom of the Main tab, and format the drive. If you Precleared the drive, this should only take a few seconds
  13. With the array running, log into your server as root and run Midnight Commander again
  14. Copy all of the files and folders from your Cache backup (e.g. /mnt/disk7/cachebackup) back to /mnt/cache
  15. Stop the array (will stop all of your additional programs)
  16. Start the array. Bob's your uncle
  17. You may now re-enable the Mover schedule, and restart any plugins, Dockers, or VM's that run on or use the Cache disk
Note: Midnight Commander is used above, you could instead use rsync at the command line. (e.g. rsync -avXH /mnt/cache /mnt/disk7/cachebackup)

More information

Original forum link here
Original cache drive description from Tom here