Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

UPDATE 1

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
3  
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
show 6 more comments

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.

4 Answers

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
add comment

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
add comment

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

share|improve this answer
1  
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
add comment
  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
add comment

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