Midnight Commander renmov vs copy


Recommended Posts

Apologize if this is the wrong thread - I did a couple of searches could not find a discussion on this topic. 

I notice that when I do a renmov in mc from one user share to another - it moves instantaneously. If I do a copy it takes time. 
How exactly does mc move data from one user share to another so fast? What is happening behind the scenes? 

The renmov speed does not seem to be impacted even if the user shares are on different drives. 

For example

user share1:  disk1\share1

user share2:  disk2\share2

 

mc does the renmov almost instantaneously - how!? 

Link to comment
1 minute ago, daytona235 said:

How exactly does mc move data from one user share to another so fast? What is happening behind the scenes? 

When you drop down to the command line (ie: using mc or even Krusader), a move command winds up being a simple rename command.  The OS simply changes the directory the file is in without physically moving it.

3 minutes ago, daytona235 said:

The renmov speed does not seem to be impacted even if the user shares are on different drives. 

For example

user share1:  disk1\share1

user share2:  disk2\share2

 

Same thing as above.  Because you're obviously moving the file from /mnt/user/share1 to /mnt/user/share2, the OS is simply renaming the file without moving it.  The file is still on the original disk, regardless of the include/exclude settings for the share.  This is all because your source and destination are on the same mount point (/mnt/user)

 

Everything is working properly, the results are expected.  Its a by-product of you effectively bypassing the entire share system by doing things at the command level from a single mount point.  If you want to move the file from disk1 to disk2, then you need to specify the source as /mnt/disk1 and the destination as /mnt/disk2 (never mix disk shares and user shares in the same copy / move command -> you run the risk of corrupting the file)

Link to comment

Hi Squid thank you for the quick reply. 


Sorry for being dense. :)

What you are saying is when I do a ren/mov from one user share to another EVEN if the two user shares are on two different physical disks - ie: disk1 to disk2  - midnight commander just keeps the data on disk 1 and shows me the data on a share on disk2? 

BUT if I copy the data it actually moves across the two disks? 

 

Link to comment

You will probably have to turn on Disks Shares to be able to do what you want to do.  This is disable by default as you can easily lose files if you do Disk Share to User Shares operations (either way)!

 

As a point of information you will have to go first to     Settings   >>>  Global Share Settings and enable disks shares there.   Then go to  Shares   >>>  Disk Shares and enable Export for each disk you wish to share.  

 

From your description of what is happening (virtually instantaneous moves) , I suspect that you may have actually created a User Share  named "disk1".  Disk Shares and User Shares are two different animals!  If you give us the full Linux path to the 'disk1' share, we can tell you if this what you have done.  

 

EDIT:  by the mc can be a dangerous tool as it will do things that unRAID tires to prevent.  If you want to deal with files at the root level, you should be looking at the Krusader file manger Docker.  In its default configuration, it will prevent even a neophyte   from getting into too much trouble.  

Edited by Frank1940
Link to comment
21 minutes ago, daytona235 said:

Hi Squid thank you for the quick reply. 


Sorry for being dense. :)

What you are saying is when I do a ren/mov from one user share to another EVEN if the two user shares are on two different physical disks - ie: disk1 to disk2  - midnight commander just keeps the data on disk 1 and shows me the data on a share on disk2? 

BUT if I copy the data it actually moves across the two disks? 

 

Yes.   The point is that mc is working at the  linux level and at that level it is common for a move to be first tried as a rename, and only if that fails is a copy/delete done.    If you use the UnRAID GUI to browse the User Share i think that you will find that the User Share now has files on both disk1 and disk2.

Link to comment
20 minutes ago, daytona235 said:

I do not seem to see anything from \mnt I just installed it - have to play with it - total noob with this app. 

That's not a unique feature to Krusader, that's a docker basic principles thing. Dockers are miniature virtual computers with their own file systems, and only interact with the host through specified mapped folders or ports. If you edit the Krusader docker, you will see references to host and container. The resource listed on the host side is what is mapped to the resource on the container side. When running Krusader, browse to the container path, and you will see the assets mapped to the host side of that config field.

Link to comment
4 minutes ago, daytona235 said:

Is this any different than running Windows Filemanager on a VM? 

 

Yes, because you have root permission and can do things that you can't do from Windows Explorer.  (Like read, write, copy, move, delete files and Directories on shares that you do not have permission to do so from your Windows account.)  

 

It is also a Double Pane File manager and it is very easy to move/copy files from pane-to-pane.  (We haven't had that in Windows since back in WIn 3.1 or WIn 95 days...)  That  feature alone could easily make your cleanup of your present situation a much simpler task!  

 

13 minutes ago, daytona235 said:

Also is there a good Primer for Krusader that you recommend. I do not seem to see anything from \mnt I just installed it - have to play with it - total noob with this app.

 

There probably is, but I don't know of it.  A Google search might provide one.  However, there is also a support thread for the unRAID Docker:

 

     https://lime-technology.com/forums/topic/71764-support-binhex-krusader/

 

 

The /mnt is one of the safety features that I mentioned.   It is possible to be able to browse both Disk and User Shares but you have to make a configuration change.  As an example, to see the /mnt point, see this post:

 

     https://lime-technology.com/forums/topic/71764-support-binhex-krusader/?tab=comments#comment-659847

 

 

BE VERY careful if you make this change!  Do NOT copy or move between Disk Shares and User Shares.  (You could be reading from and writing to the same file at the same time!  You can easily see how this is a recipe for disaster!)  You can do Disk-to-Disk and share-to-Share without problems.  

 

When you look at that change, you should be able to figure out how to browse anywhere in the entire Linux file system.  You must really know your way around Linux and the problems you can cause...

Link to comment

I personally think Krusader is just a side track for you. You can do everything you need to from mc. You just need to be aware of where the disks are in the structure. To answer (your intended) question from earlier:

 

20 hours ago, daytona235 said:

I can use mc and move the data from mnt\Disk1\Share1 to mnt\Disk1\Share1  mnt\Disk2\Share1 is that bad? 

 

That would be fine.

Link to comment

Got it on the docker mappings. 
 

I got the server all cleaned up. 

Will no longer use renmov on MC. 

Shall readup on krusader just for fun - think I am ok with mc but hey its always fun to learn something new. 

Thanks folks. 

 

SUMMARY: Do not use renmov with Midnight Commander when crossing from one disk to another. 

Link to comment
28 minutes ago, daytona235 said:

SUMMARY: Do not use renmov with Midnight Commander when crossing from one disk to another. 

 

No, your problem was due to trying to move between user shares. If you had actually moved using the disk paths it would have worked just fine. I do it all the time.

 

Link to comment
11 minutes ago, daytona235 said:

Why is it bad to move from one disk to another and not use the Usershares? 

 

You still don't get it.

 

It is fine to move/copy from one user share to another user share. If moving, that won't necessarily move it to a different disk.

 

It is fine to move/copy from one disk to another disk. That will always work as expected.

 

It is bad to move/copy from a user share to a disk, or from a disk to a user share. That can result in a 0 byte file because it doesn't know the user share path is pointing to the same location as the disk path.

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.