Die folgenden Beispiele veranschaulichen die Migration eines UFS-Root-Dateisystems in ein ZFS-Root-Dateisystem.
Wenn Sie ein System mit Zonen migrieren oder aktualisieren, lesen Sie folgende Abschnitte:
Das folgende Beispiel zeigt, wie eine BU eines ZFS-Root-Dateisystems aus einem UFS-Root-Dateisystem erstellt wird. Die aktuelle BU ufsBE, die ein UFS-Root-Dateisystem enthält, wird mit der Option -c angegeben. Wenn Sie die Option - c nicht angeben, wird als BU-Name standardmäßig der Gerätename verwendet. Die neue BU zfsBE wird mit der Option -n angegeben. Vor der Ausführung des lucreate-Vorgangs muss bereits ein ZFS-Speicher-Pool vorhanden sein.
Damit ein ZFS-Speicher-Pool upgrade- und bootfähig ist, muss er auf Datenträger-Speicherbereichen und darf nicht auf einer gesamten Festplatte erstellt werden. Vergewissern Sie sich vor dem Erstellen des neuen Pools, dass die für den Pool vorgesehenen Festplatten ein SMI-Label (VTOC) anstatt eines EFI-Labels aufweisen. Bei einer Neubezeichnung der Festplatte mit einem SMI-Label ist darauf zu achten, dass durch die Bezeichnung keine Änderungen am Partitionierungsschema erfolgt sind. In den meisten Fällen sollte die gesamte Festplattenkapazität in den für den Root-Pool vorgesehenen Bereichen liegen.
# 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. |
Prüfen Sie nach Abschluss der lucreate-Vorgangs den BU-Status mithilfe des Befehls lustatus. Beispiel:
# 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 - |
Kontrollieren Sie dann die Liste der ZFS-Komponenten. Beispiel:
# 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 - |
Aktivieren Sie dann mit dem Befehl luactivate die neue ZFS-BU. Beispiel:
# 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. |
Als Nächstes starten Sie das System in der ZFS-BU neu.
# init 6 |
Vergewissern Sie sich, dass die ZFS-BU aktiv ist:
# 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 - |
Wenn Sie wieder auf die UFS-BU zurückschalten, müssen Sie während des Bootens der ZFS-BU erstellte ZFS-Speicher-Pools zurückimportieren, da sie nicht automatisch in der UFS-BU verfügbar sind.
Wird die UFS-BU nicht mehr benötigt, kann Sie mit dem Befehl ludelete gelöscht werden.
Das Erstellen einer ZFS-BU aus einer ZFS-BU in demselben Pool ist eine sehr schnelle Angelegenheit, da für diesen Vorgang die ZFS-Snapshot- und -Klon-Funktionen verwendet werden. Wenn die aktuelle BU in demselben ZFS-Pool enthalten ist, wird die Option -p nicht berücksichtigt.
Wenn mehrere ZFS-BUs vorhanden sind, gehen Sie wie folgt vor, um auszuwählen, aus welcher BU gebootet werden soll:
SPARC: Sie können mit dem Befehl boot -L die verfügbaren BUs ermitteln und mit dem Befehl boot -Z die BU auswählen, aus der gebootet werden soll.
x86: Sie können eine BU aus dem GRUB-Menü auswählen.
Weitere Informationen finden Sie unter Beispiel 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. |
Sie können die ZFS-BU mithilfe von zusätzliche Packages oder Patches aktualisieren.
Dieser Vorgang läuft im Wesentlichen wie folgt ab:
Erstellen Sie mit dem Befehl lucreate eine alternative BU.
Aktivieren Sie die alternative BU und booten Sie.
Fügen Sie der primären ZFS-BU mit dem Befehl luupgrade die Packages oder Patches hinzu.
# 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. |