Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've got a linux box running Fedora 19 that I want to move to CentOS 6.4. Rather than trying to do something fancy with the current disk (which has also accumulated a lot of sludge over the years), I'm going to get a new disk, put CentOS on that, and then move the to-be-preserved bits of stuff from the old disk to the new one.

I haven't done this yet, but I presume it should be semi-straightforward -- do the CentOS install on the new disk, mount the old disk on /olddisk or somesuch, and start copying. However, I'm not sure how to handle getting the machine to recognize the new empty disk as the target of the CentOS install (I suppose I can just pull the old disk during the installation), remember that this is the intended boot disk once the install has happened), and tweak /etc/fstab (right?) to set up the old disk on the desired mount point. (Both disks are, or will be, SATA.) I could probably hack it together without losing too much hair or doing too much damage, but could anyone offer some advice that would get/keep me on the right track? Thanks!

share|improve this question

migrated from serverfault.com Oct 30 '13 at 13:08

This question came from our site for professional system and network administrators.

1 Answer 1

up vote 3 down vote accepted

I have always done it by pulling the disk I want to keep during the install. That way there is no chance of me picking the wrong disk while setting up partitions.

Move the disks around so the new OS drive is in the first port and by default the boot drive. Leave the other disk out during install. Then put it back in as the second disk when you are done.

This is the most foolproof way. Of course if you don't have physical access to the server it can be much more difficult than just choosing the right disks during install.

share|improve this answer
    
Thanks much! -- that's how I was headed, but the confirmation was appreciated. Both disks are now up and running; the only major issue was that the two disks had identical LVM volume group names, but a bit of googling cleared that up. –  Jim Miller Oct 29 '13 at 1:36
1  
One point which was not touched upon in Grant's answer: ALWAYS take a full backup prior to a major upgrade (even if you're pulling the old disk for safe keeping). If you don't have backup software you can boot from CD and use dd to take disk images, and install proper backup software for the new system. Among the other advantages of having a verified good backup, if you need to retrieve a file from the old system you can do so without needing to find the old hard drive. –  voretaq7 Oct 29 '13 at 15:21

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.