Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[ABANDONED] Cache drive: How to keep directory structure persistent after MOVER

Featured Replies

My server downloads to my cache drive, with the TV segment being hands-off, but the movies/docs downloads always require some hands-on finessing to eliminate junk files before they're ready for the server.  I do this manually in Windows explorer, but I'm running into difficulty in simply moving files around on the cache disk.  The directory structure on the cache drive isn't persistent.  (i.e. tower\cache\MOVIE doesn't exist until something is copied to the MOVIE share)

 

The problem with that- is that oftentimes opening the share to copy TO it, causes the server to spin up portions of the array to complete the directory listing.  I use cachedir, but I won't NEED it for this activity, IF I can simply shuffle files around within the confines of the cache disk.

 

Is there any way to KEEP the folders static on the cache drive?  As it stands, I cannot create working shortcuts to them- because they disappear every day.

If you copy a file to /mnt/user/movie and the file does not already exist in the array, then the requisite folder or path will be created on the cache drive. cache-dirs should keep the array disks from spinning up for this operation.

  • Author

Windows will not copy a file to a folder that does not exist.

The idea is to configure a share on your array to use the cache drive (go to the shares tab on the web page, click on the share and then select 'use cache drive').  You then copy your files directly to this share and it will copy to the cache drive automatically (unless the cache drive is full then it will copy to the array with parity).  The mover will then move the files from the cache to the array when the script runs.  In other words, don't write directly to the cache disk - configure the share to use the cache disk and write directly to the share on the array.

Right. The destination should be the tower/Movies share. If the Movies share is configured to use the cache drive then the file will be written to the cache drive and and required folders in the file path will be created on the cache drive. This happens transparently to the operator.

  • Author

Can you tell me how to copy something to a folder via Windows explorer WITHOUT Windows first showing the contents of the destination folder??

 

It's that directory listing that causes my drives to spin up.

 

My shares already use the cache drive. 

 

If your array disks are spinning up from simply listing a directory then cache dirs is not working. That's precisely what cache dirs was made to prevent from happening.

 

How are you loading cache dirs each time you boot up your server? Simply having the cache_dirs script on your flash drive does not load it. You have to run it with the parameters and directories you want cached. Most people add a line to their go script to run it with the parameters and directories they want. For instance, I have the following in my go script:

 

/boot/cache_dirs -w -B -u -m1 -M10 -d9999 -i Downloads -i other -i Backups -i Movies -i "TV\ Shows"

  • Author

I think you may be onto something there!  Below is the last line from my GO file, and I KNOW I didn't type all that in by hand.  I do have unmenu installed

 

I can't seem to do a straight cut/paste from my GO file, since the line in question appears to have characters that cause a carriage return when cut/pasted.... but it's ONE line that reads:  (I've put the glowing characters in-place of them)

 

/boot/unmenu/uu[glow=red,2,300]XX[/glow] cd /boot/packages && find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c[glow=red,2,300]X[/glow] /boot/cache_dirs  -w

It's that directory listing that causes my drives to spin up.

 

If your array disks are spinning up from simply listing a directory then cache dirs is not working. That's precisely what cache dirs was made to prevent from happening.

Windows by default reads the files to generate thumbnails, which will spin up the drive regardless of the cache_dirs script.

 

If you are ok with empty directories building up on the cache drive, you can modify the mover script to not delete the folder structure after it's done moving the files.

  • Author
If you are ok with empty directories building up on the cache drive, you can modify the mover script to not delete the folder structure after it's done moving the files.

 

I had envisioned there would be some way to selectively set certain folders' permissions/configurations, such that, only they wouldn't be discarded.  Is that not possible? 

If you are ok with empty directories building up on the cache drive, you can modify the mover script to not delete the folder structure after it's done moving the files.

 

I had envisioned there would be some way to selectively set certain folders' permissions/configurations, such that, only they wouldn't be discarded.  Is that not possible?

Don't know. Why don't you try it and find out?
  • Author
Don't know. Why don't you try it and find out?

 

I don't know HOW to do that.

 

 

Can Windows be set to not read from the shares all the time?

  • Author
Can Windows be set to not read from the shares all the time?

 

Windows doesn't read from the shares constantly- only when you SELECT one for an operation.

 

Unless you map the share to a drive letter, Windows doesn't verify its existence until you click on it.  MY problem arises when I attempt to copy something TO a share.  To complete the copy process, you select the destination and PASTE.  The instant you select the destination, THEN Windows attempts to open it, and that's when I  would get an error if attempting to a folder that doesn't already exist.

Can Windows be set to not read from the shares all the time?

 

Windows doesn't read from the shares constantly- only when you SELECT one for an operation.

 

Unless you map the share to a drive letter, Windows doesn't verify its existence until you click on it.  MY problem arises when I attempt to copy something TO a share.  To complete the copy process, you select the destination and PASTE.  The instant you select the destination, THEN Windows attempts to open it, and that's when I  would get an error if attempting to a folder that doesn't already exist.

 

Why are you writing to a non-existant path?

 

  • Author

I understand what's going on here now.  I apologize for asking for assistance.  In the future, I will definitely think twice before posting here.

I understand what's going on here now.  I apologize for asking for assistance.  In the future, I will definitely think twice before posting here.

 

I'm not trying to pull your chain. I just want to understand the issue. This is an unusual problem.

 

Can Windows be set to not read from the shares all the time?

 

Windows doesn't read from the shares constantly- only when you SELECT one for an operation.

 

Unless you map the share to a drive letter, Windows doesn't verify its existence until you click on it.  MY problem arises when I attempt to copy something TO a share.  To complete the copy process, you select the destination and PASTE.  The instant you select the destination, THEN Windows attempts to open it, and that's when I  would get an error if attempting to a folder that doesn't already exist.

 

Why are you writing to a non-existant path?

 

 

Writing to the user share with the cache enabled will place the file on the cache drive with the correct path created as needed on the cache drive. This will only happen if the path already exists on the share, however. The issue seems to be that Windows reads a bunch of files when a share is opened and that is spinning up disks that you'd rather not have spin up. This is not a common problem. A lot of people use Windows with unRAID and they use cache-dirs to prevent the disks from spinning up. Why do they spin-up on your system and not everyone else's?

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.