Publié le: 2013-01-01

Migrate from 7,8 to 9.0

La version 9 de FreeBSD apporte son lot de nouveautés. Elle améliore notamment les performances, la stabilité générale et la sécurité, mais intègre aussi de nouveaux drivers. Mettre à jour le système peut apporter dans certains cas l’incompatibilité de certains services liés à des libraires disparues, ou ayant été renommées. N’oubliez pas de mettre à jour les ports et de les recompiler pour être sûr de la cohérence du système.

Voici le changelog complet (version originale):

  • A new cpuset(2) API has been added for thread to CPU binding and CPU resource grouping and assignment. The cpuset(1) userland utility has been added to allow manipulation of processor sets.
  • The ddb(4) kernel debugger now has an output capture facility. Input and output from ddb(4) can now be captured to a memory buffer for later inspection using sysctl(8) or a textdump. The new capture command controls this feature. [MERGED]
  • The ddb(4) debugger now supports a simple scripting facility, which supports a set of named scripts consisting of a set of ddb(4) commands. These commands can be managed from within ddb(4) or with the use of the new ddb(8) utility. More details can be found in the ddb(4) manual page. [MERGED]
  • The kernel now supports a new textdump format of kernel dumps. A textdump provides higher-level information via mechanically generated/extracted debugging output, rather than a simple memory dump. This facility can be used to generate brief kernel bug reports that are rich in debugging information, but are not dependent on kernel symbol tables or precisely synchronized source code. More information can be found in the textdump(4) manual page. [MERGED]
  • Kernel support for M:N threading has been removed. While the KSE (Kernel Scheduled Entities) project was quite successful in bringing threading to FreeBSD, the M:N approach taken by the KSE library was never developed to its full potential. Backwards compatibility for applications using KSE threading will be provided via libmap.conf(5) for dynamically linked binaries. The FreeBSD Project greatly appreciates the work of Julian Elischer <[](>, Daniel Eischen <[](>, and David Xu <[](> on KSE support.
  • The FreeBSD kernel now exports information about certain kernel features via the kern.features sysctl tree. The feature_present(3) library call provides a convenient interface for user applications to test the presence of features.
  • [amd64] The FreeBSD kernel now has support for large memory page mappings (“superpages”).
  • [amd64, i386, ia64, powerpc] The ULE scheduler is now the default process scheduler in GENERIC kernels. [MERGED]

Changements au niveau du boot loader

  • [amd64, i386] The BTX kernel used by the boot loader has been changed to invoke BIOS routines from real mode. This change makes it possible to boot FreeBSD from USB devices. [MERGED]
  • [amd64, i386] A new gptboot boot loader has been added to support booting from a GPT labeled disk. A new boot command has been added to gpt(8), which makes a GPT disk bootable by writing the required bits of the boot loader, creating a new boot partition if required.

Support Matériel

  • The cmx(4) driver, a driver for Omnikey CardMan 4040 PCMCIA smartcard readers, has been added. [MERGED]
  • The syscons(4) driver now supports Colemak keyboard layout.
  • The uslcom(4) driver, a driver for Silicon Laboratories CP2101/CP2102-based USB serial adapters, has been imported from OpenBSD. [MERGED]

Interfaces réseau

  • The ale(4) driver has been added to provide support for Atheros AR8121/AR8113/AR8114 Gigabit/Fast Ethernet controllers.
  • The em(4) driver has been split into two drivers with some common parts. The em(4) driver will continue to support adapters up to the 82575, as well as new client/desktop adapters. A new igb(4) driver will support new server adapters.
  • The jme(4) driver has been added to provide support for PCIe network adapters based on JMicron JMC250 Gigabit Ethernet and JMC260 Fast Ethernet controllers.
  • The malo(4) driver has been added to provide support for Marvell Libertas 88W8335 based PCI network adapters.
  • The firmware for the mxge(4) driver has been updated from 1.4.25 to 1.4.29.
  • The sf(4) driver has been overhauled to improve its performance and to add support for checksum offloading. It should also work on all architectures.
  • The re(4) driver has been overhauled to fix a number of issues. This driver now has Wake On LAN (WOL) support.
  • The vr(4) driver has been overhauled to fix a number of outstanding issues. It also now works on all architectures.
  • [amd64, i386] The wpi(4) driver has been updated to include a number of stability fixes.

Protocoles réseau

  • The bpf(4) packet filter and capture facility now supports a zero-copy mode of operation, in which buffers are loaned from a user process to the kernel. This feature can be enabled by setting the net.bpf.zerocopy_enable sysctl variable to 1.
  • ISDN4BSD(I4B), netatm, and all related subsystems have been removed due to lack of multi-processor support.
  • A bug in TCP options padding, where the wrong padding bytes were used, has been fixed.

Disques et stockage

  • The aac(4) driver now supports volumes larger than 2TB in size.
  • The ata(4) driver now supports a spindown command for disks; after a configurable amount of time, if no requests have been received for a disk, the disk will be spun down until the next request. The atacontrol(8) utility now supports a spindown command to configure this feature.
  • The hptrr(4) driver has been updated to version 1.2 from Highpoint.

Systèmes de fichiers

  • A problem with using mmap(2) on ZFS filesystems has been fixed.
  • A new kernel-mode NFS lock manager has been added, improving performance and behavior of NFS locking. A new clear_locks(8) command has been added to clear locks held on behalf of an NFS client.
  • The ZFS file system has been upgraded to version 28. Changes include Data Deduplication, Triple parity RAIDZ, and zfs diff.

Changements sur le Userland

  • The adduser(8) utility now supports a -M option to set the mode of a new user’s home directory. [MERGED]
  • BSD-licensed versions of ar(1) and ranlib(1), based on libarchive, have replaced the GNU Binutils versions of these utilities.
  • BSD-licensed versions of bc(1) and dc(1) have replaced their GNU counterparts.
  • chflags(1) now supports a -v flag for verbose output and a -f flag to ignore errors with the same semantics as (for example) chmod(1). [MERGED]
  • For compatibility with other implementations, cp(1) now supports a -a flag, which is equivalent to specifying the -RrP flags.
  • BSD-licensed version of cpio(1) based on libarchive, has replaced the GNU cpio. Note that the GNU cpio is still installed as gcpio.
  • The env(1) program now supports -u _name_ which will completely unset the given variable name by removing it from the environment, instead of just setting it to a null value.
  • The fdopendir(3) library function has been added.
  • The fetch(3) library now support HTTP 1.1 If-Modified-Since behavior. The fetch(1) program now supports -i _filename_ which will only download the specified HTTP URL if the content is newer than filename. [MERGED]
  • find(1) has been enhanced by the addition of a number of primaries that were present in GNU find but not FreeBSD find(1).
  • kgdb(1) now supports a new add-kld command to make it easier to debug crash dumps with kernel modules.
  • The ls(1) program now supports a -D option to specify a date format string to be used with the long format (-l) output.
  • nc(1) now supports a -O switch to disable the use of TCP options.
  • nc(1)’s -o switch has been deprecated. It will be removed in a future release.
  • The ping6(8) utility now returns 2 when the packet transmission was successful but no responses were received (this is the same behavior as ping(8)). It returned a non-zero value before this change.
  • The procstat(1) utility has been added to display detailed information about processes.
  • The realpath(1) utility now supports a -q flag to suppress warnings; it now also accepts multiple paths on its command line.
  • sh(1) a été corrigé et a de nouvelles fonctionalités, et refuse désormais d’interpréter des scripts incorrects. De plus l’auto-complétion a été implémenter dans le style emacs.
  • L’utilitaire split(1) supporte désormais l’option -n afin de séparer un fichiers en un nombre de fragments définis
  • L’utilitaire tar(1) supporte l’option -Z afin d’activer les compressions de type compress(1)-style.
  • L’utilitaire tar(1) supporte l’option --numeric-owner pemettant d’ignorer les noms d’utilisateur/groupes à l’extraction et à la création.
  • L’utilitaire tar(1) supporte désormais l’option -S pour élaguer des fichiers à l’extraction
  • L’utilitaire tar(1) supporte l’option -s flag permettant de substituer des noms de fichiers basés sur une expression régulière.
  • La fonction de librairie tcgetsid(3) a été ajoutée afin de retourner le PGID pour une session utilisateur d’un terminal. Ceci est défini dans la norme IEEE Std 1003.1-2001 (POSIX).
  • top(1) supporte l’option -P afin d’afficher des statistiques par utilisation CPU
  • zdump(8) fonctionne désormais correctement sur des architectures 64 bits
  • traceroute(8) a désormais la capacité d’afficher le numéro d’AS pour chaque saut avec l’option -a. Une nouvelle option -A permet désormais de sélectionner le serveur whois.
  • traceroute6(8) supporte désormais l’option -U pour envoyer des paquets sondes sans protocole de couche supérieure, plutôt que des paquets UDP.

Mise à niveau du système

Mise à jour préalable

Avant de pouvoir passer à la version 9.0 de FreeBSD il va falloir mettre à jour le système actuel. En effet des modifications ont été apportés à la commande freebsd-update qui la rendent incompatible avec la version 9.x.

freebsd-update fetch install

La commande va ensuite inspecter votre système et déterminer comment effectuer la mise à jour et vous notifier des modifications à effectuer. Redémarrez ensuite la machine afin de passer sur le noyau (dans notre cas 8.2-p6).

Maintenant nous pouvons passer à la migration:

freebsd-update -r 9.0-RELEASE upgrade
Looking up mirrors... 4 mirrors found.
Fetching metadata signature for 8.2-RELEASE from done.
Fetching metadata index... done.
Inspecting system... done.

The following components of FreeBSD seem to be installed:
kernel/generic world/base world/dict world/doc world/manpages

The following components of FreeBSD do not seem to be installed:
src/base src/bin src/cddl src/contrib src/crypto src/etc src/games
src/gnu src/include src/krb5 src/lib src/libexec src/release src/rescue
src/sbin src/secure src/share src/sys src/tools src/ubin src/usbin
world/catpages world/games world/info world/proflibs

Does this look reasonable (y/n)? y

Le système vous demande s’il est raisonnable de n’installer que les parties citées. Ceci dépendra surtout de l’installation initiale que vous avez effectuée. Entrez ‘y’ pour valider et passer au téléchargement des fichiers.

Fetching metadata signature for 9.0-RELEASE from done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done.
Fetching files from 8.2-RELEASE for merging... done.
Preparing to download files... done.
Fetching 8581 patches.....10...[résultat omis]
Applying patches... done.
Fetching 1915 files...
Attempting to automatically merge changes in files... done.

The following changes, which occurred between FreeBSD 8.2-RELEASE and
FreeBSD 9.0-RELEASE have been merged into /etc/crontab:
--- current version
+++ new version
@@ -1,8 +1,8 @@
 # /etc/crontab - root's crontab for FreeBSD
-# $FreeBSD: src/etc/crontab,v 2010/12/21 17:09:25 kensmith Exp $
+# $FreeBSD: release/9.0.0/etc/crontab 194170 2009-06-14 06:37:19Z brian $
 #minute        hour    mday    month   wday    who     command
Does this look reasonable (y/n)? y

L’outil va ensuite vous demander si les modifications sur les fichiers qu’il va présenter sont correctes. En général oui, mais il vaut mieux vérifier, et pour terminer vous présenter la liste des fichiers qu’il va modifier.

The following files will be removed as part of updating to 9.0-RELEASE-p0:
[résultat omis]
--More--(byte 810)
The following files will be added as part of updating to 9.0-RELEASE-p0:
[résultat omis]
--More--(byte 891)
The following files will be updated as part of updating to 9.0-RELEASE-p0:
[résultat omis]

Tout devrait être correct vous pouvez donc quitter, ou bien vérifier la liste des modifications si vous avez modifié le système. Maintenant appliquez l’upgrade.

freebsd-update -r 9.0-RELEASE install
Installing updates...rmdir: ///boot/kernel: Directory not empty

Kernel updates have been installed.  Please reboot and run
"/usr/sbin/freebsd-update install" again to finish installing updates.

Vous pouvez ensuite redémarrer sans problème afin que le noyau 9.0 soit appliqué. Il faut désormais installer la partie userland, réitérez la commande. Ici nous voyons également que le noyau est bien en 9.0-RELEASE, comme effectué.

# uname -a
FreeBSD SquidBSD.bc1.groupe-ppa.local 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:15:25 UTC 2012  i386
# freebsd-update install
Installing updates...
Completing this upgrade requires removing old shared object files.
Please rebuild all installed 3rd party software (e.g., programs
installed from the ports tree) and then run "/usr/sbin/freebsd-update install"
again to finish installing updates.

Maintenant que le userland est à jour, il serait judicieux de réinstaller les services que vous avez activés afin qu’ils soient cohérents avec le système. Une fois ceci effectué, retapez la commande freebsd-update install pour terminer l’installation.

Note: la migration a été faite sur un système utilisant squid, havp et clamd et il n’a pas été nécessaire de recompiler les services pour qu’ils fonctionnent.

Voilà ! vous savez désormais comment migrer de FreeBSD 8.x et 7.x vers la version 9.0. Je vous suggère de vous mettre à jour surtout si vous virtualisez des FreeBSD, car il y a des mises à jour de performances importantes permettant d’économiser de la puissance CPU et RAM à votre serveur de virtualisation.