Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-01-2014, 04:38 PM   #1
LQ Newbie
Registered: Mar 2014
Posts: 27

Rep: Reputation: Disabled
MV command not removing source on move to network share

Hi, I'm guessing this is a really simple question, but I can't find anything in the man pages or google, so:

I used the mv command to move a large directory (14 Gb with subdirectories) to a network share. The files copied, but did not remove the source files. Is this because it's a network move, or a move to a different filesystem?
Does anyone know of a way to ensure that the source files get removed?


Old 07-01-2014, 04:42 PM   #2
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,557

Rep: Reputation: 2116Reputation: 2116Reputation: 2116Reputation: 2116Reputation: 2116Reputation: 2116Reputation: 2116Reputation: 2116Reputation: 2116Reputation: 2116Reputation: 2116
My guess is your user has read permission on the source files/dirs but not write permission. So while it was able to copy the files, it was not able to remove the originals since you don't have the permission to do so. Were there any errors printed on the terminal?

In my experience, when moving a large directory like that, it's a much better idea to use "rsync -a" to copy it to the destination, and once you've verified it's there and everything works correctly, you can remove the source manually. This way if there's a network interruption, system interruption, power outage, etc. you can always pick up the copy where it left off without risking some files not making the transfer. If the transfer gets interrupted part way through you just run it again, whereas with an mv there are always questions. Which files/dirs have been fully transferred? Which have been partially transferred? Which ones do you want to move again to overwrite what's there? Are there any dirs on the destination that have already been moved over and deleted off the source? Or are they still on the source? etc. You also separate the copy from the deletion, so in case there are write permission issues like I mentioned could be the case here, you don't run into it until you go to delete, after you're already sure everything has been copied over properly.

Last edited by suicidaleggroll; 07-01-2014 at 04:46 PM.
1 members found this post helpful.
Old 07-01-2014, 05:00 PM   #3
LQ Newbie
Registered: Mar 2014
Posts: 27

Original Poster
Rep: Reputation: Disabled
Thanks, I had just been thinking "maybe there's a better way"... I'll look into rsync and tar for my moves.




Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
need a script that will copy based on filename and then move to a network share when mrgreaper Linux - Newbie 6 09-27-2009 09:21 PM
cannot using FTP move command to move files adrianmak Linux - Networking 4 04-21-2009 01:01 PM
mount windows share export to samba share -> improve network performance tuning newuser77 Linux - Server 1 07-23-2008 12:28 PM
fsck move file when removing inodes? allasso Linux - General 2 09-26-2006 06:22 PM
How do I move /home to share between distros? glenn69 Linux - Newbie 5 06-07-2005 11:31 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:22 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration