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 23, 2013, at 3:26 PM, Andrew Smallshaw wrote:

On Sun, Mar 17, 2013 at 06:17:32PM -0400, Al wrote:

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?

There are various ways of doing this of differing degrees of peril
so a little more background would be useful.  What out of band
managment do you have in any?  i.e. do you have a serial console
or IP KVM?  What kind of machine is it and does it have any lights-out
management toys?  If you do have at least a remote console of
whatever description I'd be thinking in terms of installing a
install image of some description to a spare partition (e.g. your
swap slice).

It does not have a serial console, IP KVM, or lights-out management.

If your only way of controlling the machine is over the network
into the machine itself you are probably looking at some form of
in-place sleight of hand and treading on eggshells since one little
mistake can easily lose your network connectivity and ability to
control the machine with it.  That doesn't make it impossible but
it does mean everything needs double checking and ideally testing
on a local machine before you do it.

It looks like this is the only way to do it. I tested it on a local machine and I was able to do what looks like a fresh install of NetBSD 5.1.2 on a NetBSD 6 system by untarring the kernel, base.tgz, and etc.tgz on an nfs. I then updated the etc files, then "cd /mnt/ dev' ran '/bin/sh MAKEDEV all'. After that I ran 'find . -exec touch - u -t todays date {}\;'. I then tarred it. I then went on to the old install and ran 'find . -exec touch -u -t 20091212000000 {} \;'. and untarred that file in /. After that I did 'find / -mtime 2 -delete' I then ran 'pwd_mkdb -p /etc/master' and ran '/bin/sh MAKEDEV all' again this time in /dev. I then rebooted into NetBSD 5.1.2 and was able to ssh in. I must say that it is sure a risky way to do it, and could end in an unusable system.

Best Regards,

Home | Main Index | Thread Index | Old Index