Moving Whole OS Centos Server

I currently have a web server its on a small harddrive I didn't know my site would grow so fast but now I need a bigger hard drive. Instead of adding another harddrive (host charge monthly of how many hard drives connected to server) is there anyway to just move the whole os to a bigger hard drive and i could just tell my host to remove the old smaller hard drive.:wall:

Well you need to have physical access to the hard drive if you follow the steps I am going to advice you. Is it possible for you? If yes, then add the hard drive (of course you have to shutdown the running CentOS server) to another Linux box and issue the following command:

dd if=/dev/sdb of=/dev/sdc

Here /dev/sdb is the hard drive to be cloned and /dev/sdc id the new hard drive. The drive name may change depending on the availability of hard drives. Be sure to check if the OS is working well with the new hard disc.

NOTE: I have not tested anything like this with dd command. But as per the logic, it will copy the partition table too. So you will have lots of unused space on the new disk and this free space might be detected. I would not go for a hard disk cloning by any chance.

But if you really want to have a flaw less migration of whole OS while it's running, you would need to use a measure like P2V and V2P (physical to virtual and virtual to physical) migration solutions from the virtualization software vendors like VMware.

You can DD them, however, that will possibly rely on you resizing partitions. I suggest you do the 2nd hard drive and use LVM. That way, should this ever come up again, it is a much faster fix.

Alternately, you can P2V your box and make it into a VM where the host OS would allow you to be more flexible with the larger drive. CentOS on a new drive using KVM would allow that, and you can use the P2V converter from VMware or other ways of making a snapshot of your OS.