Is this the correct way of moving MySQL data directory, (on Centos)? I need to move my data directory to a bigger drive on the same server.

# stop mysql
/etc/init.d/mysql stop

# copy the data over
cp -R -p /var/lib/mysql /home/mysql

#edit my.cnf
# and add a 'datadir' section with the new path.

#restart mysql
/etc/init.d/mysql restart


The copying of the data will take ages, (I suspect), but at least it will be safe.

I might also want to add a temp directory somewhere.

Do I need to do anything else to move the data.

Will I need to rebuild indexes or something else?
Ideally you would keep that folder, and instead of changing it you'd either mount another folder or partition on it prior to starting mysql, or create a symlink elsewhere (there are answers for doing this here and here).

You won't need to rebuild anything for moving your files, but it is a good idea to always make a backup before attempting something like this that may damage your data if anything goes wrong.