From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96075319906515.tru64-unix-managers.marc@archive.invalid> From: mader () cecam ! fr Date: Thu, 11 May 1995 09:57:45 +0000 To: tru64-unix-managers Subject: SUMMARY: making clones X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96075319906515 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--boundary=_0" This is a multipart MIME message. --boundary=_0 Content-Type: text/plain; charset="us-ascii" -------- My original posting: ---- Hi managers, the worst case scenario arrived: my alpha 3000/300 motherboard AND disk had to be replaced due to hardware error. Now I have to re-install completely from cd-rom. My question: since we have several identical machines, is there a way to make a clone of another installation, so that I don't have to go through the full installation from scratch? ----- UPDATE: Thanks to all those who replied so rapidly! It's good to know you're around. After several interventions of digital technicians, it turned out that the CPU was broken, and the disk still good (the I/O module did not work as a consequence of the CPU failure, so neither disk reading nor cd-rom reading worked.) I am glad I don't have to re-install, but I will use the cloning very soon when we upgrade from OSF/1 2.0 to 3.0. Since cloning might be useful to others, I include here some of the messages I received. I omit those which contained identical information. (IMO, some of the information is worth to be put in FAQ). Kurt Thanks to: bgk1142@bggfu2.nho.hydro.com bungert j_dubois@digital.ca luchini@siberia.ups-tlse.fr a.triulzi@ic.ac.uk tpb@zk3.dec.com warren@atmos.washington.edu teh@chinook.phy.anl.gov cyrmiche@sidoci.qc.ca hagan@oec.com alan@nabeth.cxo.dec.com demarthe@alpha.cad.cea.fr tenney@es.net SUMMARY: The basic idea is to physically move the virgin disk to another station, format and partition the new disk, do a dump/restore of the local / and /usr (and /var), move the disk back, boot single user, and edit the host-specific files. For more details, I enclose the following answers: (they were slightly edited to remove redundancies) --boundary=_0 Content-Type: text/plain; charset="us-ascii" Content-Description: 61 Hi Kurt, I've never done it with DEC OSF/1 but have performed it often with ULTRIX (I don't see why this would not work). I used to be Digital's UNIX support and we did this to reproduce demo stations. If you have a station you want to clone from: 1) Plug your empty disk on the machine to clone from 2) fix up your disk to your liking: a) edit the label (disklable -w -e /dev/rrz?a) b) create the file systems (newfs /dev/rz?a) 3) Mount the partitions you just created: mkdir /rz?a ; mount /dec/rz?a /r?g mkdir /rz?g ; mount /dec/rz?g /r?g 4) Now dump your information to the virgin disk: dump 0f - / | (cd /r?a ; restore rf -) dump 0f - /usr | (cd /r?g ; restore rf -) (suposing root is on ?a and /usr on ?g) 5) Before unpluging the disk copy /genvmuniv into /vmunix 6) Plug the cloned disk onto the previously crashed station and boot it 7) Fix up your kernel cd /sys/conf doconfig 8) reboot and change any network settins you had: netsetup bindsetup etc Have fun /jean --boundary=_0 Content-Type: text/plain; charset="us-ascii" Content-Description: 69 Return-Path: tpb@zk3.dec.com You are probably better off just installing from CDROM. That way you will be sure to get a clean install. However, if you really want to clone a disk, take the disk from the system where you've got the virgin disk and install it in the system you want to "clone". Use disklabel and fsck (or the AdvFS utilities, depending on how things are set up) to partition the "raw" disk and make file systems. Use vdump and vrestore, or dump and restore, or tar and tar (with piping output from the dump into the restore) to copy the appropriate file systems onto the new "cloned" disk. Make sure you've got a valid /genvmunix in the root partition of the "cloned" disk, and make sure you edit the /etc/fstab on the new disk to match the way the SCSI IDs will be set in the target system. Now move the disk back to the target system (changing the SCSI ID to work) and boot the generic vmunix -- boot -file "genvmunix" -flag S dka0 or what- ever disk ID is appropriate. Do a mount -u /dev/rz0a / or whatever is appropriate depending on whether your root partition is on rz0, to mount the root partition read-write. Do a bcheckrc to fsck your file systems and mount them read-write. Now go into the /sys directory (cd /sys) and rename the configuration file to match the name of the system. Remove the old system's kernel build directory. Now do the doconfig procedure. Or, to be safe, leave the old system's config file intact, just remove its kernel build directory. doconfig will prompt for your system name, offer you a menu of options for the kernel, make all the special devices for the system, and build a kernel for you. Once you've got the custom kernel built, move it to the root partition and reboot (after synching the disks). Now you can log in as root and run the /usr/sbin/setup script and set up the networks, etc. for the new system name (since they will all be set up wrong from the old system's files that are still on the disk). If you're not a pro, you're really safer doing a fresh install from CDROM. Tom Dr. Thomas P. Blinn, UNIX Software Group, Digital Equipment Corporation 110 Spit Brook Road, MS ZKO3-2/U20 Nashua, New Hampshire 03062-2698 Technology Partnership Engineering Phone: (603) 881-0646 Internet: tpb@zk3.dec.com Digital's Easynet: alpha::tpb Worry kills more people than work because more people worry than work. My favorite palindrome is: Satan, oscillate my metallic sonatas. -- Phil Agre, pagre@ucsd.edu Opinions expressed herein are my own, and do not necessarily represent those of my employer or anyone else, living or dead, real or imagined. >Using the tape, instead of moving the disks: --boundary=_0 Content-Type: text/plain; charset="us-ascii" Content-Description: 70 Return-Path: <@sun.rhrk.uni-kl.de:bungert@rhrk.uni-kl.de> Hi Kurt, I think I can help You, because we also make our backups on a remote tape. You can get a lot of information out of the DEC OSF/1 Guide to System Administration. (chapters 9.1.4 and 9.2.5) But I try to explain to You how we made it (excuse my english). It is easy to create a backup on a tape at a remote machine by using rdump (see man-pages). If you have an AdvFS it is a little bit complicated. To restore a system-backup is not so easy. You have to perform the following steps: 1. Boot from your installation cd (e.g. at boot level: boot dka400 the following screen apears: 1. basic installation 2. advanced installation 3. system management choose 3 (system management) --> A minimal-system will be created in your memory 2. change into the /dev directory: cd /dev 3. create a device file for your disk : e.g. MAKEDEV rz3 4. configure your network interface: ifconfig ln0 netmask 5. insert name and address of your host and the host with the tape in /etc/hosts #cd /etc #echo "127.0.0.1 localhost" >> hosts #echo " " >> hosts #cd / 6. create a new root filesystem on disk: newfs /dev/rrz3a 7. mount the disk: mount /dev/rz3a /mnt cd /mnt 8. because rrestore (remote restore) is not available, you have to restore the backup like this: rsh "dd if=/dev/rmt0h bs=10k" | restore -Yrf - 9. umount the disk cd / umount /mnt 10. create a new /usr filesystem newfs /dev/rrz3g mount /dev/rz3g /mnt cd /mnt 11. make the backup: rsh "dd if=/dev/rmt0h bs=10k" | restore -Yrf - 12. reboot the system from disk : boot dka300 (e.g.) The used commands are explained in the man pages, therefore I don't have to explain them here. If you have some problems during this procedure or if you want some things to be expalined in more detail, please contact me again, you're welcome. By, Andy --boundary=_0 Content-Type: text/plain; charset="us-ascii" Content-Description: 74 Return-Path: cyrmiche@sidoci.qc.ca Bonjour ... Un petit message du Quebec (If you don't understand french, let me know) Il est tres facile de copier le systeme d'exploitation et ses diverses composantes. Procedure : 1- Installer le systeme d'exploitation de facon standard, par exemple sur rz8. 2- Utiliser ce disque (Master) sur un autre systeme pour creer des copies. ex.: Sur un equipement ou le systeme d'exploitation a ete installe (disons sur rz3), et ou les disques source (Master/rz8) et destination (Nouveay disque/rz9) Taper les commandes suivantes : disklabel -z rz9 ( Zap du label de disque ) ( Necessaire puisque le bloc zero est en mode lecture seulement lorsque le label est present) dd if=/dev/rrz8c of=/dev/rrz9c bs=1024k Et Voila Si tu desire utiliser ce disque a une autre adresse que rz8, tu dois modifier la configuration initiale de ce nouveau disque : Pour ADVFS : Modifier la structure de /etc/fdmns Pour UFS: Mofifier les entrees de /etc/fstab Ne pas oublier de creer les nouveaux "devices" dans /dev Bonne chance ! Michel Cyr SIDOCI enr. IST-Integration inc. (514)252-4333 ex 258 Michel.Cyr@sidoci.qc.ca --boundary=_0 Content-Type: text/plain; charset="us-ascii" Content-Description: 76 Return-Path: hagan@oec.com 2 methods: 1 (fastest) requires that both disks be identical media (e.g. both are rz26L's). dd if=/dev/rrz1c of=/dev/rrz2c bs=1024 replace 1 with the id of the source drive, 2 with the id of the target disk 2 (slower) works with any type of media (as long as the target is at least as large as the space used on the source: disklabel the target to have partitions which match the source. for each partition if ufs: newfs /dev/target mount /dev/target /mnt dump 0f - /dev/source | (cd /mnt; restore xf -) if advfs: mkfset target_dmn target_fset mount target_dmn#target_fset /mnt vdump 0f - /source | (cd /mnt; vrestore xf - ) -- craig --boundary=_0 Content-Type: text/plain; charset="us-ascii" Content-Description: 79 Return-Path: tenney@es.net Kurt, I have done this many times with both Ultrix and Digital Unix. You will need to shutdown one of the old systems and attach the new drive to it, then bring it back up and use the old system to partition the new drive, newfs the partitions on the new disk. Then mount the partitions on the new disk one by one on the old system and clone them from the old system disk. I use dump and restore to clone the disks, but you might be better off using cpio or vdump and vrestore. I have heard rumors of problems with dump and restore on Digital Unix. Here are the commands I use to clone a partition. Say I want to clone the / partition to the new disk. The new disk is rz2. mount /dev/rz2a /mnt dump 0f - / | (cd /mnt; restore -rf -) You then have to change things like the fstab, hostname, etc. Remember to change /mnt/etc/fstab, not /etc/fstab! Then clone the other partitions. Let me know if this is less clear than mud! Craig Tenney tenney@es.net --boundary=_0 Content-Type: text/plain; charset="us-ascii" ---- Kurt Mader http://www.cecam.fr/~mader/ Centre Europeen de Calcul mader@cecam.fr Atomique et Moleculaire (CECAM) Ecole Normale Superieure de Lyon phone: +33 72 72 86 31 46, Allee d'Italie, 69364 Lyon cedex 07 fax: +33 72 72 86 36 --boundary=_0--