Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the easier way to move a directory to newly mounted drive

Example, if I have a directory called /example and mounted a new drive to /vol, how I can easily move /example to /vol

Since database data is stored in /example, if I copy the folder it might just get corrupted.


share|improve this question
Why would the data get corrupted exactly?? – Chris S Oct 26 '10 at 16:31
Is this homework? – Chopper3 Oct 26 '10 at 16:36

mv /example /vol

(Works in Linux, BSDs, most Unix flavors, and Windows PowerShell)

share|improve this answer

Moving the data directory should be ok as long as the database is shut down before the move occurs.

Move all files in /example into /vol.

mv /example/* /vol

Move /example directory inside /vol.

mv /example/* /vol
share|improve this answer
You've got the same command up there twice... – Chris S Oct 26 '10 at 16:39
His 2nd eg shouldn't have the /*. – Mark Wagner Oct 26 '10 at 17:23
  1. Shut down database (or any other service depending on /example)
  2. mv /example/* /vol/
  3. rm -rf /example
  4. Either reconfigure your database/applications to use /vol, or create a symlink with ln -s /vol /example
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.