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
12 hours 4 min ago
13 hours 56 min ago
19 hours 12 min ago
19 hours 20 min ago
20 hours 50 min ago
21 hours 7 min ago
22 hours 25 min ago
1 day 21 min ago
1 day 1 hour ago
1 day 4 hours ago