Subject: Re: HowTo move NetBSD 2.0.2 from larger to smaller HardDisk?
To: None <netbsd-help@netbsd.org>
From: Martijn van Buul <martijnb@atlas.ipv6.stack.nl>
List: netbsd-help
Date: 07/19/2005 09:25:39
It occurred to me that bsd.petr@seznam.cz wrote in gmane.os.netbsd.help:
> Thanks for above link. I have a idea. Is it possible way tu resize UFS 
> partition without data-loss to a smaller (equal or lower then 1.2 GB) 
> size (which program or command can do it)? And then use g4u for cloning 
> HDD?

By far the easiest solution would be to reduce the disk usage on your
existing harddisk, untill it would fit, mount the 1.2 GB disk in addition
to your existing disk, make new partitions, and copy it all over. Possibly
using dump/restor, or just a tar pipe. (I'm not a big fan of using dump/restor)

> But i'm afraid that standard instalation of NetBSD 2.0.2 create 
> more then one partiton (e.g. /boot, /, SWAP) 

NetBSD doesn't have a /boot partition.

> and if I resize the "/" partition, SWAP partition will be still behind the
> 1.2 GB limit of my new HDD.

Well then; you'll just have to take swap into consideration then..

> Yes but I installed only a few packakges as i need. I think which 
> unneeded folders from NetBSD 2.0.2 installation i can delete and this 
> operation do NOT harm the operating system. (Now my partiton with NetBSD 
> occuping 1.45 GB and i have to reduce it.)

It all depends on what you consider to be "harming the OS". If you don't need
X, you can safely remove /usr/X11R6. If you aren't planning on building from
source, /usr/src can go to the cylindrical archive as well. /usr/pkgsrc
isn't needed for "normal" operations. It all depends on what you want to
do, and what other computers you have in your network. If you have one 
which can host an NFS server, and which has plenty of diskspace, it would
be a neat idea to have /usr/src and /usr/pkgsrc mounted over NFS, for instance.

> After migrate process how can I create corresponding swap on the end of 
> disk on new 1.2 GB HDD?

You don't do that *after* your migrate process, it's one of the first
steps; when partitioning your disk, you'll have to set aside space for
swap!

> PS: Im newbie in BSD world. I using M$ on desktop and a little linux on 
> students servers. But one of theese serveres have something bad on 
> motherboard and NetBSD is only one stable system on this hardware 

Ditch it, if you can afford doing so. You're going to regret using it if
it'll result in losing data.