Results 1 to 6 of 6
I've run in to a surprising problem. I am sure I am missing something simple.
I am just trying to move a directory with the mv command, but I get ...
- 02-22-2011 #1Linux Newbie
- Join Date
- Aug 2005
- Location
- Sterling, VA
- Posts
- 100
Move Directories
I've run in to a surprising problem. I am sure I am missing something simple.
I am just trying to move a directory with the mv command, but I get a "directory not empty" error.
There are hundreds of subdirectories, and thousands of files. Certainly I am not expected to move each one, one at a time.
It is 300 GB and I don't have the space to copy them all, and then delete. What is the solution for this? It doesn't seem like it should be such a problem.
Thanks,
Dave- EndianX -
- 02-22-2011 #2Just Joined!
- Join Date
- Feb 2011
- Posts
- 1
Using "mv" to relocate a large directory is a good way to end up needing to restore something from backup. I'd try to find spare disk space from anywhere to rsync this to, remove the dir and then rsync back. You are in effect doing a backup anyway, so if you have something like Netbackup, a backup and restore is also recommended. So long as whatever services are sharing those files have been shut down.
- 02-22-2011 #3Just Joined!
- Join Date
- Apr 2010
- Location
- Bangalore, India.
- Posts
- 12
mostly mv command should work, and also u can use force move command "mv -f". or else might be problem with file system errors try to reboot ur system with "shutdown -Fr" for force fsck ..
- 02-22-2011 #4Linux Newbie
- Join Date
- Aug 2005
- Location
- Sterling, VA
- Posts
- 100
antony_pradeep, you are right. I just did the following as a test.
mkdir test
touch test/file1
touch test/file2
mv test test2
That worked fine. I will try a fsck and let you know how that goes. Thanks.Last edited by EndianX; 02-22-2011 at 01:20 PM.
- EndianX -
- 02-22-2011 #5Just Joined!
- Join Date
- Feb 2011
- Posts
- 8
- 03-02-2011 #6Just Joined!
- Join Date
- Jan 2009
- Location
- Kolkata, India
- Posts
- 8


Reply With Quote

