There is obviously more than one way to clone a linux install, but here’s the way I used most recently, when upgrading a 500G RAID1 volume on a 3ware HBA to 2T.
Fortunately, we had two free slots available, so we just inserted the new 2T drives into the free slots.
maint createunit c4 rraid1 p4:5
sdb1 / 25G
sdb2 swap 12G
sdb3 /home the rest
mke2fs -j /dev/sdb1
mke2fs -j /dev/sdb3
mkswap /dev/sdb2
mkdir -p /mnt/new/root /mnt/new/root/home
mount /dev/sdb1 /mnt/new/root
mount /dev/sdb3 /mnt/new/root/home
cd /
rsync -vrpoglHDt --exclude=/proc --exclude=/sys \
--exclude=/net --exclude=/tmp --exclude=/mnt/new \
--delete . /mnt/new/root
Here’s a key for the flags used above:
-v, --verbose increase verbosity
-r, --recursive recurse into directories
-p, --perms preserve permissions
-o, --owner preserve owner (super-user only)
-g, --group preserve group
-l, --links copy symlinks as symlinks
-H, --hard-links preserve hard links
-D same as --devices --specials
--devices preserve device files (super-user only)
--specials preserve special files
-t, --times preserve modification times
chmod 1777 /mnt/new/root/tmp
grub-install --recheck --root-directory=/mnt/new/root /dev/sdb
We also moved the two new 2T drives into slots 0 and 1, inserted a
couple of spare 2T drives and used the tw_cli utility to assign those
new drives as hot spares.