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
9 hours 26 min ago
9 hours 31 min ago
10 hours 55 min ago
11 hours 42 min ago
12 hours 2 min ago
17 hours 33 min ago
22 hours 52 min ago
1 day 3 hours ago
1 day 9 hours ago
1 day 9 hours ago