Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Nov 1995 13:56:57 -0800 (PST)
From:      bmk@dtr.com
To:        smm@uunet.uu.net (Steve Mansfield)
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Problems with new drive
Message-ID:  <199511162156.NAA05055@dtr.com>
In-Reply-To: <QQzqdn07550.199511162048@triryche.uu.net> from "Steve Mansfield" at Nov 16, 95 03:48:38 pm

next in thread | previous in thread | raw e-mail | index | archive | help

> I have a system with freebsd installed.  I acquired a new, larger drive and 
> I'm trying to do two things:

I assume that you're going to want to replace the old drive with the new
one.  Or that you'll want to install the new drive as drive 0, and the
old as drive 1.

There isn't really a cookbook procedure to do this - it depends a lot on
how your disk is laid out and what type of hardware you have.  I can be
of a lot more assistance if you can give some more details.  I'll give
you the general procedure below.

You'll need to understand how FreeBSD handles slices, partitions, and
filesystems.  The fdisk(8) and disklabel(8) man pages will be a good
start.  If you can't figure out how to do it from the instructions I'm
about to give you, you will probably be better off seeking professional
assistance.  That is, unless you are an adventurous sort who doesn't
mind cleaning up after potentially destructive mistakes.

BE WARNED.  IF YOU DON'T UNDERSTAND EACH AND EVERY STEP YOU CAN
POTENTIALLY WIPE OUT YOUR DATA.

Don't say I didn't warn you. :)

> 1) Move everything to the new drive without having to re-install freebsd
> entirely.  This includes the ability to boot.

> 2) Make the new drive also boot dos as well.  I need to understand how to
> install a boot manager for this.

What I do is this - temporarily install the new drive as drive 1.  You
didn't say if it's IDE or SCSI, so I'm going to have to be a bit vague
on this.

After the drive is physically installed, boot DOS and create a DOS
partition.  Make the DOS partition the active partition.  Format the
drive with the /s option.  Copy all of your existing DOS stuff to it.

Boot FreeBSD to single-user off of your old drive.  Create a FreeBSD slice
using fdisk.   Leave the DOS partition as the active (boot) partition.
You'll need to boot it later.

Use disklabel to put a disklabel on your new FreeBSD slice - at least
create BSD partitions that correspond to your existing ones, plus any
additional that you'd like.

Use newfs to create filesystems on the new partitions.

You can transfer all of the data from existing partitions to new ones
using the following as an example:

# copy root (/dev/sd0a) to /dev/sd1a
newfs /dev/rsd1a
mount /dev/sd1a /mnt
dump 0f - /dev/sd0a | ( cd /mnt ; restore rf - )

# copy /usr (/dev/sd0f) to /dev/sd1f
newfs /dev/rsd1f
mount /dev/sd1f /mnt/usr
dump 0f - /dev/sd0f | ( cd /mnt/usr ; restore rf - )

You will need to edit /mnt/etc/fstab to make adjustments.

Shut the system down, power off, physically install the new drive as
drive 0.  If you've managed to get this far without destroying the data
on your old drive, leave it out - just in case. :)

Boot DOS off the new drive.  Install the boot manager of your choice.  The
default FreeBSD boot manager (Booteasy) can be found on the 2.0.5 cdrom
in /tools/bootinst.exe.

You should be able to boot either FreeBSD or DOS off of your new drive.

When you're satisfied with the results, you can either reinstall your
old drive as drive 1, or dispose of it as you wish.  I find that old
drives make _great_ bookends. :)



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