Help cleaning up appdata and cache drive


Medwynd

Recommended Posts

Hoping someone can give me some advice on maintenance tasks and getting my cache disk sorted out.

 

I have been going through and updating my raid array and I noticed that my appdata is spread all over my array, assuredly from misconfiguring it originally years ago.  I have some on the cache, and then some spread across all 6 disks in the array.

 

Currently I don't use the mover at all because my cache ssd is only 256GB and I drop my new movies onto the array a lot so would blow right past the max size.  I want to upgrade the cache to a new ssd over black Friday.

 

The end goal being to be:

  1. Get all of the app data onto my cache disk and fix all the dockers to point to the correct locations, I am only running a handful but the most important is my plex server because I don't want to recreate all the local data.
  2. Setup automatic backup through CA Backup / Restore
  3. Upgrade my cache disk to a new 1 or 2 TB SSD
  4. Setup the mover to run properly

 

I don't know where to begin on step one of this to safely get all the data merged back onto the cache drive.  Currently my appdata share is set to high water, include all disks, use cache = no.

 

The dockers I have running that are using appdata are:

  • binhex-krusader - /config <-> /mnt/user/appdata/binhex-krusader
  • LinuxPlexServer - /config <-> /mnt/cache/appdata/linuxserverplex
  • netdata - /etc/netdata/override <-> /mnt/user/appdata/netdata
  • pihole-template - /etc/pihole/ <-> /mnt/cache/appdata/pihole/pihole/ & /etc/dnsmasq.d <-> /mnt/cache/appdata/pihole/dnsmasq.d/
  • tautulli - /logs <-> /mnt/user/appdata/linuxserverplex/Library/Application Support/Plex Media Server/Logs/ & /config <-> /mnt/user/appdata/plexpy/

 

My docker settings are:

  • Docker vDisk location: /mnt/cache/docker.img
  • Default appdata storage location: /mnt/user/appdata/
Edited by Medwynd
Link to comment
7 hours ago, trurl said:

Looks like your appdata mappings should all work as is.

 

Mover can't move open files so in addition to setting appdata to cache-prefer, you will have to disable Docker in Settings until you get appdata moved.

 

But wont I need to move the files from the various disks they are on to the cache drive after I disable the docker, then set appdata to cache prefer?  Stopping the docker then switching appdata to cache prefer wont automatically copy the current files scattered around the array to the cache drive will it?

Link to comment
32 minutes ago, Medwynd said:

 

But wont I need to move the files from the various disks they are on to the cache drive after I disable the docker, then set appdata to cache prefer?  Stopping the docker then switching appdata to cache prefer wont automatically copy the current files scattered around the array to the cache drive will it?

It is not quite automatic as you then have to start mover from the Main tab to get the files moved from the array to the cache.

Link to comment

That sort of solves half the problem.  So how do I get the data that is already existing on the cache disk into the array?  The data is spread across the cache and the array. 

 

Do I need to:

  1. Disable docker
  2. Do something here to get appdata using the cache currently to now use the array.  Would I change included disks to be one od the disks in my array?
  3. Tell the mover to move, this should get everything off the current cache disk
  4. Shutdown
  5. Replace the cache disk
  6. Reassign the cache disk to the new drive then set appdata to use cache prefer
  7. Move again, in theory this should move them all back to the cache disk
  8. Enable docker again

This I think gets everything that was on the old cache disk onto the new cache disk.

 

Does switching appdata to cache:prefer also move data from /mnt/user/appdata to /mnt/cache/apppdata automatically, thus all appdata should be on my new cache drive and all my dockers should be using the cache drive?

 

Should I go and change the paths the dockers are using afterwards?  For example, netdata has  /etc/netdata/override <-> /mnt/user/appdata/netdata.  Should I change /mnt/user/appdata/netdata to /mnt/cache/appdata/netdata?  Mainly because I have a mish mash of both methods across my dockers and want to normalize them to one way.

 

 

Edited by Medwynd
Link to comment
1 hour ago, Medwynd said:

Do something here to get appdata using the cache currently to now use the array. 

The same as any other user share gets moved from cache to array, by setting it to cache-yes.

 

