Guide d'administration Oracle Solaris ZFS

Utilisation d'Oracle Solaris Live Upgrade pour migrer vers un système de fichiers racine ZFS (sans zones)

Les exemples suivants illustrent la procédure de migration d'un système de fichiers racine UFS vers un système de fichiers racine ZFS.

Si vous migrez un système comportant des zones ou effectuez sa mise à jour, reportez-vous aux sections suivantes :


Exemple 5–3 Utilisation d'Oracle Solaris Live Upgrade pour migrer d'un système de fichiers racine UFS vers un système de fichiers racine ZFS

L'exemple suivant illustre la procédure de création d'un environnement d'initialisation d'un système de fichiers racine ZFS à partir d'un système de fichiers racine UFS. L'environnement d'initialisation actuel, ufsBE, qui contient un système de fichiers racine UFS, est identifié par l'option -c. Si vous n'incluez pas l'option -c, le nom actuel de l'environnement d'initialisation sera par défaut le nom du périphérique. Le nouvel environnement d'initialisation, zfsBE, est identifié par l'option -n. L'utilisation de la commande lucreate requiert l'existence préalable d'un pool de stockage ZFS .

Pour pouvoir mettre à niveau et initialiser le pool de stockage ZFS, vous devez le créer avec des tranches plutôt que des disques entiers. Avant de créer le nouveau pool, assurez-vous que les disques à utiliser dans le pool portent une étiquette SMI (VTOC) au lieu d'une étiquette EFI. Si le disque a été réétiqueté avec une étiquette SMI, assurez-vous que le processus d'étiquetage n'a pas modifié le schéma de partitionnement. Dans la plupart des cas, toute la capacité du disque doit se trouver dans la tranche destinée au pool racine.


# zpool create rpool mirror c1t2d0s0 c2t1d0s0
# lucreate -c ufsBE -n zfsBE -p rpool
Analyzing system configuration.
No name for current boot environment.
Current boot environment is named <ufsBE>.
Creating initial configuration for primary boot environment <ufsBE>.
The device </dev/dsk/c1t0d0s0> is not a root device for any boot environment; cannot get BE ID.
PBE configuration successful: PBE name <ufsBE> PBE Boot Device </dev/dsk/c1t0d0s0>.
Comparing source boot environment <ufsBE> file systems with the file 
system(s) you specified for the new boot environment. Determining which 
file systems should be in the new boot environment.
Updating boot environment description database on all BEs.
Updating system configuration files.
The device </dev/dsk/c1t2d0s0> is not a root device for any boot environment; cannot get BE ID.
Creating configuration for boot environment <zfsBE>.
Source boot environment is <ufsBE>.
Creating boot environment <zfsBE>.
Creating file systems on boot environment <zfsBE>.
Creating <zfs> file system for </> in zone <global> on <rpool/ROOT/zfsBE>.
Populating file systems on boot environment <zfsBE>.
Checking selection integrity.
Integrity check OK.
Populating contents of mount point </>.
Copying.
Creating shared file system mount points.
Creating compare databases for boot environment <zfsBE>.
Creating compare database for file system </rpool/ROOT>.
Creating compare database for file system </>.
Updating compare databases on boot environment <zfsBE>.
Making boot environment <zfsBE> bootable.
Creating boot_archive for /.alt.tmp.b-qD.mnt
updating /.alt.tmp.b-qD.mnt/platform/sun4u/boot_archive
Population of boot environment <zfsBE> successful.
Creation of boot environment <zfsBE> successful.

Une fois l'exécution de la commande lucreate terminée, utilisez la commande lustatus pour afficher l'état de l'environnement d'initialisation. Exemple :


# lustatus
Boot Environment           Is       Active Active    Can    Copy      
Name                       Complete Now    On Reboot Delete Status    
-------------------------- -------- ------ --------- ------ ----------
ufsBE                      yes      yes    yes       no     -         
zfsBE                      yes      no     no        yes    -         

Examinez ensuite la liste des composants ZFS. Exemple :


# zfs list
NAME                   USED  AVAIL  REFER  MOUNTPOINT
rpool                 7.17G  59.8G  95.5K  /rpool
rpool/ROOT            4.66G  59.8G    21K  /rpool/ROOT
rpool/ROOT/zfsBE      4.66G  59.8G  4.66G  /
rpool/dump               2G  61.8G    16K  -
rpool/swap             517M  60.3G    16K  -

Utilisez ensuite la commande luactivate pour activer le nouvel environnement d'initialisation ZFS. Par exemple :


# luactivate zfsBE
A Live Upgrade Sync operation will be performed on startup of boot environment <zfsBE>.

**********************************************************************

The target boot environment has been activated. It will be used when you 
reboot. NOTE: You MUST NOT USE the reboot, halt, or uadmin commands. You 
MUST USE either the init or the shutdown command when you reboot. If you 
do not use either init or shutdown, the system will not boot using the 
target BE.

