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'm going to have another hard drive installed in my server, how can I make it so files are stored on the second hard drive as oppose to the first one, but have the files still accessible as usual on the first hard drive.

share|improve this question
    
OS? RAID? Volume management in use? –  Hubert Kario Jan 13 '11 at 21:26
    
Which files? Operating System files? Data files? Database store? Do you want to use RAID? Or links? What is the goal? –  Mei Jan 13 '11 at 21:31
    
This question is pretty much impossible to answer if we don't know your OS. –  Phil Hollenback Jan 13 '11 at 21:31
    
sorry, it's just storage no raid or anything. and I'm using centos. –  Belgin Fish Jan 13 '11 at 21:37
4  
Need more info.... Question fail. –  GruffTech Jan 13 '11 at 22:05

2 Answers 2

up vote 1 down vote accepted

Are you using LVM? Then you can move the logical volume to the other drive.

  • pvcreate on the 2nd drive
  • vgextend the volume group
  • pvmove the logical volume between drives
  • pvremove the 1st drive from volume group
share|improve this answer

You may be able to use a bind mount.

From man mount:

The bind mounts.
Since Linux 2.4.0 it is possible to remount part of the file hierarchy somewhere else. The call is

                 mount --bind olddir newdir  

or shortoption

                 mount -B olddir newdir  

or fstab entry is:

                 /olddir  /newdir  none  bind

After this call the same contents is accessible in two places. One can also remount a single file (on a single file).

This call attaches only (part of) a single filesystem, not possible submounts. The entire file hierarchy including submounts is attached a second place using

                 mount --rbind olddir newdir

or shortoption

                 mount -R olddir newdir

Note that the filesystem mount options will remain the same as those on the original mount point, and cannot be changed by passing the -o option along with --bind/--rbind.

share|improve this answer

Your Answer

 
discard

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

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