Ну вот, вышел очередной релиз Solaris. Попробуем обновить систему с Sun Solaris 10 5/09 до текущей версии с использованием технологии Live Upgrade.
Почему именно Live Upgrade? На текущей момент только эта технология позволяет минимизировать время простоя при выполнении операции обновления с одной стороны и вернуться к предыдущей версии в случае каких-либо проблем с новой версией. Подробную информацию о Live Upgrade Вы можете найти в документации.
Конфигурация системы до выполнения обновления:
Релиз операционной системы:
root@prod01:~ # cat /etc/release
Solaris 10 5/09 s10x_u7wos_08 X86
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 30 March 2009
Solaris установлен на zfs, var вынесен в качестве отдельной файловой системы:
root@prod01:~ # zfs list
NAME USED AVAIL REFER MOUNTPOINT
rpool 8,13G 7,50G 35,5K /rpool
rpool/ROOT 3,65G 7,50G 18K legacy
rpool/ROOT/s10x_u7 3,65G 7,50G 3,58G /
rpool/ROOT/s10x_u7/var 69,3M 7,50G 69,3M /var
rpool/dump 2,00G 7,50G 2,00G -
rpool/export 37K 7,50G 19K /export
rpool/export/home 18K 7,50G 18K /export/home
rpool/swap 2G 9,50G 16K -
rpool/zones 489M 7,50G 19K /zones
rpool/zones/myzone 489M 7,50G 489M /zones/myzone
Имеется дополнительная неглобальная зона с унаследованными каталогами:
root@prod01:~ # zoneadm list -icv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
2 myzone running /zones/myzone native shared
root@prod01:~ #
Процесс обновления начинается с установки новой версии Live Upgrade:
root@prod01:~ # pkginfo | grep 'Live Upgrade'
application SUNWlucfg Live Upgrade Configuration
application SUNWlur Live Upgrade (root)
application SUNWluu Live Upgrade (usr)
application SUNWluzone Live Upgrade (zones support)
root@prod01:~ #
root@prod01:~ # pkgrm SUNWluzone SUNWlucfg SUNWlur SUNWluu
<cut>
root@prod01:~ # /cdrom/sol_10_910_x86/Solaris_10/Tools/Installers/liveupgrade20
Java Accessibility Bridge for GNOME loaded.
Solaris Web Start will assist you in installing software for Live Upgrade.
<cut>
Installation details:
Product Result More Info
1. Live Upgrade Installed Available
2. Done
Enter the number corresponding to the desired selection for more
information, or enter 2 to continue [2]:
root@prod01:~ #
Теперь необходимо создать окружение загрузки:
root@prod01:~ # lucreate -c s10x_u7 -n s10x_u9
Checking GRUB menu...
Analyzing system configuration.
No name for current boot environment.
Current boot environment is named <s10x_u7>.
Creating initial configuration for primary boot environment <s10x_u7>.
The device </dev/dsk/c1t0d0s0> is not a root device for any boot environment; cannot get BE ID.
PBE configuration successful: PBE name <s10x_u7> PBE Boot Device </dev/dsk/c1t0d0s0>.
Comparing source boot environment <s10x_u7> 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 <s10x_u9>.
Source boot environment is <s10x_u7>.
Creating boot environment <s10x_u9>.
Cloning file systems from boot environment <s10x_u7> to create boot environment <s10x_u9>.
Creating snapshot for <rpool/ROOT/s10x_u7> on <rpool/ROOT/s10x_u7@s10x_u9>.
Creating clone for <rpool/ROOT/s10x_u7@s10x_u9> on <rpool/ROOT/s10x_u9>.
Setting canmount=noauto for </> in zone <global> on <rpool/ROOT/s10x_u9>.
Creating snapshot for <rpool/ROOT/s10x_u7/var> on <rpool/ROOT/s10x_u7/var@s10x_u9>.
Creating clone for <rpool/ROOT/s10x_u7/var@s10x_u9> on <rpool/ROOT/s10x_u9/var>.
Setting canmount=noauto for </var> in zone <global> on <rpool/ROOT/s10x_u9/var>.
Creating snapshot for <rpool/zones/myzone> on <rpool/zones/myzone@s10x_u9>.
Creating clone for <rpool/zones/myzone@s10x_u9> on <rpool/zones/myzone-s10x_u9>.
Saving existing file </boot/grub/menu.lst> in top level dataset for BE <s10x_u9> as <mount-point>//boot/grub/menu.lst.prev.
File </boot/grub/menu.lst> propagation successful
Copied GRUB menu from PBE to ABE
No entry for BE <s10x_u9> in GRUB menu
Population of boot environment <s10x_u9> successful.
Creation of boot environment <s10x_u9> successful.
root@prod01:~ #
root@prod01:~ # lustatus
Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
s10x_u7 yes yes yes no -
s10x_u9 yes no no yes -
root@prod01:~ #
В процессе создания окружения загрузки были созданы соответствующие файловые системы как для глобальной зоны так и для неглобальной:
root@prod01:~ # zfs list
NAME USED AVAIL REFER MOUNTPOINT
rpool 8,13G 7,50G 35,5K /rpool
rpool/ROOT 3,65G 7,50G 18K legacy
rpool/ROOT/s10x_u7 3,65G 7,50G 3,58G /
rpool/ROOT/s10x_u7@s10x_u9 71,5K - 3,58G -
rpool/ROOT/s10x_u7/var 70,5M 7,50G 70,5M /var
rpool/ROOT/s10x_u7/var@s10x_u9 49K - 70,5M -
rpool/ROOT/s10x_u9 180K 7,50G 3,58G /
rpool/ROOT/s10x_u9/var 52K 7,50G 70,5M /var
rpool/dump 2,00G 7,50G 2,00G -
rpool/export 37K 7,50G 19K /export
rpool/export/home 18K 7,50G 18K /export/home
rpool/swap 2G 9,50G 16K -
rpool/zones 490M 7,50G 21K /zones
rpool/zones/myzone 490M 7,50G 490M /zones/myzone
rpool/zones/myzone@s10x_u9 0 - 490M -
rpool/zones/myzone-s10x_u9 102K 7,50G 490M /zones/myzone-s10x_u9
root@prod01:~ #
Теперь нам осталось обновить созданное окружение загрузки до нового релиза:
root@prod01:~ # luupgrade -u -n 's10x_u9' -s /cdrom/sol_10_910_x86
No entry for BE <s10x_u9> in GRUB menu
Copying failsafe kernel from media.
61364 blocks
miniroot filesystem is <lofs>
Mounting miniroot at </cdrom/sol_10_910_x86/Solaris_10/Tools/Boot>
ERROR: The auto registration file <> does not exist or incomplete.
The auto registration file is mandatory for this upgrade.
Use -k <filename> argument along with luupgrade command.
root@prod01:~ #
В релизе 09/10 появилась новая возможность - авторегистрация, и не смотря на ее опциональность (в соответствии с документацией) обновить предыдущие релизы до 09/10 без авторегистрации невозможно. Создаем файл авторегистрации
root@prod01:~ # vi /tmp/arf
"/tmp/arf" [New file]
auto_reg=disable
<cut>
и указываем его в качестве параметра luupgrade:
root@prod01:~ # luupgrade -u -n 's10x_u9' -s /cdrom/sol_10_910_x86 -k /tmp/arf
System has findroot enabled GRUB
No entry for BE <s10x_u9> in GRUB menu
Copying failsafe kernel from media.
61364 blocks
miniroot filesystem is <lofs>
Mounting miniroot at </cdrom/sol_10_910_x86/Solaris_10/Tools/Boot>
#######################################################################
NOTE: To improve products and services, Oracle Solaris communicates
configuration data to Oracle after rebooting.
You can register your version of Oracle Solaris to capture this data
for your use, or the data is sent anonymously.
For information about what configuration data is communicated and how
to control this facility, see the Release Notes or
www.oracle.com/goto/solarisautoreg.
INFORMATION: After activated and booted into new BE <s10x_u9>,
Auto Registration happens automatically with the following Information
autoreg=disable
#######################################################################
Validating the contents of the media </cdrom/sol_10_910_x86>.
The media is a standard Solaris media.
The media contains an operating system upgrade image.
The media contains <Solaris> version <10>.
Constructing upgrade profile to use.
Locating the operating system upgrade program.
Checking for existence of previously scheduled Live Upgrade requests.
Creating upgrade profile for BE <s10x_u9>.
Checking for GRUB menu on ABE <s10x_u9>.
Saving GRUB menu on ABE <s10x_u9>.
Checking for x86 boot partition on ABE.
Determining packages to install or upgrade for BE <s10x_u9>.
Performing the operating system upgrade of the BE <s10x_u9>.
CAUTION: Interrupting this process may leave the boot environment unstable
or unbootable.
Upgrading Solaris: 100% completed
Installation of the packages from this media is complete.
Restoring GRUB menu on ABE <s10x_u9>.
Updating package information on boot environment <s10x_u9>.
Package information successfully updated on boot environment <s10x_u9>.
Adding operating system patches to the BE <s10x_u9>.
The operating system patch installation is complete.
ABE boot partition backing deleted.
PBE GRUB has no capability information.
PBE GRUB has no versioning information.
ABE GRUB is newer than PBE GRUB. Updating GRUB.
GRUB update was successfull.
INFORMATION: The file </var/sadm/system/logs/upgrade_log> on boot
environment <s10x_u9> contains a log of the upgrade operation.
INFORMATION: The file </var/sadm/system/data/upgrade_cleanup> on boot
environment <s10x_u9> contains a log of cleanup operations required.
INFORMATION: Review the files listed above. Remember that all of the files
are located on boot environment <s10x_u9>. Before you activate boot
environment <s10x_u9>, determine if any additional system maintenance is
required or if additional media of the software distribution must be
installed.
The Solaris upgrade of the boot environment <s10x_u9> is complete.
Creating miniroot device
Configuring failsafe for system.
Failsafe configuration is complete.
Installing failsafe
Failsafe install is complete.
root@prod01:~ #
Используя lumount/luumount можно монтировать/отмонтировать окружения загрузки при необходимости устаналивать или удалять дополнительное ПО.
Далее активируем новое окружение загрузки
root@prod01:~ # luactivate -n s10x_u9
System has findroot enabled GRUB
Generating boot-sign, partition and slice information for PBE <s10x_u7>
Saving existing file </etc/bootsign> in top level dataset for BE <s10x_u7> as <mount-point>//etc/bootsign.prev.
A Live Upgrade Sync operation will be performed on startup of boot environment <s10x_u9>.
Setting failsafe console to <ttya>.
Generating boot-sign for ABE <s10x_u9>
Saving existing file </etc/bootsign> in top level dataset for BE <s10x_u9> as <mount-point>//etc/bootsign.prev.
Generating partition and slice information for ABE <s10x_u9>
Copied boot menu from top level dataset.
Generating multiboot menu entries for PBE.
Generating multiboot menu entries for ABE.
Disabling splashimage
No more bootadm entries. Deletion of bootadm entries is complete.
GRUB menu default setting is unaffected
Done eliding bootadm entries.
**********************************************************************
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.
**********************************************************************
In case of a failure while booting to the target BE, the following process
needs to be followed to fallback to the currently working boot environment:
1. Boot from the Solaris failsafe or boot in Single User mode from Solaris
Install CD or Network.
2. Mount the Parent boot environment root slice to some directory (like
/mnt). You can use the following commands in sequence to mount the BE:
zpool import rpool
zfs inherit -r mountpoint rpool/ROOT/s10x_u7
zfs set mountpoint=<mountpointName> rpool/ROOT/s10x_u7
zfs mount rpool/ROOT/s10x_u7
3. Run <luactivate> utility with out any arguments from the Parent boot
environment root slice, as shown below:
<mountpointName>/sbin/luactivate
4. luactivate, activates the previous working boot environment and
indicates the result.
5. Exit Single User mode and reboot the machine.
**********************************************************************
Modifying boot archive service
Propagating findroot GRUB for menu conversion.
File </etc/lu/installgrub.findroot> propagation successful
File </etc/lu/stage1.findroot> propagation successful
File </etc/lu/stage2.findroot> propagation successful
File </etc/lu/GRUB_capability> propagation successful
Deleting stale GRUB loader from all BEs.
File </etc/lu/installgrub.latest> deletion successful
File </etc/lu/stage1.latest> deletion successful
File </etc/lu/stage2.latest> deletion successful
Activation of boot environment <s10x_u9> successful.
root@prod01:~ #
и перезагружаем систему
root@prod01:~ # shutdown -i6 -g0 -y
Shutdown started. 15 сентября 2010 г. 18:40:27 MSD
Changing to init state 6 - please wait
Broadcast Message from root (pts/3) on prod01 Ср сент. 15 18:40:2...
THE SYSTEM prod01 IS BEING SHUT DOWN NOW ! ! !
Log off now or risk your files being damaged
propagating updated GRUB menu
Saving existing file </boot/grub/menu.lst> in top level dataset for BE <s10x_u9> as <mount-point>//boot/grub/menu.lst.prev.
File </boot/grub/menu.lst> propagation successful
File </etc/lu/GRUB_backup_menu> propagation successful
File </etc/lu/menu.cksum> propagation successful
File </sbin/bootadm> propagation successful
<cut>
После переагрузки проверяем наше окружение
root@prod01:~ # lustatus
Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
s10x_u7 yes no no yes -
s10x_u9 yes yes yes no -
root@prod01:~ #
root@prod01:~ # uname -a
SunOS prod01 5.10 Generic_142910-17 i86pc i386 i86pc
root@prod01:~ # cat /etc/release
Oracle Solaris 10 9/10 s10x_u9wos_14a X86
Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
Assembled 11 August 2010
root@prod01:~ #
root@prod01:~ # zoneadm list -icv
zoneadm list -icv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
5 myzone running /zones/myzone native shared
root@prod01:~ #
root@prod01:~ # zlogin myzone
[Connected to zone 'myzone' pts/3]
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
# uname -a
SunOS myzone 5.10 Generic_142910-17 i86pc i386 i86pc
# cat /etc/release
Oracle Solaris 10 9/10 s10x_u9wos_14a X86
Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
Assembled 11 August 2010
# ^D
[Connection to zone 'myzone' pts/3 closed]
root@prod01:~ #
После всех проверок, в том числе и проверок пользовательского ПО старое окружение загрузки можно удалить
root@prod01:~ # ludelete -n 's10x_u7'
System has findroot enabled GRUB
Checking if last BE on any disk...
BE <s10x_u7> is not the last BE on any disk.
Updating GRUB menu default setting
Changing GRUB menu default setting to <0>
Saving existing file </boot/grub/menu.lst> in top level dataset for BE <s10x_u9> as <mount-point>//boot/grub/menu.lst.prev.
File </etc/lu/GRUB_backup_menu> propagation successful
Successfully deleted entry from GRUB menu
deletion of zone path </zones/myzone-s10x_u7> is skipped
Determining the devices to be marked free.
Updating boot environment configuration database.
Updating boot environment description database on all BEs.
Updating all boot environment configuration databases.
Boot environment <s10x_u7> deleted.
root@prod01:~ #
root@prod01:~ # lustatus
Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
s10x_u9 yes yes yes no -
root@prod01:~ #