There is Help in the webUI. You can toggle Help for the whole webUI with Help (?) on the main menu bar. You can also toggle help for a specific setting by clicking on its label.

 

Link to comment
1 hour ago, trurl said:

The same as any other user share gets moved from cache to array, by setting it to cache-yes.

 

There is Help in the webUI. You can toggle Help for the whole webUI with Help (?) on the main menu bar. You can also toggle help for a specific setting by clicking on its label.

 

Ive never had to do that before so I'm pretty clueless about it and didnt want to mess this up :)  I'll take a look in the webui, thanks.

Link to comment

Regarding "Do something here to get appdata using the cache currently to now use the array. " you replied "The same as any other user share gets moved from cache to array, by setting it to cache-yes."

 

My appdata share is set to:

  • Included disks: all
  • Use cache: No

I want to get appdata on the cache onto the array, so how does setting it to cache-yes mean move it to the array?  The help says
 

Quote

Yes indicates that all new files and subdirectories should be written to the Cache disk/pool, provided enough free space exists on the Cache disk/pool.

 

I dont know why there is even data on the cache drive, I am assuming because some of my dockers say to use /mnt/cache/appdata?

 

Im pretty confused at this point.

Edited by Medwynd
Link to comment
1 hour ago, Medwynd said:

The help says

Quote

Yes indicates that all new files and subdirectories should be written to the Cache disk/pool, provided enough free space exists on the Cache disk/pool. If there is insufficient space on the Cache disk/pool, then new files and directories are created on the array.

And then right after that it says

Quote

When the mover is invoked, files and subdirectories are transferred off the Cache disk/pool and onto the array.

 

1 hour ago, Medwynd said:

I dont know why there is even data on the cache drive, I am assuming because some of my dockers say to use /mnt/cache/appdata?

cache is part of user shares. It is where cache-prefer and cache-yes user share data is written. Normally you want appdata to be on cache so your dockers will not have performance impacted by slower parity, and so your dockers won't keep array disks spunup.

 

The real question is how did you get any of appdata on the array? But, it doesn't matter now, since you are trying to get it moved to the array so you can replace cache.

Link to comment

So I attempted to move the files off the cache as instructed but some files did not move.

I stopped all the dockers, stopped my vm, turned off docker, and rebooted.

 

It looks like all the files that are still on the cache disk are colored orange in the file listing in the webgui, but I couldnt find what that means.

 

The main thing that didnt move was files under /mnt/cache/appdata/linuxserverplex

 

Running find on the folder counts 5155 files.  So if the solution involves deleting files from the array, it could be a tedious task

/mnt/cache/appdata/linuxserverplex# find -type f | wc -l
5155

 

Looking at the files these are the permissions:

Sample Plex file permissions

-rw------- 1 nobody users     3584 Nov 17  2019 CloudAccess.dat
-rw------- 1 nobody users     6096 Mar 25  2019 CloudAccount.dat
-rw-r--r-- 1 nobody users     1700 Aug 15 20:37 ca.crt
-rw-r--r-- 1 nobody users     3222 Aug 15 20:37 certificate.p12
-rw-r--r-- 1 nobody users 57221120 Oct 17  2016 gn_lists.gdb

 

It looks like a bunch of the files already exists according to the mover

