Harddisk Cloning

How can I clone my (running novell server on redhat linux, ext2 formatted) harddisk to a new one without a third one?

If you dont have the option of backing up the current drive to tape or CD-R, partition the new drive however you feel necessary. Make an archive of the old drive, yes the whole thing. Install linux on the new drive, then unpack the archive. This should leave you with the new drive containing all of the information from the old drive. And
its probably one of the fastest ways to clone it. If you are using IDE drives, make sure that they are on different controllers, otherwise you may end up waiting for an awful long time for the transfer between disks.
 

I have 2 hard disk.  I have cloned exactly the same hard disk using g4l.  Both hardd disk are bootable individually.
When I put them together, how do I mount the 2nd harddisk to the first?
It gave me probs saying that there is duplicate partition of LABEL=/boot.
1) /dev/hda (1st harddisk)
2) /dev/hdc (2nd harddisk)
fileformat is ext3.
 

I really don't get what your saying, but do you want to read/write files on "/dev/hdc" from your "/dev/hda" drive? or do you want them put togathor as one, so when you boot you don't have to mount the hard drive from a console?
 

yeah. I want to read/write from /dev/hda. how do I do it?
 

In a console type "mount /dev/hda /mnt/hda" before typing this command make a folder called "/hda" as root, in your /mnt/ directory.
 

Maybe i can go in more details.. maybe it will easier this way.

I have hda. all running fine. I want to make a clone of it on a 2nd drive hdc so that i can use rsync to sync the files and able to boot from the 2nd hard disk. (if the 1st hdd fail, at least I got 2nd one running)

The cloning is done by g4l and everything is fine. The harddisk can boot up individually.

The problems arise when I put both harddisk together as during booting up the will scan for the volumes automatically.  How do I prevent this? I read abt posts using noauto. but the partitions they using is not similar to mine.

I have provided my /etc/fstab

# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/VolGroup00/LogVol00 / ext3 defaults,usrquota 1 2
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
/dev/hdd /media/cdrom auto pamconsole,ro,exec,noauto,managed 0 0
 

What do you mean by "scan the volumes" and who is doing the scanning? If the harddrive is in the system and plugged in there is really no way you can get around having them both recognized and looked at by the kernel.

What is sounds like you really want to do here is run a software RAID to mirror your partitions. This will save you having to rsync things.
 

Veri skeptical about software raid...

During booting up.. it will try to scan for all the volumes you have in your harddrives...
 

Software RAID will work a lot better then any kind of rsync setup. It is really a pretty simple setup, they create a virtual device for the disk /dev/mdx usually. There is linking done so that when you write to the md device it actually writes to all disks in the device (for mirroring... it does other things for more complex raid modes). The code is actually pretty straight forward and easy to understand. I've run linux software raid for about 2 years now and I haven't had a problem yet. It also uses the usual kupdated routine to write to disk so if you do have a disk die you can rest assured that the 2nd disk is going to be an exact replica of the first.

What do you mean by "scan"? Does it actually check to see if the file system is clean and run fsck? Does it actually mount the disk?

If the disk is in the system and plugged in the kernel will recognize it (unless you disable the IDE controller in the bios). It will show the device, and the partition layout.

Something like this:

code:hde: attached ide-disk driver.
hde: host protected area => 1
hde: 234441648 sectors (120034 MB) w/8192KiB Cache, CHS=14593/255/63, UDMA(100)
Partition check:
 /dev/ide/host2/bus0/target0/lun0: p1 p2 p3 p4
 

If you have the file system in /etc/fstab linked to a mount point then it is going to get mounted at book. If the file system dirty bit is set then it is likely your init scripts will automatically run fsck on the file system.

You could put the noauto flag in your fstab, which would mean it wouldn't mount the disk automatically on boot. If you have intelligent init scripts it should also not bother checking the disk.

Have a Linux Issue?
Do you have a Linux Question?

Linux Home: Linux System Administration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.
The site www.gotothings.com is in no way affiliated with or endorsed by any company listed at this site.
Any unauthorised copying or mirroring is prohibited.