Tags:
create new tag
, view all tags
An old approach that still might be useful (this is actually R1.2 of DdCloningScript) -- but preserved here for possibly resurrecting this script.

<the old page:>

Starting to develop a script (or two) for some work at CFK. See #Purpose.

See:

Contents

Purpose

Purpose of the script(s):

When the CFK has multiple machines with the same equipment (RAM, hard drive (size), video and sound card, etc.) a more efficient way to install the Vector CFK Linux is by cloning the hard drive from a good installation. (More efficient than doing one-off installs from the installation CD-Rom.) It might be even more efficient to do installs over a network, or clone hard drives over a network ??, and Joe Simpson is looking into at least the first of these)

Procedure

In more detail, the anticipated procedure is:

  • Create a good install on a hard drive in one machine.

  • Then either take that good hard drive from machine to machine and clone it to the hard drive in that machine (or remove the hard drive from the next machine to be installed, and bring it back to the machine with the good install for cloning). I've only done it the latter way, but the first way sounds more efficient in terms of hardware / mechanical steps. (Unless we want to do something like clone 3 drives at a time, which actually did save a small amount of time compared to doing three dds -- documented on the CFK mail list, but not, so far, on the TWiki, IIRC.) _Since I've only used the second approach so far, I think my first attempt at a script will be for that approach. Shouldn't be hard to change for the other approach.

  • Therefore, these assumptions as we boot up: good install is on /dev/hda (i.e., master on first disk controller) with swap on hda1, install on hda2. Drive to be cloned is hdb (i.e., slave on first disk controller) probably with a Windows partition or two.

  • Use fdisk (or sfdisk) to create three partitions on /hdb -- hdb1 with same size as hda1, hdb2 with same size as hda2, hdb3 with all remaining space. (Incidentally, this leads to any data on the Windows partitions becoming inaccessible (or certainly difficult to access), which is one of the requirements on CFK ("wiping" existing data / programs off the hard drive).)

Note: Those sizes might be passed as parameters, hard coded into the script (to be revised on different machines) or prompt the operator, preferably at the beginning of the script.

  • Alternate to consider: If we made hdb2 with all remaining space on drive, and then dd'ed hda2 to it, would hdb2 remain at it's original size after the cloning? If so, that would be a better way to go because we'd save some steps.

I've posted the question on the CFK mailing list -- pending an answer I'll continue developing the non-alternate.

  • dd hda1 to hdb1 and hda2 to hdb2:

=dd if=/dev/hda1 of=/dev/hdb1=
dd if=/dev/hda2 of=/dev/hdb2

Another alternate to consider -- I shouldn't have to dd the swap drive -- I should be able to just create it with type swap, then mount it (??), then tell Vector to use it. Currently I'm not sure how to do that, and I'm unsure when I'd tell Vector to use it -- would I have to boot into the new installation first? If so, the dd'ing approach may overall save time. Still, I want to learn the other approach for my own needs.

  • Based on the size of hdb3, either use it as a new and bigger /home or use it as a new /data. (I guess as a first cut at making the decison, I'd see how much free space is on hda2 and how much space is used by /home on hda2 -- if hdb3 is as big or bigger than the sum of those, I'd probably move /home -- if smaller I'd create /data.

So, we have a fork in the road -- here's the create /home path:

Hmm, similar question about some of these steps -- can I do them before I run the newly installed system?

  • mount hdb3 as /temp (if not already used)

  • copy /home to /temp, preserving hard and soft links

  • umount /temp and remount hdb3 as /home -- really I don't want to do this until the new installation is booted -- maybe before then I can add it to mstab?? (not fstab, as that would be for mounting in the clone "master" machine -- looks like this step might be easier if we carried the clone master from machine to machine) in hdb2 with "auto" so it mounts automatically when the new install boots (on the "target" machine -- oops, when moved back to the target machine it will be hda3, not hdb3, so that's what I want to add to mstab

Fork from above -- here's the /data path:

  • add hdb3 (really hda3, see discussion) to mstab (on hdb2) as /data -- same discussion as last step in the other fork -- as it is the same issue: really I don't want to do this until the new installation is booted -- maybe before then I can add it to mstab?? (not fstab, as that would be for mounting in the clone "master" machine -- looks like this step might be easier if we carried the clone master from machine to machine) in hdb2 with "auto" so it mounts automatically when the new install boots (on the "target" machine -- oops, when moved back to the target machine it will be hda3, not hdb3, so that's what I want to add to mstab

Resources

See ResourceRecommendations. Feel free to add additional resources to these lists, but please follow the guidelines on ResourceRecommendations including ResourceRecommendations#Guidelines_for_Rating_Resources.

Recommended

  • (rhk) makedisk readme; ; - there's some useful stuff at this site, starting with this readme which gives the steps to create a Linux boot disk in dos or Linux

Contributors

  • () RandyKramer - 18 Feb 2003
  • <If you edit this page: add your name here; move this to the next line; and include your comment marker (initials), if you have created one, in parenthesis before your WikiName.>

Page Ratings

Topic revision: r1 - 2003-02-20 - RandyKramer
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by PerlCopyright 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding WikiLearn? WebBottomBar">Send feedback
See TWiki's New Look