Nov 29 22:39:24 move: move: file /mnt/cache/appdata/linuxserverplex/Library/Application Support/Plex Media Server/Metadata/Movies/5/4c1d6b069d238691dac022ab5713ffb575c3310.bundle/Contents/com.plexapp.agents.imdb/posters/24ab8149a83956561935618ff14bfe65c8792aaf
Nov 29 22:39:24 move: move_object: /mnt/cache/appdata/linuxserverplex/Library/Application Support/Plex Media Server/Metadata/Movies/5/4c1d6b069d238691dac022ab5713ffb575c3310.bundle/Contents/com.plexapp.agents.imdb/posters/24ab8149a83956561935618ff14bfe65c8792aaf File exists
Nov 29 22:39:24 move: move: file /mnt/cache/appdata/linuxserverplex/Library/Application Support/Plex Media Server/Metadata/Movies/5/4c1d6b069d238691dac022ab5713ffb575c3310.bundle/Contents/com.plexapp.agents.imdb/posters/0012c827ea231a936d1efaee58f0c5128acc736e
Nov 29 22:39:24 move: move_object: /mnt/cache/appdata/linuxserverplex/Library/Application Support/Plex Media Server/Metadata/Movies/5/4c1d6b069d238691dac022ab5713ffb575c3310.bundle/Contents/com.plexapp.agents.imdb/posters/0012c827ea231a936d1efaee58f0c5128acc736e File exists
Nov 29 22:39:24 move: move: file /mnt/cache/appdata/linuxserverplex/Library/Application Support/Plex Media Server/Metadata/Movies/5/4c1d6b069d238691dac022ab5713ffb575c3310.bundle/Contents/com.plexapp.agents.imdb/posters/d4c427db39c7e47b1620a90fa024b15bcbeed3bf
Nov 29 22:39:24 move: move_object: /mnt/cache/appdata/linuxserverplex/Library/Application Support/Plex Media Server/Metadata/Movies/5/4c1d6b069d238691dac022ab5713ffb575c3310.bundle/Contents/com.plexapp.agents.imdb/posters/d4c427db39c7e47b1620a90fa024b15bcbeed3bf File exists
Nov 29 22:39:24 move: move: file /mnt/cache/appdata/linuxserverplex/Library/Application Support/Plex Media Server/Metadata/Movies/5/4c1d6b069d238691dac022ab5713ffb575c3310.bundle/Contents/com.plexapp.agents.imdb/posters/ab4d9ad9786b707823ee26d246d08a8dad15601d
Nov 29 22:39:24 move: move_object: /mnt/cache/appdata/linuxserverplex/Library/Application Support/Plex Media Server/Metadata/Movies/5/4c1d6b069d238691dac022ab5713ffb575c3310.bundle/Contents/com.plexapp.agents.imdb/posters/ab4d9ad9786b707823ee26d246d08a8dad15601d File exists

Other files it says do not exist, before saying it already exists, which I dont understand

Nov 29 22:39:25 root: Specified filename /mnt/cache/appdata/linuxserverplex/Library/Application Support/Plex Media Server/Metadata/Movies/5/ff01a6fc396e55066fc797ebada698393b9f8b2.bundle/Contents/_combined/posters/com.plexapp.agents.localmedia_06dd59409639376382df389abfb8143c8a9b3f1f does not exist.
Nov 29 22:39:25 move: move: file /mnt/cache/appdata/linuxserverplex/Library/Application Support/Plex Media Server/Metadata/Movies/5/ff01a6fc396e55066fc797ebada698393b9f8b2.bundle/Contents/_combined/posters/com.plexapp.agents.localmedia_06dd59409639376382df389abfb8143c8a9b3f1f
Nov 29 22:39:25 move: move_object: /mnt/cache/appdata/linuxserverplex/Library/Application Support/Plex Media Server/Metadata/Movies/5/ff01a6fc396e55066fc797ebada698393b9f8b2.bundle/Contents/_combined/posters/com.plexapp.agents.localmedia_06dd59409639376382df389abfb8143c8a9b3f1f File exists


Nov 29 22:39:26 root: Specified filename /mnt/cache/appdata/linuxserverplex/Library/Application Support/Plex Media Server/Metadata/Movies/5/0af15bc4d460dfab079ea93136a46a16ce5e7a1.bundle/Contents/_combined/art/com.plexapp.agents.imdb_a1dcc15daf695a9876440eefb81d3b1a33aad475 does not exist.
Nov 29 22:39:26 move: move: file /mnt/cache/appdata/linuxserverplex/Library/Application Support/Plex Media Server/Metadata/Movies/5/0af15bc4d460dfab079ea93136a46a16ce5e7a1.bundle/Contents/_combined/art/com.plexapp.agents.imdb_a1dcc15daf695a9876440eefb81d3b1a33aad475
Nov 29 22:39:26 move: move_object: /mnt/cache/appdata/linuxserverplex/Library/Application Support/Plex Media Server/Metadata/Movies/5/0af15bc4d460dfab079ea93136a46a16ce5e7a1.bundle/Contents/_combined/art/com.plexapp.agents.imdb_a1dcc15daf695a9876440eefb81d3b1a33aad475 File exists

 

