POORMANS RAID & CLONE SCRIPT
1. Get yourself two hardives setup your first drive (HDA) with the your perfek system.
2. Power up your second drive (HDC)
3. Slice HDC up by using cfdisk (command is cfdisk /dev/hdc)
Hda1 - primary boot begining Label [ / ]
Hda5 - logical beginning [ /usr ]
Hda6 - logical beginning [ /var ]
Hda7 - logical beginning [ swap ]
Hda8 - logical beginning [ /tmp ]
Hda9 - logical beginning [ /home ]
To Setup your filesystem and your labels
Mkfs -t ext3 -L / dev/hdc1
Mkfs -t ext3 -L /usr dev/hdc5
Mkfs -t ext3 -L /var dev/hdc6
Mkfs -t ext3 -L /tmp dev/hdc8
Mkfs -t ext3 -L /home dev/hdc9
okay so you have sliced HDC and setup your filesystems with Labels.
Vi and copy the below script save a file called clone, make it chmod 777 and run it.
once copied run Grub
#grub --no-floppy
#grub>
# device (hd0) /dev/hdc
# root (hd0,0)
# setup (hd0)
# quit
Clone Script"make sure nothing is mounted in /mnt!"
echo "going to unmount /mnt"
/bin/umount /mnt
mount /dev/hdc1 /mnt
cd /
cp -ax / /mnt
mount /dev/hdc5 /mnt/usr
cd /usr
tar lcpBf - /usr | (cd /mnt; tar xBf -)
mount /dev/hdc9 /mnt/home
cd /home
tar lcpBf - /home | (cd /mnt; tar xBf -)
mount /dev/hdc8 /mnt/tmp
cd /tmp
tar lcpBf - /tmp | (cd /mnt; tar xBf -)
#Stop crtical services
/etc/init.d/mysql stop
mount /dev/hdc6 /mnt/var
cd /var
tar lcpBf - /var | (cd /mnt; tar xBf -)
#start all the services again
/etc/init.d/mysql start
echo "all copied"
exit 0
Recent comments
4 hours 47 min ago
5 hours 23 min ago
7 hours 1 min ago
8 hours 23 min ago
11 hours 38 min ago
12 hours 25 min ago
14 hours 22 min ago
14 hours 27 min ago
15 hours 51 min ago
16 hours 39 min ago