Clining a HD with Linux??


  Any idea in how could I clone a HD with Linux?
dirty_alAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
wouterwConnect With a Mentor Commented:
I wouldn't use cp to do such a thing. One could lose permissions and file dates.

just mount the target disk and start the tar copy.

As stated the linux Tips howto:

2.6.  Moving directories between filesystems. Alan Cox,
  A.Cox@swansea.ac.uk

  Quick way to move an entire tree of files from one disk to another


       (cd /source/directory && tar cf - . ) | (cd /dest/directory && tar xvfp -)




  [ Change from cd /source/directory; tar....etc.  to prevent
possibility of trashing directory in case of disaster.  Thanks to
Jim Dennis,  jim@starshine.org, for letting me know. -Maint. ]
0
 
roaldCommented:
If you want to make a bit for bit copy you can use:

dd if=/dev/hda of=/dev/hdb

This will copy the contents of hda to hdb. After that you just change the hostname an ip (or better run dhcp) and off you go. Make sure hdb is bigger er equal in size to disk hda.
0
 
EatEmAndSmileCommented:
I couldn't give a better answer! :)
--------------_4D48008EDF00BFFFEDD4
Content-Disposition: form-data; name="notify"

on
--------------_4D48008EDF00BFFFEDD4
Content-Disposition: form-data; name="Submit"

Submit
--------------_4D48008EDF00BFFFEDD4--
0
 
dirty_alAuthor Commented:

   I need a solution that can copy content, not a bit copy, so I can use HD with different sizes to clone.
0
 
EatEmAndSmileCommented:
Well, so just mount the two HDs, then considering your origin HD is mounted on the root point and your destination HD is mounted on the /backup point type:

 cp -r / /backup

 That's all, folks!
--------------_4D48009AE458BFFFEDD4
Content-Disposition: form-data; name="notify"

on
--------------_4D48009AE458BFFFEDD4
Content-Disposition: form-data; name="Submit"

Submit
--------------_4D48009AE458BFFFEDD4--
0
All Courses

From novice to tech pro — start learning today.