Best way to clone one or several HDD [solved]

Topics about disk partitioning (fdisk, parted, gparted, partimage), Volumes Management (lvm, evms, dmraid), Storage, file systems, ...
matthiasw
Posts: 3
Joined: 14 Jul 2011, 07:16

Best way to clone one or several HDD [solved]

Postby matthiasw » 19 Jul 2011, 11:01

edit: oops.. this should be better in "Hard-disk partitioning and storage" or so

Hello everybody!

Simple question to discuss: what is the best way to clone one or several disk drives? I think there won't be the one and only answer. I am just at the beginning of becoming all familiar with Linux and disk cloning. What we want to do: clone one or multiple disk drives from one system to another (kind of installation CD).

I see three possibilities at this point:
* using dd
* using partimage
* using fsarchiver

This explains nice features of fsarchiver against partimage:
http://www.fsarchiver.org/Fsarchiver_vs_partimage
This is why I would prefer fsarchiver.

I have tried it and come across trouble with grub. If I have understood correctly fsarchiver just copies the files from the disk and stores it in the archive. It does not remember in which blocks the data to put back, am I right? I think this is the point which makes our GRUB break down.

Here is a nice instruction manual how to get GRUB back working:
http://www.sysresccd.org/Sysresccd-Part ... maged-Grub

Are you maybe using dd instead? Are you facing the same trouble?
I think dd would also be a nice option. What are the big disadvantages?
Do the disk drives have to be exactly the same size (I think smaller is not good, would bigger be a problem)?
Does (un)compressing need more time, I think I'd have to pipe the output somewhere? I suggest fsarchiver will be faster.

Edit:

My current way to go is:
* copy MBR of source disk
* copy files by partition into archive with fsarchiver
* play back MBR
* play back files by partition from archive using fsarchiver
Unfortunately after playing back the MBR using dd only fdisk can see my partitions now. Gparted does not show them and /dev only shows me /dev/sda... /dev/sda1, etc missing.

Edit:
It seems this is possible by calling fdisk and then "w" for write. Or I did it somehow else incidentally.
Is it possible to do this in a one-line command call? "fdisk -w" or something did not work.
Solved: partprobe does the thing!

Thanks for your help!
Matthias

gernot
Posts: 1121
Joined: 07 Apr 2010, 16:19

Re: Best way to clone one or several HDD

Postby gernot » 19 Jul 2011, 14:45

sfdisk -R /dev.. reread the partitiontable.
You can dd a small HD to a bigger but it is slow because this copy also unused blocks, but its mosttime bootable.

Gernot


Return to “Hard-disk partitioning and storage”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest