Moving files between disks resulted in [conflicted] files


unburt

Recommended Posts

Hello,

 

I attempted to move some files from one disk to another using the `mv` command and `/mnt/diskX` style paths.


My working directory was `/mnt/disk5/files` and my command was:

`mv * ../../disk1/files/`


`mv` did not move everything and when I checked the source directory I found some files with names like `DSC_7862 [conflicted].NEF`. I was wondering if anyone knew where the `[conflicted]` part of the name came from? I did find that the destination directory already contained a file of the same name so it seems reasonable. I don't think I lost any data. I'm just curious how this works under the covers.

 

Thanks!

 

edit: I did have some output when I returned after mv had completed. Perhaps it might shed some light, but it seems that it was just reporting that it could not clean up the folders in the source location because some files had remained. This command was run from a tmux session so that I could leave it running for hours.

 

root@Tower:/mnt/disk5/files# mv * ../../disk1/files/
mv: inter-device move failed: "My Permanent Files" to "../../disk1/files/My Permanent Files"; unable to remove target: Directory not empty
mv: inter-device move failed: 'Photos' to '../../disk1/files/Photos'; unable to remove target: Directory not empty
mv: inter-device move failed: 'e' to '../../disk1/files/e'; unable to remove target: Directory not empty
mv: inter-device move failed: 'i' to '../../disk1/files/i'; unable to remove target: Directory not empty
Edited by unburt
Link to comment
  • unburt changed the title to Moving files between disks resulted in [conflicted] files

I'm not sure about the renaming of files to "[conflicted]", however, never use the "mv" command unless you are really sure what you are doing.  It just causes problems.  In the future use the program "mc" from the command line to move files between disks and it does not give these problems.  You should check it out.

 

Just type "mc" from the command line and it will bring up a very intuitive interface to copy, move, or delete files.  Hit tab to go from side to side.  You can also right click on files or directories individually to select them instead of moving, copying, or deleting all of them.

 

If you do have problems of duplicate files on disks in the future, use the following script to check for duplicate files on your disks, however, I don't think that is your problem at this time since they do not have the exact same names.

UNRAIDFINDDUPLICATES.SH

 

At this point I would do the move again with "mc" and then after that is completed, I would get rid of the "[conflicted]" files or save them off to another directory until you feel comfortable that all your files have been moved.

Edited by JoeUnraidUser
Link to comment

Oh, I had no idea they would do things differently, I am familiar with "mc", so I can use that from now on. Is there somewhere I can read about how moving with "mc" differs from moving with "mv"?

 

And should there be additional caveats on this wiki article? It suggests Midnight Commander as the first option but then says you can do the same thing with the usual "mv" without much mention of any danger aside from having your session end mid-move (and suggests nohup to mitigate this; in my case, I used tmux). https://wiki.unraid.net/Transferring_Files_Within_the_unRAID_Server

Edited by unburt
  • Upvote 1
Link to comment
4 minutes ago, unburt said:

Oh, I had no idea they would do things differently, I am familiar with "mc", so I can use that from now on. Is there somewhere I can read about how moving with "mc" differs from moving with "mv"?

 

And should there be additional caveats on this wiki article? It suggests Midnight Commander as the first option but then says you can do the same thing with the usual "mv" without much mention of any danger aside from having your session end mid-move (and suggests nohup to mitigate this, I used tmux). https://wiki.unraid.net/Transferring_Files_Within_the_unRAID_Server

There had to be something else going on as the ‘mv’ command would not create files with the ‘conflicted’ added to the file names.   
 

there should be no difference between using ‘mc’ or ‘mc’ commands as long as you make no mistake in the command line for ‘mv’.  
 

if you are using any recent version of Unraid then the recommended tool to use is now the Dynamix File Manager (installed as a plugin) as this is Unraid aware and can protect the user from some common mistakes that can cause data loss.

Link to comment
3 minutes ago, itimpi said:

There had to be something else going on as the ‘mv’ command would not create files with the ‘conflicted’ added to the file names.   
 

there should be no difference between using ‘mc’ or ‘mc’ commands as long as you make no mistake in the command line for ‘mv’.  
 

if you are using any recent version of Unraid then the recommended tool to use is now the Dynamix File Manager (installed as a plugin) as this is Unraid aware and can protect the user from some common mistakes that can cause data loss.

I have actually had the problem of Dynamix File Manager producing duplicate files on disks in the past.  So, I stopped trusting it a while ago.  Does it work correctly now?

Link to comment

On further reflection, it is possible the [conflicted] files were created sometime in the past and were not created by my current `mv` command.

 

But, when I returned I saw the DSC_7862 [conflicted].NEF file in the source and the DSC_7862.NEF file in the destination and I did not see a [conflicted] version of the file in the destination, I tried the `mv * ../../disk1/files/` command a second time and it returned immediately and gave me the same output about being unable to remove directories due to them not being empty. So it seems like the mv command had no files to move and was aware of the [conflicted] files?

 

I have since used Midnight Commander to complete the move and it had no issues about putting the DSC_7862 [conflicted].NEF file next to the DSC_7862.NEF file in the destination. So, perhaps there is a subtle difference?

Edited by unburt
  • Upvote 1
Link to comment
Just now, JoeUnraidUser said:

I have actually had the problem of Dynamix File Manager producing duplicate files on disks in the past.  So, I stopped trusting it a while ago.  Does it work correctly now?

I have not heard of it creating duplicate files unless you told it to do so (I.e used copy rather than move)when working normally.  
 

I guess another possibility might be a system crash while attempting a move as it uses a copy/delete strategy so if the system crashed before the delete part you could end up with the source left behind.

Link to comment
11 hours ago, itimpi said:

I have not heard of it creating duplicate files unless you told it to do so (I.e used copy rather than move)when working normally.  
 

I guess another possibility might be a system crash while attempting a move as it uses a copy/delete strategy so if the system crashed before the delete part you could end up with the source left behind.

I'm not sure why the move didn't work.  I used the plugin back when it first came out.  I know I did a move and the system didn't crash.  I sat there and waited for the move to happen.  Maybe something happened to the process.  I think the process died in the background during the move.  Some files were moved to the new drive, some files were duplicates, and some files were not moved.

 

I just tried the plugin again and I verified the plugin did move the files correctly.  So, whatever problem I had back then did not occur again.

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.