From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "J.A. Gutierrez" Newsgroups: gmane.os.tru64.managers Subject: not using dd Date: Tue, 25 Mar 2003 11:29:32 +0100 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: <20030325112932.A9934@shiva.cps.unizar.es> References: <4C53A11A9475D511826600034725155305FC8F69@sjmemexc1.stjude.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1048588219 24679 80.91.224.249 (25 Mar 2003 10:30:19 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 25 Mar 2003 10:30:19 +0000 (UTC) Original-X-From: tru64-unix-managers-owner-gotm-tru64-unix-managers=m.gmane.org@sws1.ctd.ornl.gov Tue Mar 25 11:30:17 2003 Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.22.101]) by main.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 18xlhB-0006Pt-00 for ; Tue, 25 Mar 2003 11:30:17 +0100 Original-Received: (qmail 12982 invoked by uid 5); 25 Mar 2003 10:30:09 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 12973 invoked by uid 49493); 25 Mar 2003 10:30:09 -0000 Original-Received: from spd@shiva.cps.unizar.es by sws1 by uid 49491 with qmail-scanner-1.14 (clamscan: 0.54. spamassassin: 2.50-cvs. Clear:SA:0(-17.5/5.0):. Processed in 0.605838 secs); 25 Mar 2003 10:30:09 -0000 Original-Received: from unknown (HELO emroute1.cind.ornl.gov) (160.91.4.119) by 0 with SMTP; 25 Mar 2003 10:30:08 -0000 Original-Received: from emroute1.cind.ornl.gov (localhost [127.0.0.1]) by emroute1.cind.ornl.gov (PMDF V6.2 #30669) with ESMTP id <0HCA00993VTZY7@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Tue, 25 Mar 2003 05:30:06 -0500 (EST) Original-Received: from shiva.cps.unizar.es (shiva.cps.unizar.es [155.210.152.10]) by emroute1.cind.ornl.gov (PMDF V6.2 #30669) with ESMTP id <0HCA0097TVTH8P@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Tue, 25 Mar 2003 05:29:42 -0500 (EST) Original-Received: (from spd@localhost) by shiva.cps.unizar.es (8.8.8/8.8.8) id LAA10703 for tru64-unix-managers@ornl.gov; Tue, 25 Mar 2003 11:29:32 +0100 (MET) In-reply-to: <"from Bill.Pappas"@stjude.org> Original-To: tru64-unix-managers@ornl.gov Content-Disposition: inline User-Agent: Mutt/1.2.5i Xref: main.gmane.org gmane.os.tru64.managers:3776 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:3776 Sorry for replying to the list, but since I'm adding questions more than giving answers... On Mon, Mar 24, 2003 at 01:29:09PM -0600, Pappas, Bill wrote: > I found a great script for cloning a disk, but I was wondering...is there a > way to automate the cloning via crontab? > Here is what I would like to see happen automatically.... > 1. From multiuser mode with networking (init 3) goto single user mode. > 2. Mount the disks you need > 3. Perform the clonedisk script shown at MY SCRIPT. > 4. When dome with #3 go back to init 3 > > The problem I am having is with step 1. As I dive into single user mode, my > script is killed as are other processes. > Therefoe, I never reach step 2 > > Any suggestions on how I could automate this? I wouldn't use dd in the first place. I don't think you can easily automate nothing which requires single user. (well, maybe modifying inittab; but anyway, if you could hack it, single user won't make dd good for cloning the startup disk, since it is still mounted) I'd use dump/tar/cpio for that purpose; I have a script for linux and solaris; but I still don't know how to do some tasks: - Read partition table from original disk: SunOS: prtvtoc -h ${ORIG}2 Linux: fdisk -ul $ORIG Tru64: disklabel -r ???? - Create a new partition table SunOS: fmthard -s - ${RDEST}2 Linux: sfdisk $DEST Tru64: disklabel -R ???? (would "disklabel -r $ORIG | disklabel -R $DEST" work?) - Setting swap SunOS: not needed Linux: mkswap `fdisk -l $DEST | awk '/swap$/ {print $1}'` Tru64: not needed? - Creating boot loader SunOS: /usr/sbin/installboot \ /usr/platform/`uname -i`/lib/fs/ufs/bootblk ${RDEST}0 Linux: lilo -v -r /new/1 -b $DEST Tru64: ???? Problems: I'm not sure about how advfs work; and in my script I need to mount the destination filesytems in order to copy contents. So, if I have, for instance: /dev/disk/dsk0a root_domain and I need to mount /dev/disk/dsk1a, I guess I should create a new domain (mkfdmn /dev/disk/dsk1a root_domain2) then a fileset (mkfset root_domain2 root) Question: this domain/fileset procedure will modify dsk1 or is just at OS level? i.e., if I physically disconnect dsk0 and boot from dsk1 (now dsk0), it's partitions will be part of "root_domain" or of "root_domain2" ? Once cloned, if I remove "root_domain2", dsk1a contents will be lost? BTW; you can find the script at http://giga.cps.unizar.es/~spd/src/system/do_mirror I'd like to add Tru64 support, but I'm not sure when I will be able to test it (I have a single DS10 host, and by now both disks are in use) -- finger spd@shiva.cps.unizar.es for PGP / .mailcap tip of the day: / La vida es una carcel application/ms-tnef; cat '%s' > /dev/null / con las puertas abiertas text/x-vcard; cat '%s' > /dev/null / (A. Calamaro)