Know How RH
Create empty chroot for RedHat
You have a RH/Centos and want to create some chroot or another root filesystem, for example to create a mySQL chroot environment:
ROOT=/mnt/newroot
VERSION=/path/to/redhat-release-5Server-5.5.0.2.x86_64.rpm
mkdir "$ROOT/etc"
cp -r /etc/yum* "$ROOT/etc/"
rpm -ivh --nodeps --root "$ROOT" "$VERSION"
yum --installroot="$ROOT" makecache
Now you can install what you want:
yum --installroot="$ROOT" mysql-server
Then you can clone that using
mount -o bind /mnt/newroot/lib /mnt/mysql-chroot1/lib
and so on.
I have no complete scripts yet, sorry.