How to move a filesystem from one disk to another

JohnHyldahl
JohnHyldahl used Ask the Experts™
on
I have an instalation on a 4 GB SCSI disk
Now I have add a 8 GB SCSI disk, and whant to move
/usr and /var from the first disk to the sec. disk

Is there a How to that descrips how to do that
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:

Haven't seen howto about this. But it goes like this:

1. Create partitions to new disk and construct file systems. (fdisk (...) and mkfs -t ext2 (...))

2. Mount newly created partitions to temporary locations (for example /mnt/new_usr and /mnt/new_var) - It also might be good idea to label the new partitions accordingly, maybe as 'new_var' and 'new_usr'.

3. Copy all files from /usr to /mnt/new_usr and from /var to /mnt/new_var.

4. modify you /etc/fstab to automagically mount new /usr and /var in place. If your distro by default mounts the disks by labels, like RH does, replace LABEL=/usr by LABEL=new_usr and LABEL=/var by LABEL=new_var.

5. reboot and check that everything works. (Reboot is not necessary if you are sure that you got everything right ;)

6. umount /usr and /var. If umount complains about /usr being busy, check what processes are using it using ("fuser -uv /usr)", kill those ("fuser -k /usr") and try again.

7. rm -rf * at /usr and /var

8. mount the /usr and /var

Done.

JohnHyldahl:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.

Commented:
This question has been classified abandoned. I will make a recommendation to the moderators on its resolution in a week or two. I appreciate any comments that would help me to make a recommendation.


Unless it is clear to me that the question has been answered I will recommend delete. It is possible that a Grade less than A will be given if no expert makes a case for an A grade. It is assumed that any participant not responding to this request is no longer interested in its final disposition.


If the user does not know how to close the question, the options are here:
http://www.experts-exchange.com/help/closing.jsp

drewber

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial