DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Installation and Upgrading

OpenBSD Installation and Upgrading Installing and upgrading OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 28th August 2016
shep shep is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,070
Default Planning 5.9 -> 6.0 upgrade

The 5.9 -> 6.0 upgrade procedure looks less involved than prior releases. In my case it looks like just the w^x amendment to the fstab and moving the lpd spooling directories. The only firmware I use is for radeon video.

In the past I always did a new install and restored my /home directory from a backup tar.gz. My experience upgrading is based strictly on following current.

My question is upgrading the packages. The two options I'm mulling over are
1) Generate list of index packages. Backup /home and configuration. Upgrade base. Disable xdm. Reboot into console. Delete all packages and install from the list.
2) Generate list of index packages. Backup /home and configuration. Disable xdm, reboot into console, and try to upgrade the packages.

I have seen prior posts with problems upgrading packages between releases. Is it worth trying?

Will the firmware update with the new base install or should I delete radeondrm-firmware-20150927 and reinstall to be safe? The upgrade guide indicates that only the iwn firmware is an issue.

A second question: Is there any value to reformating the disk in regards bad sectors, etc.?

Last edited by shep; 28th August 2016 at 10:45 PM. Reason: grammer
Reply With Quote
  #2   (View Single Post)  
Old 28th August 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,981
Default

Generally, when you upgrade, you need only # pkg_add -u after you have rebooted. All prior libraries are retained, so in most cases the older applications will continue to function, and once applications have been updated you can # pkg_delete -a to remove old libraries that have been updated and now are no longer required. These will have been renamed to .lib* in the package database in /var/db/pkg. Along with old libraries, that will also remove old unneeded dependencies.

On extremely rare occasions, there are API changes that prohibit this. You'll see this noted in the Upgrade Guide, with specific steps to take. As an example of this rare occurrence see the OpenBSD Upgrade Guide: 5.4 to 5.5. From memory, this was the second significant API change since the Project was initiated -- the first was the transition to ELF binaries.
Reply With Quote
  #3   (View Single Post)  
Old 28th August 2016
ibara's Avatar
ibara ibara is online now
WR Slowest SNOBOL4 laptop
 
Join Date: Jan 2014
Posts: 523
Default

Quote:
Originally Posted by shep View Post
My question is upgrading the packages. The two options I'm mulling over are
1) Generate list of index packages. Backup /home and configuration. Upgrade base. Disable xdm. Reboot into console. Delete all packages and install from the list.
2) Generate list of index packages. Backup /home and configuration. Disable xdm, reboot into console, and try to upgrade the packages.
Generally I tend to think that one should upgrade based on what they're experienced with unless there's a good reason to otherwise. You might even consider upgrading from release to release as you would -current snapshots (unless of course you have a good reason to do otherwise, but it wasn't clear to me if you do or don't based on your post).

Either way, as jggimi mentioned the only thing you have to actually do is # pkg_add -u && pkg_delete -a.

For the record, the above is essentially what we do at Devio.us and we've upgraded from 4.7 to (soon) 6.0 all on one machine, one release at a time. So I know the pkg_add solution works.

Quote:
Originally Posted by shep View Post
A second question: Is there any value to reformating the disk in regards bad sectors, etc.?
Sadly no. Hard drives do what they do and have firmware to deal with those things.

Quote:
Originally Posted by shep View Post
I have seen prior posts with problems upgrading packages between releases. Is it worth trying?
Yes. Do it. It's the recommended strategy for upgrading packages.

Quote:
Originally Posted by shep View Post
Will the firmware update with the new base install or should I delete radeondrm-firmware-20150927 and reinstall to be safe? The upgrade guide indicates that only the iwn firmware is an issue.
fw_update is essentially a wrapper around pkg_add. OpenBSD effectively treats firmware as packages.
Reply With Quote
  #4   (View Single Post)  
Old 29th August 2016
shep shep is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,070
Default

Another upgrade planning question has come up. In the past, I patch/compile the security upgrades for base while using M:tier for package upates. Previously I utilized src.tar.gz, sys.tar.gz and xenocara.tar.gz to populate my build directories. If I recall correctly, after a base install, /usr/src is not completely empty. Is cvs a better way to update the build directories rather than just overwriting the 5.9 /usr/src directory?
Reply With Quote
  #5   (View Single Post)  
Old 29th August 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,981
Default

Quote:
Originally Posted by shep View Post
... If I recall correctly, after a base install, /usr/src is not completely empty.
If I recall correctly, there is a symbolic link from /sys to /usr/src/sys but the /usr/src directory itself is empty.
Quote:
Is cvs a better way to update the build directories rather than just overwriting the 5.9 /usr/src directory?
If you are planning on building -stable, you would use CVS to update source trees. If you are planning on -release+errata, use the -release source tarballs, because using CVS would add unnecessary load on a CVS mirror.
Reply With Quote
  #6   (View Single Post)  
