Subject: Re: Upgrading (replacing) hard drive
To: Anthony Lieuallen <arantius@yahoo.com>
From: Phil Reynolds <phil@tinsleyviaduct.com>
List: netbsd-help
Date: 09/26/2001 04:03:03
On Tue, Sep 25, 2001 at 06:58:28PM -0700, Anthony Lieuallen wrote:
> Hi, my internet router/server is running on a tiny little 428 meg hard
> drive, and an otherwise unsed 6gb drive has just fallen into my hands,
> so I've decided to give it some room for other files.
> 
> What might be the right procedure to correctly copy the existing NetBSD
> (1.5.1) system to the new drive and then boot from it as if nothing
> happend (besides the drive growing many times in size :) )?

I haven't done this on NetBSD, but I did it on FreeBSD once, so the procedure
should be similar.

I'd start, naturally enough, by installing the new disk in the system as a
second disk. You may well need to inform the BIOS Setup program.

Log in as root (or use su -) and umount any remote partitions you don't need,
and any local but non-NetBSD partitions.

Slice and partition the new disk as you want it, remembering the conventions
NetBSD sets on the use of partitions. Install the boot loader on the new disk
if you can. I haven't got my NetBSD box up at present so I can't refer to it,
but I'm sure other people will be able to help you. Remember that a slice
needs to be bootable.

Create a directory, /newdisk, on the old disk.

Create the file systems in the partitions on the new disk, and mount them,
in such a way that the new root is the current /newdisk, so the new /usr will
be on /newdisk/usr, for example.

Create the directory /newdisk/proc, but do not copy its contents.

If you cp -R all directories from the old disk to /newdisk (but not /newdisk
itself, of course), and cp all files in the root directory to /newdisk, and
also add mount points for any remote file systems or other kinds of local
file systems to the new disk, you should be well on the way.

Modify /newdisk/etc/fstab so that it will reflect the situation when the new
disk is the only one. Remember the entry for the swap partition. The chances
are this will be OK unless any slice, partition or mount point details have
changed.

Shut down the system, remove the old disk, configure the new disk and BIOS to
reflect the changes.

Start the system. If all goes well, you have successfully upgraded your hard
disk.

-- 
Phil Reynolds
 o  ____ Internet: phil@tinsleyviaduct.com
|L_ \  / Web: http://www.tinsleyviaduct.com/phil/
(_)- \/  Waltham 67, Emley Moor 69, Droitwich 79, Windows 95