*BSD News Article 71778


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mira.net.au!news.mel.connect.com.au!news.syd.connect.com.au!news.bri.connect.com.au!corolla.OntheNet.com.au!news
From: Tony Griffiths <tonyg@onthenet.com.au>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Tranfer of system
Date: Sun, 23 Jun 1996 16:44:51 +1000
Organization: Network Technologies P/L
Lines: 43
Message-ID: <31CCE7E3.41C6@onthenet.com.au>
References: <4qh8i6$ot3@ustsu10.ust.hk>
NNTP-Posting-Host: pulsar.nt.com.au
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Mailer: Mozilla 2.0 (X11; I; OSF1 V3.2 alpha)
To: Allo Hui <ee_allo@uxmail.ust.hk>

Allo Hui wrote:
> 
> Hi all,
> 
> I have a FreeBSD system in a 1G harddisk. Now, I want to transfer
> the whole system to a 2G harddisk. Any easy method to tranfer the whole
> system tso that I have no need to setup and configure the whole system
> again??
> 
> --
>   Hui Shun Chau, Allo   [ ³\¦Ä¦à ]        |  ee_allo@uxmail.ust.hk

You will need to transfer each 'file system' by itself.  Once the new 2G
drive has valid MBR/Partition table information, you will need to newfs
say a root and /usr partition, fsck them and then use dump/restore to
transfer the data.  Eg. (assuming that the new disk is initially wd1 and
the current disk is wd0)-

# newfs /dev/rwd1a		<-- this is the new / partition
# newfs /dev/rwd1e		<-- this is the new /usr partition
# fsck /dev/rwd1a
# fsck /dev/rwd1e
# mount /dev/wd1a /mnt
# dump 0f - / | (cd /mnt; restore xf -)
# umount /mnt
# mount /dev/wd1e /mnt
# dump 0f - /dev/rwd0e | (cd /mnt; restore xf -)
# umount /mnt

You should probably fsck the partitions again and now you can remove the
1G drive, install the 2G in it's place and boot and you are away.

Note that there are *many* options to newfs (-b, -f, -i are the main
ones).  I would probably use -b 8192 -f 2048 -i 8192 assuming a 32Mb /
partition and possibly bigger numbers for the /usr partition, especially
if it covers the remainder of the 2G drive minus the swap partition.

Depending on whether the 2G drive has been used with some other OS it
may or may not need fdisk meddling.  It will almost certainly need
running disklabel on which might require you to edit an entry into
/etc/disktab!

Tony