Jump to content

Cant move files from zfs cache to another share


Go to solution Solved by ZekerPixels,

Recommended Posts

Hello everyone,

 

I have been using unraid for quite some time and with the recent release of 6.12.2, I decided to switch my cache pool to zfs. So far, I like it and the zfs master plugin is making and restoring snapshots really easy. I did convert my btrfs cache to zfs by following along with the the two most recent videos of SpaceinvaderOne.

 

However after doing this I have one problem; I'm unable to move files from one share to another share, (and just let mover put it on the array once a month) when the file I want to move exists on the zfs cache pool. Before converting to zfs, I could do this without any problems on 6.12.2, by using a rootshare.

 

So what happens is; I have a downloads share which is cache only, obviously my downloads go into this share. So, I downloaded the new linux iso and want to move it to the isos share, but now because this file is in the zfs cache pool I cant move it there anymore.

 

Another example; lets say I have a document on my pc and copy it to the photos share. Because my photos share uses cache, I get a new photos folder on the cache with this file, placed in zfs cache pool. But unfortunately stupid me, I put the file in the wrong folder. Lets move it from the photos folder to the documents folder using the rootshare, like I always did. Well that does not work anymore. After letting mover put it on the array, the photos folder on the cache disappears (because everything has been put onto the array) and my file is now on disk1. Now I can move this file, but obviously now my file is not on the drive it supposed to be, because my document share is on disk2.

 

I cant possibly be the only person encountering this, I described two, I assume very common things everyone does. Previously the solution to move between shares was to use a rootshare, if that doesn't work with zfs, it is definitely mentioned somewhere, but I cant find anything about it except my own topic on the forums. Probably because the search term zfs leads to many many other things.

 

As a question, how do I move a file on zfs to another share? also doing this without accessing unraid.

Thx

 

 

  • Copying to another share does work, but then you have to manually remove the original. Also copying takes time and unnecessarily doubles the writes on the cache ssd.
  • Also moving a file from the array to anywhere, including a cache only share works.
  • Moving a file existing on the zfs cache cannot be moved between shares. This does not work with a rootshare and also not with krusader.
Edited by ZekerPixels
Link to comment
  • ZekerPixels changed the title to Cant move files from zfs cache to another share
8 hours ago, JorgeB said:

I have no issues moving data from zfs share to share, can you give a quick example of what you are trying to do and the error you get?

 

I dont get a error, what goes wrong is when I to move a file/folder which is on the zfs cache, I cannot move between shares. It will always copy it, not move. So it will take a long time and doubles the writes to the ssds. Are you sure it moves, not copy?

 

 

I dont know a good way to make a clear description. But I will try to explain, but its kind of difficult.

  • I have an Array which consists of 6 drives and 2 parity in xfs. The Cache consists of 2 ssds and is a zfs mirror.
  • On the array I have a share "Media", which uses cache as primary storage and Array as secondary. Mover moves from cache to array.
  • On the array I have a share "Documents", which uses cache as primary storage and Array as secondary. Mover moves from cache to array.
  • On the cache I have a share "Downloads", which is cache only.

Lets say, I want to do is move something from Documents to Media.

  1. I open two windows and open: "//tower/Documents/" and "//tower/Media/" and move the file.
  2. This does not really work because it does not move the file. Because it does copy and delete, so this results in double the writes to the ssd and it takes a long time.
  3. Solution to this is to use a rootshare, so I open "//tower/rootshare/Documents/" and "//tower/rootshare/Media/"
  4. Now moving works, and it is instantaneously and without extra writes.

Now, I want to move a file from Downloads to Media.

  1. Again I open two windows and open: "//tower/Downloads/" and "//tower/Media/" and move the file. This copies and not move the file.
  2. Now I As previous we should use the rootshare, so I open "//tower/rootshare/Downloads/" and "//tower/rootshare/Media/"
  3. Here is where the issue comes, Windows would still copy the files not move and Dolphin in Linux refuses to do it "Could not rename file smb://path".

 

Before I had a btrfs cache, everything worked as I described in "Documents to Media" and didnt matter if it involved the cache or not. But since I have the zfs cache, I cannot move anything on the cache because it will always copy.

 

Edited by ZekerPixels
Link to comment
27 minutes ago, ZekerPixels said:

It will always copy it, not move.

I missed that part, that's normal because with zfs a new dataset is created for every share, so that's for all purposes a different filesystem, one workaround if you really want that would be to create the shares manually with mkdir, so no dataset gets created, but of course will lose option to snapshot just that dataset, etc.

  • Thanks 1
Link to comment
22 hours ago, JorgeB said:

I missed that part, that's normal because with zfs a new dataset is created for every share, so that's for all purposes a different filesystem, one workaround if you really want that would be to create the shares manually with mkdir, so no dataset gets created, but of course will lose option to snapshot just that dataset, etc.

I kind of had a idea it had something to do how zfs works, so it is because of the datasets. Well, thank you for leading me toward a solution with mkdir, its not ideal, but it works easier than every other solution I had.

Edited by ZekerPixels
Link to comment
  • Solution

Solution, it requires a couple of commands every time, but al least it is possible to move the files between shares on zfs.

 

The cache is formatted as zfs and every time a new root directory get created, it becomes a dataset. To move between shares it has to be a folder, which you can manually create by cd to the cache and mkdir.

 

What I did is;

  1. Move the whole "Downloads" folder to the array.
  2. cd /mnt/cache
  3. mkdir Downloads
  4. Move everything back onto the cache, because is have Downloads set to cache only.

Note; This still does not work, because when you try to move from downloads to another share which is not yet on the cache, it will automatically create a dataset. So also when moving file you have to, every time, create a folder first, because mover will pull this folder of the cache every time it runs. The Download folder, doesn't have to be recreated, because it stays on the cache.

  1. cd /mnt/cache
  2. mkdir Destination

Obviously because my Downloads share now is a folder, not a dataset, you cant create snapshots etc. But the whole point of me using zfs on the cache, is to utilize the snapshot capabilities of the appdata, domains and system folders not anything else.

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.

×
×
  • Create New...