In CentOS 5 (and 4 for that matter) when you install to a PATA hard drive your installing to /dev/hda as your first disk. If your using disk imaging software and make an image of your first partition (/dev/hda1) then restore that image on a SATA disk your boot will fail horribly. The failure (switchroot: mount failed) will be when it tries to switch from the initrd image to the real file system. The problem here is PATA block devices are built into the kernel but the SCSI and SATA block device modules are not. They are supposed to be loaded by modules from the initrd image. If you did not do the original install with a SATA disk then the needed subsystems are not put in the initrd image that your booting.
So you want to fix this right? To do that we need take the kernel modules for the SATA and SCSI subsystems and put them in a new initrd image. We can use the old PATA disk to make the new initrd image for the new SATA initrd image. To do this boot the PATA disk with the working /dev/hda. After logging in we can make the new initrd image. Let's do this now.
mkinitrd -v -f --with=scsi_mod --with=sd_mod --with=libata --with=ata_piix /boot/initrd-2.6.18-8.1.15.el5.centos.plusPAE-ata.img 2.6.18-8.1.15.el5.centos.plusPAE
The above command will make an initrd image with the SCSI and ATA modules built in. The --with= arguments show the different modules that will be put into the initrd image. The argument with /boot/ is the name of the initrd image you are going to make. The last argument is running kernel version. The example is done with the 2.6.18-8.1.15.el5.centos.plusPAE kernel. Just substitute your own running kernel version for the kernel versions above. You can get your running kernel name by issuing the command "uname -r".
If you have some other modules you need to load into the initrd image you can put those in also with the --with= lines. For example if you have Nvidia disk controllers then none of the ata modules will work for you above. You would need to put --with=sata_nv at the end of the other --with= lines so your initrd image will include this module when it boots. If not the block device for your hard drive will not be made and you will get the same switchroot error. Check your motherboard manufactures book to see what disk controllers you have on your mobo. You could also just boot a distro like knoppix to see what module it uses.
One last example of adding another module for a block device is if you have a raid card and you want to have it's device made before your real root filesystem is brought up. For example with Areca raid cards you can download the linux driver from their website, compile, and install it. After doing this use the same mkinitrd line above but include another --with= line for the module you just installed. The module name for the Areca cards is arcmsr. So you would put in the line --with=arcmsr.
After you have made your initrd image you now need to modify your grub.conf to point to it. Edit the /boot/grub/grub.conf file. You will see your current boot settings in there. Make a copy of the title, root, kernel, and initrd lines from the current entry and paste them below it. Then edit the initrd line and give it the name of your new initrd file your made. Save the file.
The last file you need to edit is the /etc/fstab. Change any hda's to sda if there are any in there. Then save it.
Reboot your machine. Hit escape when grub starts to load during boot. Then select your entry from the menu to test boot it. It should see your sata hard drive on boot and assign it a block device name like /dev/sda. If you want to make it default to that entry you just tested change number next to the line that starts with the word "default" in the grub.conf file. This number sets the default boot entry. The top entry is 0. You count entries up from there.