**********************************************************************
.
.
.
Modifying boot archive service
Activation of boot environment <zfsBE> successful.

Réinitialisez ensuite le système afin d'utiliser l'environnement d'initialisation ZFS.


# init 6

Confirmez que l'environnement d'initialisation ZFS est actif.


# lustatus
Boot Environment           Is       Active Active    Can    Copy      
Name                       Complete Now    On Reboot Delete Status    
-------------------------- -------- ------ --------- ------ ----------
ufsBE                      yes      no     no        yes    -         
zfsBE                      yes      yes    yes       no     -      

Si vous repassez à l'environnement d'initialisation UFS, vous devez réimporter tous les pools de stockage ZFS créés au cours de l'initialisation de l'environnement d'initialisation ZFS car ils ne sont pas disponibles automatiquement dans l'environnement d'initialisation UFS.

Lorsque l'environnement d'initialisation UFS est obsolète, vous pouvez le supprimer à l'aide de la commande ludelete.



Exemple 5–4 Utilisation d'Oracle Solaris Live Upgrade pour créer un environnement d'initialisation ZFS à partir d'un environnement d'initialisation ZFS

La création d'un environnement d'initialisation ZFS à partir d'un environnement d'initialisation ZFS du même pool est très rapide car l'opération fait appel aux fonctions d'instantané et de clonage ZFS. Si l'environnement d'initialisation actuel se trouve sur le même pool ZFS, l'option -p est omise.

Si vous disposez de plusieurs environnements d'initialisation ZFS, procédez comme suit pour sélectionner l'environnement d'initialisation à partir duquel vous voulez initialiser le système :

Pour plus d'informations, reportez-vous à l'Exemple 5–9.


# lucreate -n zfs2BE
Analyzing system configuration.
No name for current boot environment.
INFORMATION: The current boot environment is not named - assigning name <zfsBE>.
Current boot environment is named <zfsBE>.
Creating initial configuration for primary boot environment <zfsBE>.
The device </dev/dsk/c1t0d0s0> is not a root device for any boot environment; cannot get BE ID.
PBE configuration successful: PBE name <zfsBE> PBE Boot Device </dev/dsk/c1t0d0s0>.
Comparing source boot environment <zfsBE> file systems with the file 
system(s) you specified for the new boot environment. Determining which 
file systems should be in the new boot environment.
Updating boot environment description database on all BEs.
Updating system configuration files.
Creating configuration for boot environment <zfs2BE>.
Source boot environment is <zfsBE>.
Creating boot environment <zfs2BE>.
Cloning file systems from boot environment <zfsBE> to create boot environment <zfs2BE>.
Creating snapshot for <rpool/ROOT/zfsBE> on <rpool/ROOT/zfsBE@zfs2BE>.
Creating clone for <rpool/ROOT/zfsBE@zfs2BE> on <rpool/ROOT/zfs2BE>.
Setting canmount=noauto for </> in zone <global> on <rpool/ROOT/zfs2BE>.
Population of boot environment <zfs2BE> successful.
Creation of boot environment <zfs2BE> successful.


Exemple 5–5 Mise à niveau de votre environnement d'initialisation ZFS (luupgrade)

Vous pouvez mettre à niveau votre environnement d'initialisation ZFS à l'aide de packages ou de patchs supplémentaires.

Le processus de base est le suivant :


# lustatus
Boot Environment           Is       Active Active    Can    Copy      
Name                       Complete Now    On Reboot Delete Status    
-------------------------- -------- ------ --------- ------ ----------
zfsBE                      yes      no     no        yes    -         
zfs2BE                     yes      yes    yes       no     -   
# luupgrade -p -n zfsBE -s /net/system/export/s10up/Solaris_10/Product SUNWchxge
Validating the contents of the media </net/install/export/s10up/Solaris_10/Product>.
Mounting the BE <zfsBE>.
Adding packages to the BE <zfsBE>.

Processing package instance <SUNWchxge> from </net/install/export/s10up/Solaris_10/Product>

Chelsio N110 10GE NIC Driver(sparc) 11.10.0,REV=2006.02.15.20.41
Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.

This appears to be an attempt to install the same architecture and
version of a package which is already installed.  This installation
will attempt to overwrite this package.

Using </a> as the package base directory.
## Processing package information.
## Processing system information.
   4 package pathnames are already properly installed.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

Do you want to continue with the installation of <SUNWchxge> [y,n,?] y
Installing Chelsio N110 10GE NIC Driver as <SUNWchxge>

## Installing part 1 of 1.
## Executing postinstall script.

Installation of <SUNWchxge> was successful.
Unmounting the BE <zfsBE>.
The package add to the BE <zfsBE> completed.