How do I move my appdata share to a new cache drive?


Recommended Posts

Hi,

 

first off: unRAID is fantastic.  I can count of the fingers of one hand the pieces of software that have Just Worked and been Easy to Manage.  Many thanks!

 

My problem: I have added a cache drive to my unRAID 6 NAS and want to move my appdata share from Disk 1, where it currently resides, to the cache drive, where I want the mover to ignore it (the object of the exercise is to prevent Plex Media Server -- running under Docker -- from keeping my drives spinning).

 

Is the process as simple as the following?

(1) stop the array;

(2) unRAID Main > Shares > appdata : select Use cache disk: only and remove Disk 1 from Included disks;

(3) unRAID Main > Docker > Plex Media Server : change the container volume mapping for /config from /mnt/user/appdata/PlexMediaServer to /mnt/cache/appdata/PlexMediaServer;

(4) restart the array.

 

Will unRAID automatically handle the migration for me?

 

Advice would be much appreciated!

 

Link to comment

First off, welcome!

 

It's actually even easier than that... (give or take)  ;)

 

No need to stop the array to change a disk share to cache only, but you will need to move the files yourself.

Also, no need to fix the mapping to the container...

Regardless of which disk the files are on, you can still point it to /mnt/user/appdata and if it's set to cache only, it will only be on your cache directory!

 

So..

(1) unRAID Main > Shares > appdata : select Use cache disk: only and remove any include/exclude, it's not needed.. Cache only is cache only, apply, done.

 

(2) Move files from disk 1 to cache drive (this can be done in multiple ways, however you ABSOLUTELY don't want to copy from a user share to disk share (or whatever way that is)).

 

The easiest way is to just use another computer and copy the appdata folder from disk 1 to the cache drive (if in Windows, use the basic file explorer copy/paste).

 

If you do not currently export the disk shares, click on each disk (1, and cache), set export to yes for either SMB or NFS, now use SMB or NFS from another PC to copy it to cache, and when finished delete the copy from disk 1.

 

----- (If you don't feel comfortable using SSH please do not, it shouldn't be needed)-----

 

I have noticed some issues at times attempting to copy in use or permission locked files, so if that's the case and you know how to use Putty to SSH in, just type this.

 

cp -avr /mnt/disk1/appdata /mnt/cache/appdata

 

Once it's successfully transferred (please verify contents prior to continuing by checking your cache share for the appdata folder)

 

rm -rvf /mnt/disk1/appdata

 

  • Upvote 3
Link to comment

Many thanks, I will give this a go when I get home this evening.

 

Just to make sure I understand, setting my appdata share to cache only will automatically create the /mnt/cache/appdata directory for me, into which I can copy the data currently in /mnt/disk1/appdata.  Do I need to change the Plex Docker container mapping for /config from /mnt/user/appdata/PlexMediaServer to /mnt/cache/appdata/PlexMediaServer or will the file system interpret the former as an alias for the latter?

 

Thanks again,

Ralph

Link to comment

Many thanks, I will give this a go when I get home this evening.

 

Just to make sure I understand, setting my appdata share to cache only will automatically create the /mnt/cache/appdata directory for me, into which I can copy the data currently in /mnt/disk1/appdata.

 

Not necessarily, but not sure.. If you haven't written anything to the appdata folder since the change, I would guess it would not. As soon as you did though, it would be there. However just create a folder called appdata on the cache drive and you would then have a folder there.

 

That mapping is for a physical mapped drive (mnt/cache/appdata) , as opposed to a user share mapping (/mnt/user/appdata).

So as an example if you added a folder called "media" on disk1, it is there as soon as you make the folder. The path would be /mnt/disk1/media no "share" needs to be created as it is a path.

 

In that example if you wanted it as a user share, you would make "media" as a user share, and then you could point to /mnt/user/media and it would find the files that are in a "media" folder at the root of any drive.

 

Do I need to change the Plex Docker container mapping for /config from /mnt/user/appdata/PlexMediaServer to /mnt/cache/appdata/PlexMediaServer or will the file system interpret the former as an alias for the latter?

 

No, see below.

 

Also, no need to fix the mapping to the container...

Regardless of which disk the files are on, you can still point it to /mnt/user/appdata and if it's set to cache only, it will only be on your cache directory!

Link to comment

One more thing I'm pretty sure you will have to do is stop and restart the array.  The User Shares file system is only created at array start, so a restart is probably needed to pick up the move (I think!).

 

I'm not sure if this is needed anymore, however I am also just guessing.

For instance if I go into the share page and click compute on a share, it will show me all the drives with that share on it. If I delete that folder from a drive, and hit compute again, it is now gone and no longer listed.

Link to comment

...That mapping is for a physical mapped drive (mnt/cache/appdata) , as opposed to a user share mapping (/mnt/user/appdata).

So as an example if you added a folder called "media" on disk1, it is there as soon as you make the folder. The path would be /mnt/disk1/media no "share" needs to be created as it is a path.

 

In that example if you wanted it as a user share, you would make "media" as a user share, and then you could point to /mnt/user/media and it would find the files that are in a "media" folder at the root of any drive.

unRAID automatically makes a user share for any folder at the top level of cache or an array data disk. So, if you create a folder at the top level of a disk, and you have user shares enabled, then you have effectively created a user share whether you actually go to the shares page and add that as a share or not. That user share will have default settings if you don't set them.
Link to comment

unRAID automatically makes a user share for any folder at the top level of cache or an array data disk. So, if you create a folder at the top level of a disk, and you have user shares enabled, then you have effectively created a user share whether you actually go to the shares page and add that as a share or not. That user share will have default settings if you don't set them.

 

That's good to know, thanks (also I think you're following me..  :D )