EDIT: I got libvert.img to move.  I had forgotten to also turn off VMs under Settings->VM Manager->Enable VMs = No
Additionally just this one file /mnt/cache/vdisks/libvirt.img

-rw-rw-rw- 1 nobody users 1073741824 Nov 29 22:10 libvirt.img

 

I turned on the mover log and saw libvert was skipped but I dont know why, its size is 1.07 GB

Nov 29 22:39:26 move: move: skip /mnt/cache/vdisks/libvirt.img

 

Edited by Medwynd
Link to comment

Mover also won't move duplicates. You might be able to look at dates to decide which is the current files, but typically, the files already on cache would have priority when referencing user shares so those should be the correct ones and the others could be deleted (might back them up first just in case).

Link to comment

I think my terminology might be mixed up so excuse me.

 

What is the best way to expose the files in the array that it thinks are duplicates?  Is there a share I can export?

 

I'd like to use beyond compare to compare the files on the cache drive vs the files in the array.  If the cache drive is all newer or the same I can pretty safely just delete all the files in the array that are duplicates.

 

What is the safest way to delete the duplicate files on the array so that the mover can automatically move the files off the cache drive?

Link to comment

I always use the built-in Midnight Commander (mc at the command line) to manage files directly on the server. But if you want to work with them over the network you will have to share the disks in Global Share Settings.

 

Note that you must never mix user shares and disks when moving or copying. Linux (and Windows for that matter) doesn't realize the user shares and the disks may reference the same files, so it is possible to lose data when you it tries to overwrite what it is trying to read.

 

I always discourage sharing disks for this reason or others, so after you are finished I recommend changing back to not sharing disks.

Link to comment

I mostly want to share the disks so that I can use beyond compare to diff the entire structure easily.  I can try to do the moves and deletes in MC.

 

Looking at the user share (/mnt/user/appdata), it says the files are spread across "Cache, Disk 1, 2, 6".  So do I need to make a disk share for disk 1, disk 2, and disk 6?  Once I have those three shares (disk 1, 2, and 3) created how do I compare it the files on the disk, via the disk share, with the files in /mnt/cache/appdata/linuxserverplex?  Am I allowed to make a disk share for the cache as well?  If so then can I compare the share for the cache disk with the shares for disk 1, 2, and 6?

 

It sounds like I am then free to delete files out of the disk shares.  I just have to make sure I never use the share associated with /mnt/user/appdata/linuxserverplex for any of the operations correct?

 

EDIT: I just realized it made those shares automatically when you enabled the setting

So from windows I should be able to work in \cache\appdata, \disk1\appdata, \disk2\appdata, and \disk6\appdata as long as I DO NOT use \appdata (which is the user share)?

Edited by Medwynd
Link to comment
3 minutes ago, Medwynd said:

make a disk share for the cache as well?

yes, cache is a disk.

 

4 minutes ago, Medwynd said:

never use the share associated with /mnt/user/appdata/linuxserverplex for any of the operations correct?

Never use any share except disk shares when working with disk shares. Never use any shares except user shares when working with user shares.

 

Also, make sure you don't already have a user share named for a disk. It is possible to make a user share with the same name as a disk by accidentally specifying a path like that somewhere such as a docker mapping. If you have a user share named the same as a disk then you won't know what you are working with on the network. Just another reason to not share disks on the network.

Link to comment
31 minutes ago, trurl said:

yes, cache is a disk.

 

Never use any share except disk shares when working with disk shares. Never use any shares except user shares when working with user shares.

 

Also, make sure you don't already have a user share named for a disk. It is possible to make a user share with the same name as a disk by accidentally specifying a path like that somewhere such as a docker mapping. If you have a user share named the same as a disk then you won't know what you are working with on the network. Just another reason to not share disks on the network.

 

"It is possible to make a user share with the same name as a disk by accidentally specifying a path like that somewhere such as a docker mapping."

Thanks,  I double checked and have no user shares named the same as a disk.  I looked at the main shares tab to compare user share and disk share names.  If a user share was created via "accidentally specifying a path like that somewhere such as a docker mapping" it would still show up on this screen in the webgui correct?

 

