NetBSD-Users archive

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

Re: Is it possible to chroot and then install NetBSD to the boot drive


On Mar 17, 2013, at 6:57 PM, Greg Troxel wrote:

Al <> writes:

What I would like to be able to do is do an install on either another
drive or on an NFS partition. Then chroot to it and then delete the
files that are on /, /var, and /usr and then do a clean install of
NetBSD. Is this possible? If it is, could someone give me a how to on
doing something like this?

chrooting will be awkward, because once you chroot then you will be
running the binaries from the new install, which only works if your host system is compatible (NetBSD, same or later, more or less). And if you
remove files, you won't be able to run new commands.

However, you don't need to chroot.  If you take a new drive, and
fdisk/disklabel it, and mount it, and then unpack the sets, and then
install bootblocks, it should work. You didn't mention, but if you mean
i386, then bootblocks consists of installboot for bootxx_ffsv1
(probably) and also /boot, plus mbr boot records. If the host is NetBSD
you can just use installboot and cp, pointing to /usr/mdec in the new

I have done something similar a number of times, basically moving a
system from old disks to new (bigger, less aged and in theory more
reliable) disks. So instead of unpacking sets, I have done dump/ restore
or rsync from old to new (under /mnt) and then installed bootblocks.

I have a system that I sent new drives out to the data center not that long ago. I did a new install of NetBSD on them, but then I decided to update to NetBSD 6.0. In the process, I broke some things. Now the system is not very usable. I can get another hard drive and install NetBSD on it and then send them that drive, but someone at the data center will need to swap out the drive again. I don't see how I could netboot this system and it is not real easy to tell it to boot from another drive or partition, so I thought that there might be some way to setup a root filesystem much like you do when you netboot. Temporarily mount this partition to run make dev files, then switch over to it, and unmount /home, /var, /usr, and finely /. Run newfs on the old /, /var, and /usr. Mount / as /mnt, then /var as / mnt/var and /usr as /mnt/usr. Then cd to /mnt and untar a working install that I did on a test box that has the exact same config as this system, so that everything will be right in /etc. Is there any way to do this?


Home | Main Index | Thread Index | Old Index