Advise, I am a newbie with little experience in LINUX.
I has assembled this script from others i has found on Internet. The purpose
is to copy from hda to hdb all the data and prepare hdb to replace hda.
I would like to know if i am doing think right and what could i add to
improve it. Should check the surface of new disk? How is it done?
#------- start script ---------------------------------------
#I copy from 40gb hda to 40gb hdb
#my partitions are hda1=boot hda2=root hda3=swap
#------------------------------------------------------------
# First step
# Partitioning the new hard disk. The size of each partiton could be change
#if there is room for the data. I have copied a 40gb. HDD to a 20gb HDD
since
# the 40gb had only 12gb used.
/sbin/sfdisk -uM /dev/hdb <<EOF
0,100,83,*
,36000,83
,1024,82,
EOF
mkfs.ext3 -L /boot /dev/hdb1
mkfs.ext3 -L / /dev/hdb2
mkswap -c /dev/hdb3
#-----------------------------------------------------------
# Second step
# Create a directory /newdisk to mount the hdb partitions
cd /
mkdir /newdisk
mount /dev/hdb2 /newdisk
# Copy root partition
cp -axv / /newdisk
cd /newdisk
mkdir /proc
umount /newdisk
# Mount and copy Boot partition
cd /
mount /dev/hdb1 /newdisk
cd /
cd /boot
cp -axv . /newdisk
cd /
umount /newdisk
#----end of script -----------------------------------------------------
in order to boot from this drive i need to RESTORE GRUB...
Now i remove hda and place the copy as hda. Boot from redhat cdrom as
"linux rescue". chroot /mnt/sysimage.
cd to /boot/grub and run grub-install /dev/hda
reboot from new disk.
I will appreciate comments.
_________________________________________________________________
-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
_____________________________________________________________________
Ltsp-discuss mailing list. To un-subscribe, or change prefs, goto:
https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help, try #ltsp channel on irc.freenode.net
- Re: [Ltsp-discuss] Script to Clone hda. Am i rig... gabriel lopez
- Re: [Ltsp-discuss] Script to Clone hda. Am ... Rob Apodaca
- Re: [Ltsp-discuss] Script to Clone hda. Am ... Mark Bucciarelli
- Re: [Ltsp-discuss] Script to Clone hda.... Mike Eggleston
- Re: [Ltsp-discuss] Script to Clone hda. Am ... Anselm Martin Hoffmeister
- Re: [Ltsp-discuss] Script to Clone hda.... Tarjei Huse
- Re: [Ltsp-discuss] Script to Clone hda. Am ... gabriel lopez
