*BSD News Article 98118


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.mira.net.au!news.netspace.net.au!news.mel.connect.com.au!munnari.OZ.AU!uunet!in3.uu.net!206.154.70.8!news.webspan.net!feed1.news.erols.com!cpk-news-hub1.bbnplanet.com!cam-news-hub1.bbnplanet.com!news.bbnplanet.com!news.mathworks.com!fu-berlin.de!irz401!orion.sax.de!uriah.heep!news
From: j@uriah.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Help: Relocating FreeBSD installation
Date: 20 Jun 1997 06:59:57 GMT
Organization: Private BSD site, Dresden
Lines: 44
Message-ID: <5od9pd$594@uriah.heep.sax.de>
References: <5oa3dv$313@news.interlog.com>
Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch)
NNTP-Posting-Host: localhost.heep.sax.de
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: knews 0.9.6
X-Phone: +49-351-2012 669
X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F  93 21 E0 7D F9 12 D6 4E
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:43232

Patrick McConnell <patrick@patrick.interlog.com> wrote:

> I have FreeBSD 2.2.2 installed on my primary slave IDE drive. I've
> installed a new drive as primary master, and I want to move the FreeBSD
> installation to the new drive. Is there an easy way to do this, or would I
> be best to just reinstall?  ...FreeBSD is the only OS, so I don't need to
> worry about partitions, boot managers, etc.

In this case, do it by:

disklabel -Brw wd0 auto
disklabel -e wd0	# edit the partition sizes as you need
for filesys in a g h	# use your actual partition letters here
do
	newfs /dev/rwd0$filesys
done
mount /dev/wd0a /mnt
mkdir /mnt/usr
mkdir /mnt/var
mount /dev/wd0$whatever /mnt/usr
mount /dev/wd0$whatever /mnt/var
# more partitions as you need
cd /mnt
dump 0f - / | restore xvf -
cd usr
dump 0f - /usr | restore xvf -
cd ../var
dump 0f - /var | restore xvf -


I hope you get the picture...  This should do it.

Btw., if both disks are exactly same (or the new wd0 is larger, but
you wanna pretend it being same), this will also do:

	dd if=/dev/rwd1 of=/dev/rwd0 bs=64k

This makes an exact mirror copy.
-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)