I think I might make backups of everything and just delete any duplicate files on the disk and hope for the best, unless you happen to have any good suggestions besides file date.  It is kind of hard to tell what is what inside the Plex cache folders and if I have to blow it all up then so be it. 

 

For example disk1\appdata\linuxserverplex has files dated 11/13/20 while cache\appdata\linuxserverplex has files from 10/17/16.

But this isnt consistent as all of the files in disk2\appdata\linuxserverplex are from 10/17/2016 and most of the matching files on cache\appdata\linuxserverplex are mostly newer.  So it is hard to even tell what data linuxserverplex was using, data from the cache disk or the array disks.

 

 

Edited by Medwynd
Link to comment

I think I am getting closer. 

 

Duplicate Files

Using beyond compare I can compare cache\appdata\linuxserverplex and disk2\appdata\linuxserverplex.  There are 8030 files that are exact duplicates. 

 

I am attempting to delete the files on disk 2 through Beyond Compare but I think I have some sort of access problem.  When I try to delete the same file through windows I get a "File Access Denied" error.  It says I "require permission from server\nobody to make changes to this file".

 

When I look at the disk share in the webgui it says the security is set to public.  How do I get permission to delete these from the disk share?

 

Newer Files

There are 485 files on the cache that are newer I am going to attempt to delete these files via the disk2 share as well.

 

Locked Files

When I was making a copy of the folders from the disk shares, I found 6 files on the cache drive it straight up told me access was denied.  I havent quite figured out how to solve that either.

 

Link to comment
5 minutes ago, trurl said:

If you have docker enabled then some files will be open and so can't be deleted.

It's is definitely disabled, I have no docker option at the top of the screen.

 

Some suggestions were to run "Docker Safe New Perms" but that seems like a last resort, but that seems to be an answer used in a lot of the posts for files that have to be deleted by server\nobody.

 

Permissions on one of the files is this if it helps any:

-rw-r--r-- 1 nobody users       0 Oct 17  2016 Plex\ DLNA\ Server\ Neptune.log

 

Edited by Medwynd
Link to comment

  

39 minutes ago, trurl said:

It is docker safe because it doesn't touch appdata.

That is what I was reading.  I dont know how to get permission to delete these files though.  I really dont want to manually delete 8000+ files via midnight commander.  I'd ideally not want to mess with their permissions for fear of screwing up the plex docker.

 

Would making a windows user named "nobody" then connecting to the share allow me to permission to delete them?

 

I tried setting disk2 to private then setting smv user accedd for one of my unraid users to Read/Write and could still not delete a file.

 

Edit: Making a windows user named nobody seemed to let me delete the files

Edited by Medwynd
Link to comment
4 hours ago, trurl said:

That doesn't really make any sense but whatever.

Yeah I cant explain it either.  I made a windows user named nobody then I could access the files on the disk shares from windows when I was logged in to windows as the user "nobody".

 

  1. Should I reset the shares to cache prefer then activate the mover before reenabling Docker?
  2. Also, for getting this setup the actual proper way, when restarting docker should the vDisk be /mnt/cache/docker.img and the default appdata storage location be /mnt/user/appdata/?
  3. Finally, should I reconfigure any of the dockers before I create them?

Before this project, the dockers I had running that were using appdata were:

  • binhex-krusader - /config <-> /mnt/user/appdata/binhex-krusader
  • LinuxPlexServer - /config <-> /mnt/cache/appdata/linuxserverplex
  • netdata - /etc/netdata/override <-> /mnt/user/appdata/netdata
  • pihole-template - /etc/pihole/ <-> /mnt/cache/appdata/pihole/pihole/ & /etc/dnsmasq.d <-> /mnt/cache/appdata/pihole/dnsmasq.d/
  • tautulli - /logs <-> /mnt/user/appdata/linuxserverplex/Library/Application Support/Plex Media Server/Logs/ & /config <-> /mnt/user/appdata/plexpy/

Is the preferred location for appdata to be the user share at mnt/user/appdata/<docker> or the drive at mnt/cache/appdata/<docker>?

 

Edited by Medwynd
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.