Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I have a folder(mostly with postfix user mailboxes-homedirs) mounted on a disk A(raid1) and I want to move it from disk A to disk B(also raid1).

Currently it is like:

/h1(folder) /md120(diskA)

and I want:

/h1(folder) /md121(diskB)

should I simply umount and then mount to another disk?


Hi again!

Thank you guys for all your answers.

It seems that I was wrong in my question.

The proper would be

How to properly change mount point of the folder?

So I have /h1 mounted to /md120 and I want to change it's mount point to /md121.

UPDATE 2 mount -l

fstab doesn't contain mounting.

/dev/md121 on /home2

/dev/md125 on /h1

My idea is to move h1 under home2 so full path would be /home2/h1, which would be mounted into /dev/121 and /dev/md125 would be 'removed'. The problem is that h1 contains user homedirs(mailboxes) so I think to simply ln after removing.

share|improve this question

closed as not constructive by mdpc, MadHatter, Khaled, Tom O'Connor, Stefan Lasiewski Feb 13 '13 at 17:53

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

Are you really just looking for the mv command? – kormoc Feb 12 '13 at 21:34
@kormoc, Hm, no, I guess. Because I need have the same folder but mounted on another device. – Jevgeni Smirnov Feb 13 '13 at 6:33
if both /h1/md120 and /h1/md121 are mounted, why wouldn't mv /h1/md120/* /h1/md121/ work for your needs? – kormoc Feb 13 '13 at 6:36
@kormoc, check the post update. – Jevgeni Smirnov Feb 13 '13 at 7:24
In the light of your update, could you edit the contents of /etc/fstab into the question? – MadHatter Feb 13 '13 at 7:31

You can use rsync -

   rsync -a --progress --remove-source-files /src/dir1/ /dst
share|improve this answer
-v for constant reassurance and a warm fuzzy feeling =) – Cory J Feb 12 '13 at 23:01
--progress will give you the same reassurance, a warm fuzzy feeling, and some more – kormoc Feb 12 '13 at 23:36

Are both raid partitions mounted? If they are you can use what you would normally do:

mv /h1 /h2

Make sure you stop postfix first.

share|improve this answer

use xar, this is better than all other as it preserves the original permissions, access times of files ... etc

share|improve this answer
Your link makes no sense... did you have the wrong URL in your clipboard by any chance? – Mark Henderson Feb 13 '13 at 2:06
  1. Quiesce the system. This will probably mean rebooting single-user, and if you're right about those file systems not being mentioned in /etc/fstab, that will also unmount them. I'm assuming this does happen.
  2. mount /dev/md121 /home2
  3. mkdir /home2/h1
  4. mount /dev/md125 /home2/h1

Everything that is currently under /h1 will now appear under /home2/h1, which I think is what you want.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.