Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Unix Operating Systems > Linux Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-17-2008, 06:05 PM
h1nd00_p$ych1a7r1$7@salmahayeksknockers.edu
 
Posts: n/a
Default Best way to "Clone" a Linux Hard drive?

I've found several methods:

1) LVM Snapshots
2) DDing of whole drive or partitions
3) Mirroring, Syncing, and breaking (Although I havn't figured out how)

Does anyone have any suggestions as to which is better, or other options?


--
.................................................. ............................

"We must use terror, assassination, intimidation, land confiscation, and the
cutting of all social services to rid the Galilee of its Arab population."

-Joseph Weitz, head of the Jewish Agency's Colonization Department.

.................................................. ............................
dswan@m3m3t1ccand1ru.com http://www.memeticcandiru.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-17-2008, 06:05 PM
P.T. Breuer
 
Posts: n/a
Default Re: Best way to "Clone" a Linux Hard drive?

h1nd00_p$ych1a7r1$7@salmahayeksknockers.edu wrote:
> I've found several methods:
>
> 1) LVM Snapshots
> 2) DDing of whole drive or partitions
> 3) Mirroring, Syncing, and breaking (Although I havn't figured out how)
>
> Does anyone have any suggestions as to which is better, or other options?


Uh - what's the problem with cp -a? Or if you must do it over the net,
use rsync or tar.

Most of the above is not for cloning, but are useful preceding actions
prior to cloning. Only dd will do a copy from among your options (and
what is wrong with "cp"?), and it's pretty silly as a method to choose!

The usual thing is to use rsync or tar (or cpio, apio, etc.). If you
are fussy about holding the thing steady while you are photographing
it, then you might do an lvm snapshot op beforehand. Of course, if
you were mirroring the thing, you could break the mirror, leaving
yourself with the snapshot at time of breakage, and copy that. But
an lvm snapshot will be more space efficient.

Why make such a fuss? It's not a thing that's hard to do, thus the word
"better" seems to have little meaning!

Peter
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-17-2008, 06:05 PM
Paulo Roberto Dallan
 
Posts: n/a
Default Re: Best way to "Clone" a Linux Hard drive?

h1nd00_p$ych1a7r1$7@salmahayeksknockers.edu wrote:

> I've found several methods:
>
> 1) LVM Snapshots
> 2) DDing of whole drive or partitions
> 3) Mirroring, Syncing, and breaking (Although I havn't figured out how)
>
> Does anyone have any suggestions as to which is better, or other options?
>
>


Have you tried partition image (note: not partition magic)? It makes
(compressed, if you will) images of your partitions, and its possible to
copy the mbr & partition structure, although cloning has to be done
manually. It is similar to Norton Ghost, I believe.

Good luck.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-17-2008, 06:06 PM
Chris Cox
 
Posts: n/a
Default Re: Best way to "Clone" a Linux Hard drive?

P.T. Breuer wrote:
> h1nd00_p$ych1a7r1$7@salmahayeksknockers.edu wrote:
>
>>I've found several methods:
>>
>>1) LVM Snapshots
>>2) DDing of whole drive or partitions
>>3) Mirroring, Syncing, and breaking (Although I havn't figured out how)
>>
>>Does anyone have any suggestions as to which is better, or other options?

>
>
> Uh - what's the problem with cp -a? Or if you must do it over the net,
> use rsync or tar.
>
> Most of the above is not for cloning, but are useful preceding actions
> prior to cloning. Only dd will do a copy from among your options (and
> what is wrong with "cp"?), and it's pretty silly as a method to choose!


You'd still have to deal boot block issues... but could be done
after the fact.

>
> The usual thing is to use rsync or tar (or cpio, apio, etc.). If you
> are fussy about holding the thing steady while you are photographing
> it, then you might do an lvm snapshot op beforehand. Of course, if
> you were mirroring the thing, you could break the mirror, leaving
> yourself with the snapshot at time of breakage, and copy that. But
> an lvm snapshot will be more space efficient.


lvm snapshotting is notoriously buggy. Even in LVM1.

rsync is great for syncing two hosts... but not really for cloning
and falls into the same boot block issue as mentioned. Not sure
what/how rsync deals with all of the special devices. My guess
is that those would have to be handled separately too... but it is
a guess.

If it's a common platform rollout (same HW disk every time), storing
a raw image of the whole drive or the partitions (the "dd" method...
though cp works for Linux) is a good approach.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-17-2008, 06:06 PM
P.T. Breuer
 
Posts: n/a
Default Re: Best way to "Clone" a Linux Hard drive?

Chris Cox <ccox_nopenotthis@airmail.net> wrote:
> P.T. Breuer wrote:
> rsync is great for syncing two hosts... but not really for cloning
> and falls into the same boot block issue as mentioned. Not sure


You can't deal with a boot block by "cloning": you don't know what the
target device is or where in the bios boot order it is or even what boot
loader is being used, in order to modify its configuration (and you
don't know where its configuration IS). The boot block may not be
located anywhere near either source or target, even! The best that you
can do is deal with the most common cases.

> what/how rsync deals with all of the special devices.


Perfectly.

Peter
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-17-2008, 06:06 PM
Jayson Garrell
 
Posts: n/a
Default Re: Best way to "Clone" a Linux Hard drive?

On Tue, 17 Feb 2004 22:14:14 +0000, h1nd00_p$ych1a7r1$7 wrote:

> I've found several methods:
>
> 1) LVM Snapshots
> 2) DDing of whole drive or partitions
> 3) Mirroring, Syncing, and breaking (Although I havn't figured out how)
>
> Does anyone have any suggestions as to which is better, or other options?


Last time I did this, moved to a bigger drive. I used cp. It worked fine.
Look at the help or man page for cp to get the right switchs but it works
great. Basically I did the following.

1) Turn off pc and put new drive on the bus. I put the new drive where it
was going to be when done, ie... moved the original drive to hdb and
placed the new drive as hda.

