nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Help on cloning the entire disk.

This is a discussion on Help on cloning the entire disk. within the Linux software forums, part of the Linux Getting Started category; I have an old 20GB disk running as a bugzilla server. I need to clone that to a newer harddisk ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Linux software

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 09-25-2006, 12:36 PM
Member
User
 
Join Date: Jun 2005
Posts: 45
Rep Power: 0
warren
Default Help on cloning the entire disk.

I have an old 20GB disk running as a bugzilla server. I need to clone that to a newer harddisk or maybe to a RAID disk. I tried it using dd but i'm not sure exactly what i'm doing. i have also read about g4l. I dont want to have a trial an error, this server is running 24/7 and I don't want to mess things up I have a lot of experience trial and error using PQ image center and it damage the partition table.
Maybe you guys have a proven experience, please help me on this...
need a safe step by step instruction

[root@ProTrackResource ~]# fdisk -l

Disk /dev/hdc: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdc1 * 1 65 522081 83 Linux
/dev/hdc2 66 2359 18426555 83 Linux
/dev/hdc3 2360 2434 602437+ 82 Linux swap / Solaris

thanks,
warren
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-26-2006, 05:09 AM
sweta's Avatar
Contributors
User
 
Join Date: Feb 2005
Location: New Delhi
My distro: Suse, RHEL, Vista
Posts: 154
Rep Power: 4
sweta will become famous soon enough
Default

You can only clone everything if new hard disk has the same size or greater than original size, at least this is what dd does.

For example:
Code:
dd if=/dev/hdc1 of=/dev/hda1
/dev/sda1 is new hard disk and /dev/hdc1 is old parition.

I recommend using Partimage command/program. Partition Image will only copy data from the used portions of the partition. For speed and efficiency, free blocks are not written to the image file. This is unlike the 'dd' command, which also copies empty blocks. Partition Image also works for large, very full partitions. For example, a full 1 GB partition can be compressed with gzip down to 400M
See Parimage for more info http://www.partimage.org/Main_Page

If I were you, I will only copy the data using tar or cp or partimage command.
__________________
Friends - v-nessa - missyAdmin - LinuxChix
Reply With Quote
  #3 (permalink)  
Old 09-27-2006, 01:27 PM
Member
User
 
Join Date: Jun 2005
Posts: 45
Rep Power: 0
warren
Default

ok thanks, I have look into PartImage, looks nice somewhat similar to ghost.
I was also thinking of just copying the data. install a new linux, bugzilla, etc..then copy the database and configurations, this would be safest way but I think may take so much time.
so far I have already created an image using dd, I have done it using by partition and compressing the image file.

Code:
dd if=/dev/hdc1 | gzip > /mnt/temp/hdc1.img.gz
dd if=/dev/hdc2 | gzip > /mnt/temp/hdc2.img.gz
and also the mbr:
Code:
dd if=/dev/hdc of=/mnt/temp/hdc.boot.mbr bs=512 count=1
Create an exact partition on the new harddisk and then restore:
Code:
dd if=/mnt/temp/hdc.boot.mbr of=/dev/hda bs=512 count=1
gzip -dc /mnt/temp/hdc1.img.gz | dd of=/dev/hda1
gzip -dc /mnt/temp/hdc2.img.gz | dd of=/dev/hda2
i'll just post my results...
Reply With Quote
  #4 (permalink)  
Old 09-28-2006, 06:27 PM
Member
User
 
Join Date: Jun 2005
Posts: 45
Rep Power: 0
warren
Default

thanks so much...

I was able to clone it via partimage, i was also able to grab their rescue cd which is very helpful. it has also lots of tools included, i like to recommend this rescue cd to everyone

warren
Reply With Quote
  #5 (permalink)  
Old 09-29-2006, 12:09 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,060
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Hmm

It looks good to me. I will try out

Sweta / warren thanks for sharing information
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Solaris Disk Monitoring vimalgoel Getting started tutorials 0 12-19-2007 05:53 PM
Linux check disk error raj Linux hardware 3 12-07-2007 11:00 AM
USB flash disk on Redhat sunguru CentOS / RHEL / Fedora 3 11-12-2007 09:00 PM
USB flash disk on Redhat sunguru CentOS / RHEL / Fedora 0 11-07-2007 06:40 PM
hard disk backup zafar466 Linux software 1 06-29-2007 02:47 AM


All times are GMT +5.5. The time now is 09:44 PM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36