Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving Filesystems 2

Status
Not open for further replies.

warmongr

MIS
Mar 17, 1999
214
US
ok here is the deal. I recently got hold of a large harddrive and want to add it to my existing system. I currently have:<br>
<br>
/<br>
/home<br>
/spool/someotherdirectory on /hda1<br>
<br>
I am adding the second drive as secondary master so that will be /hdb<br>
<br>
I want to move /home (very large) to /hdb.<br>
<br>
Now the question:<br>
<br>
What is the most efficient means of doing this with minimal down time?<br>
<br>

 
You'll be using tar to do the move, so all the file permissions stay the same. Then you'll want to unmount the /home and remount it in the new place, then link the new place to the old. eg:<br>
<br>
[machname:/]#tar cvf /hdb/tarfile.tar /home<br>
[machname:/]#mkdir /hdb/home<br>
[machname:/]#tar xvf /hdb/tarfile.tar /hdb/home<br>
[machname:/]#umount /home<br>
[machname:/]#mount /dev/hdb1 /hdb/home/ -t ext2<br>
[machname:/]#ln -s /home /hdb/home<br>
<br>
..Or something like that anyways.
 
Assuming the current /home is on it's own filesystem (say, /dev/hda2), as an alternative, try this:<br>
<br>
mkdir /newhome<br>
mount /dev/hdb1 /newhome -t ext2<br>
tar cvf - /home/* ¦ tar xvf - /newhome<br>
<br>
# Check the contents of /newhome to make sure they look OK.<br>
<br>
umount /home<br>
umount /newhome<br>
mount /dev/hdb1 /home -t ext2<br>
<br>
Remember to update /etc/fstab to reflect the new device for /home.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top