Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Aug 2001 18:42:59 -0400
From:      Mike Tancsa <mike@sentex.net>
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?
Message-ID:  <jltlntgdlclsqj1e1h2am1oul76nvimgd7@4ax.com>
In-Reply-To: <SEN.997827632.101649875@news.sentex.net>
References:  <SEN.997827632.101649875@news.sentex.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?jltlntgdlclsqj1e1h2am1oul76nvimgd7>