<div>dd is wildly inefficient: it copies over empty blocks, discarded blocks, etc., and I don't recommend it. rsync is great: you have to be careful with the &quot;exclude&quot; syntax to avoid recursion, but it works well. /bin/cp -a is almost as good as rsync, but doesn't allow you to efficiently do it twice. tar has some useful options to avoid descending to other partitions, which is handy for avoiding NFS mounts or 
</div>
<div>&nbsp;</div>
<div>You also really, really want to make sure the partition layouts are similar. For speed and ease, I tend to use only a few primary partitions and avoid using LVM or LVM with different /tmp, /var, /usr, /home, /opt, etc., etc., etc. partitions to ease exactly this sort of duplication. One big swap partition, one big / partition on a primary partition, and you're done in almost all situations. I can program that with a few lines of fdisk code, rather than the complexity of LVM and software RAID and allocating disk sizes or squashing a directory that turns out to need to be larger than I expected.
</div>
<div>&nbsp;</div>
<div>You&nbsp;also need to make sure that any necessary boot-time disk controllers are in the system's initrd: look up the manual page for mkinitrd, and for &quot;grub-install&quot; in order to create a new MBR that points to the right grub configuration on your new disk.
<br><br>I've used such procedures for, roughly, 15000 active servers, so I know it works.</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><span class="gmail_quote">On 11/14/06, <b class="gmail_sendername">Brendan Whelan</b> &lt;<a href="mailto:b_whelan@mistral.co.uk">b_whelan@mistral.co.uk</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Thank you for the responses.<br><br>As Steve D noted when using&nbsp;&nbsp;dd if=/dev/sda of /dev/sdb the output disk must
<br>be at least as large as the input disk. I have found that the inevitable few<br>blocks difference in size, in 73GB, is enough to stop this working. I seem<br>to remember, that on occasions, there were problems with bad block
<br>information.<br><br>Regarding using &quot;cp&quot; I had understood (possibly wrongly) that cp didn't<br>always give a perfect copy and that rsync was more reliable.<br>Would the cp command be cp -Ra&nbsp;&nbsp;/dev/sda /dev/sdb&nbsp;&nbsp; ?
<br><br>I have found with proprietary disk copying programs that I get problems when<br>I upgrade/replace the hardware.<br><br>I will look at the other options suggested.<br>Once again thanks for the advice and I welcome any more comments or
<br>suggestions.<br><br>Brendan<br><br>----- Original Message -----<br>From: &lt;<a href="mailto:linux@oneandoneis2.org">linux@oneandoneis2.org</a>&gt;<br>To: &lt;<a href="mailto:sussex@mailman.lug.org.uk">sussex@mailman.lug.org.uk
</a>&gt;<br>Sent: Monday, November 13, 2006 5:19 PM<br>Subject: Re: [Sussex] Simple cloning<br><br><br>&gt; &gt; Does the following approach look sensible:<br>&gt; &gt;<br>&gt; &gt; 1. Install a virgin copy of FC5 on the target disk.
<br>&gt; &gt;<br>&gt; &gt; 2. Place the original drive in the server with a low address.<br>&gt; &gt;<br>&gt; &gt; 3. Place the target drive in the server with a higher address.<br>&gt; &gt;<br>&gt; &gt; 4. Boot the system and allow to settle down.
<br>&gt; &gt;<br>&gt; &gt; 5. rsync /dev/sda /dev/sdb&nbsp;&nbsp;&nbsp;&nbsp;is this too simplistic?&nbsp;&nbsp;Should I repeat<br>&gt; &gt; this step a couple of times.<br>&gt; &gt;<br>&gt; &gt; 6. Shutdown<br>&gt; &gt;<br>&gt; &gt; 7. Reboot with only the target drive installed and check that all is
<br>well.<br>&gt;<br>&gt; Can't you just use &quot;cp -Ra&quot; for this? It's all I've ever used to move an<br>&gt; install from one disk to another. .<br>&gt;<br>&gt; Dominic<br>&gt;<br>&gt; __<br>&gt; Sussex mailing list
<br>&gt; <a href="mailto:Sussex@mailman.lug.org.uk">Sussex@mailman.lug.org.uk</a><br>&gt; E-mail Address: <a href="mailto:sussex@mailman.lug.org.uk">sussex@mailman.lug.org.uk</a><br>&gt; Sussex LUG Website: <a href="http://www.sussex.lug.org.uk/">
http://www.sussex.lug.org.uk/</a><br>&gt; <a href="https://mailman.lug.org.uk/mailman/listinfo/sussex">https://mailman.lug.org.uk/mailman/listinfo/sussex</a><br>&gt;<br>&gt;<br><br><br><br>__<br>Sussex mailing list<br><a href="mailto:Sussex@mailman.lug.org.uk">
Sussex@mailman.lug.org.uk</a><br>E-mail Address: <a href="mailto:sussex@mailman.lug.org.uk">sussex@mailman.lug.org.uk</a><br>Sussex LUG Website: <a href="http://www.sussex.lug.org.uk/">http://www.sussex.lug.org.uk/</a><br>
<a href="https://mailman.lug.org.uk/mailman/listinfo/sussex">https://mailman.lug.org.uk/mailman/listinfo/sussex</a><br></blockquote></div><br>