NetBSD-Users archive

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

Re: Upgrading NetBSD in-place in a clean way

On 1/12/11 5:24 PM, Stefano Marinelli wrote:
Ok, let's suppose I want to upgrade a NetBSD machine without
rebooting with sysinst and without having the possibility to use the script with the sources. I'd do something like that: 1)
download the daily (stable, for example) binaries (for example from 2) Untar all
the sets on the file system I want to update 3) run etcupdate 4)

Tried that in a test virtual machine and seems to work. But there's a
problem: what if something has been removed? Untarring the sets
doesn't remove the (stale) old files, while the etcupdate just deals
with the config and startup files. Is there a cleaner way to do it?

Thank you! Stefano

Here's my procedure. I'm typing these out from memory so don't copy/paste!

  # cd /
  # mv netbsd netbsd.old
  # ftp -o "|pax -zrvpe" ftp://ftp.server.tld/path/to/sets/kern-GENERIC.tgz

  # shutdown -r now

    << if the system comes back up[1] >>

  # cd /
  # ls /etc/mtree/set.* | sed 's/.*set\.//' | while read s ;do
  >   [ "$s" != "etc" ] && {
  >     ftp -o "|pax -zrvpe " ftp://ftp.server.tld/path/to/sets/${s}.tgz
  >   }
  > done

  # cd /tmp && ftp ftp://ftp.server.tld/path/to/sets/etc.tgz
  # etcupdate -s /tmp/etc.tgz

Now run postinstall as etcupdate instructed, then reboot.

Also - I don't use any of the x... sets so beware the xetc set as we do with the etc one.

You may have to update boot blocks with installboot(8). You may want to look at boot.cfg(5), depending on what system you're upgrading from.

Old packages should continue to work. To update packages look at pkg_chk, pkgin and pkg_rolling-replace. pkg_comp is also very useful for building packages in a sandbox.

This has been my method since netbsd-1.6.


[1] if the system doesn't come back up you have to use "boot netbsd.old" at the boot prompt, then figure out what is needed.

Home | Main Index | Thread Index | Old Index