Old 29th August 2016
shep shep is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,070
Default

The FAQ use to address extracting -release source tarballs to /usr/src. At this time, all I see in the FAQ is using CVS to obtain source.

I do plan on running release+errata which confusingly the FAQ describes as -stable (not to nitpick but to avoid future readers having a problem).
FAQ Quote
Quote:
There are three flavors of OpenBSD:
-release: The version of OpenBSD shipped every six months on CD and the mirrors.
-stable: The -stable branch is -release plus patches found on the errata page.
When very important fixes are made to -current, they are backported into the two supported -stable branches.

-current: The -current branch is where active development work is done.
Every six months, -current is tagged and becomes the next -release: a frozen point in the history of the source tree.
.

At this time I'll plan on deleting /usr/src/*, extracting the sys/src tarballs and relinking /sys prior to applying any patches
Reply With Quote
  #7   (View Single Post)  
Old 29th August 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,981
Default

-stable includes all published errata patches, and may also include additional unpublished patches. (Actually, these patches are published, but in CVS commit logs only.)

You need not worry about the /sys link, that link is in your root directory, not in /usr/src.
Reply With Quote
  #8   (View Single Post)  
Old 10th September 2016
sacman08 sacman08 is offline
New User
 
Join Date: Sep 2010
Posts: 8
Default configuration backup?

Quote:
Originally Posted by shep View Post
In the past I always did a new install and restored my /home directory from a backup tar.gz.
...Backup /home and configuration. Upgrade base. ...
I was just wondering about this statement from shep. I have always done my /home with a tarball, but how do I backup my configuration in OpenBSD? All profile specific files should in the /home tarball and all pkg_info should be in the pkg database correct? What configurations would these be?
Reply With Quote
  #9   (View Single Post)  
Old 10th September 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,981
Default

Configurations for OpenBSD are generally stored in two places:
  • /etc/
  • /var/
The /var/ structures include the installed package metadata (/var/db/pkg/), along with many others, such as accounting, mail, cron, print spool, DNS, web server, DHCP leases ... it is a very large list of possible uses. /var/ is also the location that most third party applications store data that is not user-specific.

The package database isn't directly useful without a matching, synchronized set of installed packages. A full system backup, therefore, should include /usr/local/ as well as /var/.

----

But if you just want to be able to reinstall previously installed 3rd party packages, a simple list of all manually installed packages is all that is needed to install them, such as: $ pkg_info -qm > my.list.of.packages. Restoration is simply # pkg_add -l my.list.of.packages. If you happen to be transitioning between releases, you can add the -z option to the pkg_add(1) command.

See the pkg_add(1) and pkg_info(1) man pages for more details.

Last edited by jggimi; 10th September 2016 at 02:21 PM. Reason: clarity
Reply With Quote
Old 10th September 2016
sacman08 sacman08 is offline
New User
 
Join Date: Sep 2010
Posts: 8
Default

Good to know Jggimi... Thank you for the information.
Reply With Quote
Old 11th September 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,981
Default

Just in case it helps someone think it through, here is my general procedure for upgrading from one release to the next. I happen to upgrade my servers from -stable to -stable, but the procedure would be the same, except I point to a local webserver for kernels and filesets during the upgrade, rather than to -release on a nearby mirror.

I take full backups before each upgrade, but that is for rapid restore convenience in the event of any possible problem with an upgraded system. These backups are separate from my normal operational backups of these same servers.
  1. Bring a server down completely. I typically do this by dropping to single-user mode, or booting into single-user mode.
  2. Take a full system backup.

    I happen to do this over a local, private and secure network, piping the output of dump(8) through nc(1) to a local backup server.

    Should I ever need to restore that backup, I would boot the bsd.rd RAMDISK kernel, and restore the data from the backup server, over the same private and secure network. I would use httpd(8) on the backup server, with ftp(1) piping output to restore(8) in the RAMDISK's shell.
  3. Upgrade, following the published Upgrade Guide.
  4. Update all packages with # pkg_add -u
  5. Delete all old, outdated dependencies and old, unused package libraries with # pkg_delete -a
  6. Test test test.
  7. Return the system to production use.

Last edited by jggimi; 11th September 2016 at 12:34 AM. Reason: typos, clarity
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PF Upgrade to 5.8 Roedy OpenBSD Security 2 20th March 2016 10:15 PM
upgrade from 4.8 to 5.3 polken OpenBSD Installation and Upgrading 6 30th May 2013 05:41 AM
6.1 RC upgrade climby FreeBSD Installation and Upgrading 2 30th September 2010 12:51 PM
Backup strategies and disaster planning sherekhan OpenBSD General 16 2nd June 2009 10:30 PM
upgrade from 5.5 to 6.3 keithlybsd FreeBSD Installation and Upgrading 9 27th May 2008 06:21 PM


All times are GMT. The time now is 04:51 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick