From owner-freebsd-questions Wed Aug 15 15:43:16 2001 Delivered-To: freebsd-questions@freebsd.org Received: from smtp1.sentex.ca (smtp1.sentex.ca [199.212.134.4]) by hub.freebsd.org (Postfix) with ESMTP id 2FDFA37B409 for ; Wed, 15 Aug 2001 15:43:11 -0700 (PDT) (envelope-from mike@sentex.net) Received: from chimp.simianscience.com (cage.simianscience.com [64.7.134.1]) by smtp1.sentex.ca (8.11.1/8.11.1) with SMTP id f7FMgxF60545; Wed, 15 Aug 2001 18:42:59 -0400 (EDT) (envelope-from mike@sentex.net) From: Mike Tancsa To: jonathan@graehl.org ("Jonathan Graehl") Cc: questions@freebsd.org Subject: Re: How to create a bootable FreeBSD hard drive for transfer to a new machine? Date: Wed, 15 Aug 2001 18:42:59 -0400 Message-ID: References: In-Reply-To: X-Mailer: Forte Agent 1.8/32.548 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 14 Aug 2001 18:20:32 -0400, in sentex.lists.freebsd.questions you = wrote: >Is it possible to use sysinstall on a live FreeBSD machine with an extra >disk as the destination? > >I want to jumpstart a new FreeBSD machine, without having the option of >bootable cdrom (old BIOS), floppy (broken controller), or network card >(don't have one with that capability). I used to build a DOS boot with >Linux install files, and run a DOS loader (loadlin or something like = that) OK, here is a little script I used. This assumes that ad0 is your boot = hard drive that you want to clone and that ad1 is the destination drive you = want to copy to. Note, this does _not_ check for any errors #!/bin/sh #blow away all data one ad1 /bin/dd if=3D/dev/zero of=3D/dev/ad1 bs=3D512 count=3D32 # do the fdisk /sbin/fdisk -BI ad1 #create a bootable drive with disk label /sbin/disklabel -w -r -B ad1s1 auto #read in 10g disklable /sbin/disklabel -R ad1s1 /root/10g-disk #load in editor to make sure it looks reasonable and give pause /sbin/disklabel -e ad1s1 #newfs the slices /sbin/newfs /dev/rad1s1a /sbin/newfs /dev/rad1s1e /sbin/newfs /dev/rad1s1f #enable soft updates /sbin/tunefs -n enable ad1s1e /sbin/tunefs -n enable ad1s1f #mount them up=20 /sbin/mount -o async /dev/ad1s1a /mnt-root /sbin/mount /dev/ad1s1e /mnt-var /sbin/mount /dev/ad1s1f /mnt-usr #dump / restore them cd / ; dump -0 -b 600 -f - / | ( cd /mnt-root ; restore -rf - ) cd /usr ; dump -0 -b 600 -f - /usr | ( cd /mnt-usr ; restore -rf - ) cd /var ; dump -0 -b 600 -f - /var | ( cd /mnt-var ; restore -rf - ) The file 10g-disk looks like # /dev/ad1s1: type: unknown disk: amnesiac label:=20 flags: bytes/sector: 512 sectors/track: 63 tracks/cylinder: 16 sectors/cylinder: 1008 cylinders: 19856 sectors/unit: 20015793 rpm: 3600 interleave: 1 trackskew: 0 cylinderskew: 0 headswitch: 0 # milliseconds track-to-track seek: 0 # milliseconds drivedata: 0=20 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 819200 0 4.2BSD 0 0 0 # (Cyl. 0 - 812*) b: 2097152 819200 swap # (Cyl. 812*- 2893*) c: 20015793 0 unused 0 0 # (Cyl. 0 - 19856*) e: 4194304 2916352 4.2BSD 0 0 0 # (Cyl. 2893*- 7054*) f: 12582912 7110656 4.2BSD 0 0 0 # (Cyl. 7054*- 19537*) ---Mike Mike Tancsa (mdtancsa@sentex.net) =09 Sentex Communications Corp, =09 Waterloo, Ontario, Canada "Given enough time, 100 monkeys on 100 routers=20 could setup a national IP network." (KDW2) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message