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.

Moving data between shares with different caching rules behaves unexpectedly

Featured Replies

Hi all,

 

I have two shares, downloads and Media.  Downloads uses a cache pool and Media does not.  When a download finishes, I ssh in and 

mv downloads/some_dir/ /mnt/user/Media/.

But this results in two copies of the data, one in /mnt/cache/Media/some_dir/ and the other in /mnt/disk1/Media/some_dir/.  It seems like this is some kind of conflict between the default Linux mv behavior, which simply changes the reference for where data is stored when moving data on the same physical disk, and the UNRAID behavior that follows caching rules.  

 

Is this expected/desired behavior?  It seems very counter-intuitive to me and it results in a warning from Common Problems because a share that doesn't use a cache gets a path on a cache drive.  It also raises questions to me about how reads will behave and if there are potential race conditions (seems unlikely but possible).  

Short answer yes.    But as you say it isn’t very intuitive.

 

The placement rules apply to new files.    The mv command isn’t creating a new file, just renaming an existing file so the placement rules do not apply.

 

You have 2 possible choices:

  • Set the Media share’s cache setting to ‘Yes’ rather than ‘No’ and mover will subsequently move the files from the cache drive to the data drives.
  • change your command to
    mv downloads/some_dir/ /mnt/user0/Media/.

    As share views in user0 does not include the cache drive this forces the mv command to do a copy/delete rather than just a rename.

  • Community Expert

There should never be 2 copies of the same file in Unraid so are you sure that is what is happening?    I would expect the file to stay on the cache drive and not get moved to the array due to how Linux handles mv.     As was said using /mnt/user0 should work.

  • Author

The modified move command makes sense to me and I can change my commands accordingly. 

 

But I seem to be getting conflicting information here in that I absolutely am getting duplicate files and I can delete the one on the cache without removing the one on the array disk (checked and double-checked but I'll check again later today to confirm). 

Edited by JokesOnYou77

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.