Link to comment
  • 3 years later...

I was trying to do this recently and think I may have found a different way that is a little more foolproof.

I wanted to move my appdata share from "disk1" to the "cache."

 

What I did was this:

1. Shutdown the Plex Docker.

 

2. Change the "appdata" user share cache setting from "no" to "Prefer."

    (From help docs for Prefer: When the mover is invoked, files and subdirectories are transferred off the array and onto Cache disk/pool.)

 

3. Run the Mover.

 

4. Change the "appdata" user share cache setting from "Prefer" to "Only."

 

That seemed to do what was explained here, and avoided using the command line.

 

 

  • Like 2
Link to comment
  • 4 years later...
On 7/25/2015 at 10:44 PM, bungee91 said:

cp -avr /mnt/disk1/appdata /mnt/cache/appdata

 

Once it's successfully transferred (please verify contents prior to continuing by checking your cache share for the appdata folder)

 

rm -rvf /mnt/disk1/appdata

Thank you @bungee91 for those SSH command lines.  Worked perfectly for me in moving my appdata files onto a new cache disk, freeing up my NVME to dedicate it to my Gaming VM.

Link to comment
  • 11 months later...

I know this is an old thread but it still seems relevant.

I recently saw a video where the guy said to reduce iowait time to set the appdata share to cache only and instead of mapping /mnt/user/appdata to use /mnt/cache/appdata instead.

I don't really have an iowait issue, just looking to have fast dockers etc. I have given it a go and it appears as if the files are in both /mnt/user/appdata and /mnt/cache/appdata.

If i create a txt file in /mnt/cache/appdata it is also in /mnt/user/appdata.

The appdata "folder" in /mnt/user is listed as appdata@ and a different color, is this just a sym link?

Link to comment
13 hours ago, SavageAUS said:

if the files are in both /mnt/user/appdata and /mnt/cache/appdata.

If i create a txt file in /mnt/cache/appdata it is also in /mnt/user/appdata.

This is expected as they are two different views of the same data.  The /mnt/user is the view via user shares and spans all devices, and the /mnt./cache is the view via the /mnt/cache device.

  • Like 1
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.