2) Boot pc from a rescue cd, I use the gentoo liveCD but you can use any
you wish.

3) make mount points for both drives. I use /mnt/old (for old drive) &
/mnt/new (for new drive). Mount both drives.

4) cp -vrpf /mnt/old/* /mnt/new/

5) cd to /mnt/new

6) chroot /mnt/new /bin/bash

7) lilo (re-run lilo to rebuild the boot loader)

8) turn pc off and remove old drive, turn pc back on.

You should now be good to go, running on the new drive. Like I said I have
used this method before and it's always worked. Last night I upgraded the
drive on my mini-itx mobo, but this time I used partimage
http://www.partimage.org and burnt the images to a bootable cdrom. Just to
make it easier for the next time.

Jayson G
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-17-2008, 06:06 PM
Chris Cox
 
Posts: n/a
Default Re: Best way to "Clone" a Linux Hard drive?

P.T. Breuer wrote:
> Chris Cox <ccox_nopenotthis@airmail.net> wrote:
>
>>P.T. Breuer wrote:
>>rsync is great for syncing two hosts... but not really for cloning
>>and falls into the same boot block issue as mentioned. Not sure

>
>
> You can't deal with a boot block by "cloning": you don't know what the
> target device is or where in the bios boot order it is or even what boot
> loader is being used, in order to modify its configuration (and you


Usually cloning... means.... cloning.

This isn't a copy here... it's cloning.

Cloning... cloning... cloning.

You don't have to reply just because somebody pointed
out something you failed to mention.

....more stuff about NOT cloning snipped...

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-17-2008, 06:07 PM
P.T. Breuer
 
Posts: n/a
Default Re: Best way to "Clone" a Linux Hard drive?

Chris Cox <ccox_nopenotthis@airmail.net> wrote:
> P.T. Breuer wrote:
> > Chris Cox <ccox_nopenotthis@airmail.net> wrote:
> >
> >>P.T. Breuer wrote:
> >>rsync is great for syncing two hosts... but not really for cloning
> >>and falls into the same boot block issue as mentioned. Not sure

> >
> > You can't deal with a boot block by "cloning": you don't know what the
> > target device is or where in the bios boot order it is or even what boot
> > loader is being used, in order to modify its configuration (and you

>
> Usually cloning... means.... cloning.


Which means producing an exact copy.

From The Free On-line Dictionary of Computing (07Oct99) [foldoc]:

clone

1. An exact duplicate: "Our product is a clone of their
product." Implies a legal reimplementation from documentation
or by reverse-engineering. Also connotes lower price.

or do you mean


2. A shoddy, spurious copy: "Their product is a clone of our
product."

3. A blatant ripoff, most likely violating copyright, patent,
or trade secret protections: "Your product is a clone of my
product." This use implies legal action is pending.

etc?


> This isn't a copy here... it's cloning.


Which brand of doublespeak do you articulate?


> Cloning... cloning... cloning.


Yadda yadda yadda. Are you talking about some new meaning of the word
that we are not party to, such as "not copying"?

> You don't have to reply just because somebody pointed
> out something you failed to mention.


What?

> ...more stuff about NOT cloning snipped...


Please go back off your drugs. I pointed out that copying a disk
wouldn't necesarily result in a bootable system, nor would any
computational algorithm necessarily do so. Do you have any reason to
doubt that?

Peter
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 01-17-2008, 06:07 PM
Chris Cox
 
Posts: n/a
Default Re: Best way to "Clone" a Linux Hard drive?

P.T. Breuer wrote:
> Chris Cox <ccox_nopenotthis@airmail.net> wrote:
>
>>P.T. Breuer wrote:
>>
>>>Chris Cox <ccox_nopenotthis@airmail.net> wrote:
>>>
>>>
>>>>P.T. Breuer wrote:
>>>>rsync is great for syncing two hosts... but not really for cloning
>>>>and falls into the same boot block issue as mentioned. Not sure
>>>
>>>You can't deal with a boot block by "cloning": you don't know what the
>>>target device is or where in the bios boot order it is or even what boot
>>>loader is being used, in order to modify its configuration (and you

>>
>>Usually cloning... means.... cloning.

>
>
> Which means producing an exact copy.
>
> From The Free On-line Dictionary of Computing (07Oct99) [foldoc]:
>
> clone
>
> 1. An exact duplicate: "Our product is a clone of their
> product." Implies a legal reimplementation from documentation
> or by reverse-engineering. Also connotes lower price.


This means exact drive, exact boot record, clone... clone.. clone...

....
>
>>This isn't a copy here... it's cloning.

>
>
> Which brand of doublespeak do you articulate?


I'm just saying the OP wanted to clone a disk. You gave
a recipe for coped disk data for use in a NON-cloning
arrangement.

>
>
>
>>Cloning... cloning... cloning.

>
>
> Yadda yadda yadda. Are you talking about some new meaning of the word
> that we are not party to, such as "not copying"?
>
>
>>You don't have to reply just because somebody pointed
>>out something you failed to mention.

>
>
> What?


When you clone, you want the boot record. Without it, you
just have copied data... like any backup.

>
>
>>...more stuff about NOT cloning snipped...

>
>
> Please go back off your drugs.


What a total ignorant slob you are... did I try to tell
you that you were on drugs... no.. just that you were
trying to confuse the idea of multiple machine cloning
with data copying... what a jerk for thinking anything
different... sheesh.. some people are just dumb
as dirt I guess.

> I pointed out that copying a disk
> wouldn't necesarily result in a bootable system, nor would any
> computational algorithm necessarily do so. Do you have any reason to
> doubt that?


Having CLONED a million of machines using a TRUE cloning
process I be to differ.... however, since you are not CLONING
but merely copying data to NON-like HW (therefore NOT a clone
since they ARE DIFFERENT).... do you get it... sheesh..

>
> Peter


Whatever...


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 01-17-2008, 06:07 PM
P.T. Breuer
 
Posts: n/a
Default Re: Best way to "Clone" a Linux Hard drive?

Chris Cox <ccox_nopenotthis@airmail.net> wrote:
> I'm just saying the OP wanted to clone a disk. You gave
> a recipe for coped disk data for use in a NON-cloning
> arrangement.


Eh? A copy is a clone. If you are trying to say that you want a copy
that preserves the exact bits on disk, rather than "just" the
arrangement of files, then by all means say so rather than reaching for
a word that does not mean what you think it means!

But unfortunately that will not work to give you a working boot sector
in all situations. In fact. in very few.

> > Please go back off your drugs.

>
> What a total ignorant slob you are...


Kindly stop insulting people you unpleasant slug ...

> did I try to tell
> you that you were on drugs...


?? "on drugs" is an expression meaning "hallucinating, seeing things
in a distorted way, living in a private universe, etc.". That's what
you seem to be!

> no.. just that you were
> trying to confuse the idea of multiple machine cloning
> with data copying...


There is no difference. I am not confusing anything, you are! I told
you what clone means. I'll write it out for you again if you like!

1. An exact duplicate: "Our product is a clone of their
product." Implies a legal reimplementation from documentation
or by reverse-engineering. Also connotes lower price.

2. A shoddy, spurious copy: "Their product is a clone of our
product."

3. A blatant ripoff, most likely violating copyright, patent,
or trade secret protections: "Your product is a clone of my
product." This use implies legal action is pending.

Etc.

> what a jerk for thinking anything
> different...


Eh?

> sheesh.. some people are just dumb as dirt I guess.


You said it!


> > I pointed out that copying a disk
> > wouldn't necesarily result in a bootable system, nor would any
> > computational algorithm necessarily do so. Do you have any reason to
> > doubt that?

>
> Having CLONED a million of machines using a TRUE cloning
> process I be to differ


Then you would be wrong. COPYING a boot sector (note,not "cloning")
does not give you a bootable machine.



> .... however, since you are not CLONING
> but merely copying data to NON-like HW (therefore NOT a clone


It doesn't matter, whatever you are trying to say (I suspect you are
trying to get out words that mean that the offset on disk of the
target kernel or secondary stage loader will be changed by the copy
from the original, which means that the CLONED boot sector will miss
it, since it still has the physical location of the original embedded
in it).

That's "right". That's why you have to COPY the boot sector and CHANGE
it for its new environment.

> since they ARE DIFFERENT).... do you get it... sheesh..


Do YOU get it? Apparently not!

You see - you don't know how that boot sector was generated. Therefore
you don't know what it is aiming at. Theerfore you don't know what to
repoint it at.

Nor do you know which disk it is trying to boot. Nor what the new
bios calls that disk (0x80? 0x81?).

Yes, if you take all the disks from one machine, and copy them to all
the disks of another machine, and put them in exactly the same places,
and remove all other devices, and tell the bioses that the disks have
exactly the same geometry, and arrange the bios boot orders to be
exactly the same on both machines, then you would get a booting disk.

OK?

But nobody has ever seen two machines built more than two weeks apart
that are exactly the same.

Peter
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:01 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
UnixAdminTalk.com

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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523