NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Installing NetBSD "over" foreign systems (FreeBSD, Linux, etc.)


On Jun 4, 2011, at 10:41 AM, Thor Lancelot Simon wrote:

On Sat, Jun 04, 2011 at 07:00:10AM -0700, Scrap Happy wrote:
On 6/4/2011 4:14 AM, Thor Lancelot Simon wrote:
On Fri, Jun 03, 2011 at 08:31:13PM -0400, Al Zick wrote:

I want to install NetBSD on a FreeBSD 7 (intel dual-core) system
without physical access to the server. At one time, I though that
FreeBSD used the same filesystem as NetBSD. Can someone tell me if
that is still true or is there away to create a NetBSD filesystem
from FreeBSD? Also, is there a how to on this kind of install

Do you have any unpartitioned or spare space on your FreeBSD
system?  If so, I can guide you through a procedure that is
far from simple, but will work.  If not, I think you will need
to find a way to boot from the network or from installation media
to get your install going.

Even if there isn't "spare" space, (since you have root) you can
possibly clear off *one* "partition"/slice (e.g., if there is a
separate /var, unmount it and let writes to /var go to /var's
mount point, instead (on the root filesystem) while you create
a NetBSD root using the disk real estate that the FBSD /var
had preciously used.

That's not as easy as it sounds, since NetBSD and FreeBSD can't
reliably write each others' filesystems and neither boot blocks
can load kernels from the "foreign" filesystem format.  It is
possible (though not pleasant) to build FreeBSD executables for
the NetBSD partitioning and installation utilities by running
the NetBSD system build on an appropriate FreeBSD system.  That's
one way to make forward progress.

Something could also probably be done using GRUB.

However, a much better way is to use a FAT filesystem as an
intermediary.  Repartition the disk (at the MBR level) using
FreeBSD's tools.  Then build a FAT filesystem with FreeBSD's
newfs_msdos, but use the *NetBSD* bootxx_fat16 boot loader
as the partition primary bootstrap (there is an option to
newfs_msdos that will allow this).  Mount the partition from
FreeBSD and copy onto it:

        1) The NetBSD "boot" secondary boot loader.
        2) A NetBSD kernel
        3) A miniroot.gz filesystem image with suitable NetBSD
           installation environment (the one from the NetBSD
           CDROM build process will likely work).
        4) A boot.cfg file like this;

                menu=Install NetBSD:load /miniroot.gz; boot netbsd.gz

Unmount the FAT filesystem, use the FreeBSD partitioning utility to
mark it active, reboot the system.

Now you've either wrecked your machine beyond all hope, or you can
proceed to install NetBSD in the normal way.


P.S. This basic procedure will work starting from any system which
     can read/write FAT16 filesystems and manipulate MBR partition
     tables.  So it can be used to install NetBSD over Linux, DOS,
     Windows, FreeBSD, Solaris, etc..  The hard part is finding
     or making enough _contiguous_ space for an extra MBR partition
     to hold the NetBSD kernel, boot loader, and miniroot, but once
     that is done, wreck your system to your heart's content!

Thank you, this is very helpful. In using this method, will I be able to resize the partitions? Would netbooting be better?


Home | Main Index | Thread Index | Old Index