*BSD News Article 81569


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!howland.erols.net!news-peer.gsl.net!news.gsl.net!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: moving FreeBSD to a new Hard Drive?
Date: 25 Oct 1996 21:28:16 GMT
Organization: Private BSD site, Dresden
Lines: 39
Message-ID: <54rbdg$9ta@uriah.heep.sax.de>
References: <54c4ag$4ob@apakabar.cc.columbia.edu>
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

jyc3@merhaba.cc.columbia.edu (James Y Cho) wrote:

> Hello.  I'd like to move my FreeBSD from its current 200M drive
> to a partition in a new 2G drive, without having to re-install
> and re-config everything.  (I have no physical space  to just
> add-and-mount the new drive, sadly).  Has anyone done this easily?
> I was thinking of doing a minimal install on the new drive,
> and then copying everything over (kernel and all) but I'm sure
> somewhere something is configured to the actual geometry of the
> old drive, so I'd have to be very careful...  Any ideas would be
> appreciated.

The geometry values are recorded in the disklabel, and the label
itself lives in front of the filesystem space.  Your new (minimal)
installation has to create a label anyway as the first step, thus the
new geometry will be already in place.  By copying the files one file
system at a time, it should fly.  (Using a piped combination of
dump/restore is IMHO the safest method for this, btw.)

Alternatively, if you know how to handle all the disklabel and newfs
stuff manually, you can simply plug in the disk, create the file-
systems, move the contents, and then replace the old disk.  The basic
description for the disklabel and filesystem stuff is also in the
handbook.  It's not as nice as using sysinstall, but for people who
are used to this method, it's certainly faster than a partial
reinstallation.

Be careful that the old and new disk partition names in /etc/fstab are
the same.  Otherwise, after clobbering your new fstab with the old
one, you might be hosed at the next reboot.  (Ok, you can still go
single-user, mount the root f/s read/write, and use /bin/ed to correct
/etc/fstab...  But most people certainly won't prefer using ed. :)

-- 
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. ;-)