> Hi All
> I have install redhat 6.2 with the kernel 2.2.17-4. Now I need to transfer
> the entire os to another disk arry with the same system. The reason being
> for that is I had problem with mylex 352 raid card. I have installed &
> compiled 2.2.17-4 in order to get the drivers by connecting an external HD.
> Now I need to transfer the OS inorder to boot from DISK ARRY.
> How yo transfer, Can I use dd command dd if=/dev/sda1 of=/dev/rd/c0d0p1 ?,
> Or with any other option?. The root partition of both drives are different
> size. Or can I use dd if=/dev/sda1 of=/dev/rd/c0d0p1 conv=notrunc.
> Please advice
> Thanks in Advance
> Thave
I use this script to copy my 'production partitions' (/, /usr and /var)
to an empty partition (/root/linux2, hda7). Rebooting with the new root
let me test new packages and scripts, without the chance of damaging my
'production system'.
The blanks after after hda1 and $RO in...
sed s/"hda1 "/"$RO "/g > ./etc/fstab
... are tabs, not spaces!
gegroet,
Erik V.
--------------------- begin of script ------------------------
WD=~/linux2
KE=vmlinuz
RO=hda7
pushd ~
[ "$WD" = "" ] && echo "Oops!" && exit 16
[ ! -d "$WD" ] && evdo "mkdir -p $WD"
[ ! -d "$WD" ] && echo "Oops!" && exit 16
evdo "grep $WD < /etc/fstab > /dev/null" &&
evdo "grep $WD < /etc/mtab > /dev/null" ||
evdo "mount $WD"
popd
[ "$WD" = "/root/linux2" ] &&
evdo "rm -rf $WD/*"
pushd $WD
evdo "cp -aPx / ." &&
evdo "cp -aPx /usr ." &&
evdo "cp -aPx /var ." &&
evdo "rdev ./boot/$KE ./dev/$RO" &&
evdo "lilo" &&
evdo "rm ./etc/lilo.conf" &&
echo "sed ..." &&
cat /etc/fstab | \
grep -v /var | \
grep -v /usr | \
grep -v /root/linux2 | \
sed s/"hda1 "/"$RO "/g > ./etc/fstab
popd
--------------------- end of script ------------------------