Hire me if you like: blake.irvin@gmail.com

Wednesday, January 07, 2009

Upgrading Solaris 10 to ZFS Boot

(A great short version of this process is here: http://gdamore.blogspot.com/2007/12/live-upgrade-rocks.html)

I started by moving the contents of /export/home to /home (the mountpoint for the 'users' zpool)

Then I used the partition/slice that was for export/home as my alternate boot slice.

I changed /etc/vfstab so that the slice that was for export/home had the same config as '/' and changed the mountpoint to 'alternate'

It turned out that that was a mistake - LiveUpgrade just wants a raw partition - easily fixed by commenting out '/alternate' and doing a umount.

Key commands are in bold


Transcript:


[root@filer1 ~]# umount /export/home

umount: /export/home busy

[root@filer1 ~]# shutdown.real -i6 -g0 -y

Shutdown started. Sat Nov 15 01:58:00 EST 2008

Changing to init state 6 - please wait
Broadcast Message from root (pts/4) on filer1 Sat Nov 15 01:58:00...
THE SYSTEM filer1 IS BEING SHUT DOWN NOW ! ! !
Log off now or risk your files being damaged

updating /platform/i86pc/boot_archive
propagating updated GRUB menu
File propagation successful

-bash-3.00$ df -F ufs
/ (/dev/dsk/c4t0d0s0 ):174915944 blocks 11949784 files
/alternate (/dev/dsk/c4t0d0s7 ):262557554 blocks 15806333 files


[root@filer1 ~]# vi /etc/vfstab

"/etc/vfstab" 14 lines, 536 characters
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/dsk/c4t0d0s1 - - swap - no -
/dev/dsk/c4t0d0s0 /dev/rdsk/c4t0d0s0 / ufs 1 no -
#/dev/dsk/c4t0d0s7 /dev/rdsk/c4t0d0s7 /alternate ufs 2 yes -
/devices - /devices devfs - no -
ctfs - /system/contract ctfs - no -
objfs - /system/object objfs - no -
swap - /tmp tmpfs - yes -
192.168.0.112:/data/nfshomes - /pit/nfshomes nfs - yes rw,soft,vers=3
sharefs - /etc/dfs/sharetab sharefs - no -

[root@filer1 ~]# umount /alternate


(below, '-n' is the Boot Environment (BE) name flag, '-m' is the flag for setting the mountpoint of the target slice)


[root@filer1 ~]# lucreate -n Solaris10Update6 -m /:/dev/dsk/c4t0d0s7:ufs

Discovering physical storage devices
Discovering logical storage devices
Cross referencing storage devices with boot environment configurations
Determining types of file systems supported
Validating file system requests
Preparing logical storage devices
Preparing physical storage devices
Configuring physical storage devices
Configuring logical storage devices
Checking GRUB menu...
System has findroot enabled GRUB
Analyzing system configuration.
Comparing source boot environment 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.
Searching /dev for possible boot environment filesystem devices

Updating system configuration files.
The device is not a root device for any boot environment; cannot get BE ID.
Creating configuration for boot environment .
Source boot environment is .
Creating boot environment .
Creating file systems on boot environment .
Creating file system for in zone on .
Mounting file systems for boot environment .
Calculating required sizes of file systems for boot environment .
Populating file systems on boot environment .
Checking selection integrity.
Integrity check OK.
Populating contents of mount point .
Copying.
Creating shared file system mount points.
Copying root of zone .
zoneadm: zone 'dsee': illegal UUID value specified
WARNING: The file contains a list of <1>
potential problems (issues) that were encountered while populating boot
environment .
INFORMATION: You must review the issues listed in
and determine if any must be resolved. In
general, you can ignore warnings about files that were skipped because
they did not exist or could not be opened. You cannot ignore errors such
as directories or files that could not be created, or file systems running
out of disk space. You must manually resolve any such problems before you
activate boot environment .
Creating compare databases for boot environment .
Creating compare database for file system .
Updating compare databases on boot environment .
Making boot environment bootable.
Updating bootenv.rc on ABE .
File propagation successful
Copied GRUB menu from PBE to ABE
No entry for BE in GRUB menu
Population of boot environment successful.
Creation of boot environment successful.

[root@filer1 ~]# lustatus

Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
c4t0d0s0 yes yes yes no -
Solaris10Update6 yes no no yes -

[root@filer1 ~]# lofiadm -a /data/it/software/sun/solaris_10/sol-10-u6-ga1-x86-dvd.iso /dev/lofi/1

[root@filer1 ~]# mkdir /isoimage

[root@filer1 ~]# mount -F hsfs /dev/lofi/1 /isoimage

[root@filer1 ~]# luupgrade -u -n Solaris10Update6 -s /isoimage

System has findroot enabled GRUB
No entry for BE in GRUB menu
Copying failsafe kernel from media.
Uncompressing miniroot
Creating miniroot device
miniroot filesystem is
Mounting miniroot at
Validating the contents of the media .
The media is a standard Solaris media.
The media contains an operating system upgrade image.
The media contains 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 .
Checking for GRUB menu on ABE .
Saving GRUB menu on ABE .
Checking for x86 boot partition on ABE.
Determining packages to install or upgrade for BE .
Performing the operating system upgrade of the BE .
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 .
Updating package information on boot environment .
Package information successfully updated on boot environment .
Adding operating system patches to the BE .
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.
Configuring failsafe for system.
Failsafe configuration is complete.
INFORMATION: The file on boot
environment contains a log of the upgrade operation.
INFORMATION: The file on boot
environment contains a log of cleanup operations
required.
WARNING: <1> packages failed to install properly on boot environment .
INFORMATION: The file on
boot environment contains a list of packages that
failed to upgrade or install properly.
INFORMATION: Review the files listed above. Remember that all of the files
are located on boot environment . Before you activate
boot environment , 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 is partially complete.
Installing failsafe
Failsafe install is complete.

[root@filer1 ~]# shudown.real -i6 -g0 -y


(below is the way I added the 250gb drive I scrounged up - used to be in my IBM desktop - '-e' flag is 'expert mode'.
I wanted to have the zpool on slice 0 for simplicity's sake - the boot slice has to stay (just like md/lvm boot disks) -
the 'backup' slice is a special slice for ufs installs, put there by default, but not needed for zfs boot, so I remove it)


[root@filer1 ~]# format -e c3t3d0

format> partition

partition> print
Current partition table (original):
Total disk cylinders available: 30398 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 - 30397 232.86GB (30398/0/0) 488343870
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 - 0 7.84MB (1/0/0) 16065
9 unassigned wm 0 0 (0/0/0) 0

partition> 2

Part Tag Flag Cylinders Size Blocks
2 backup wu 0 - 30397 232.86GB (30398/0/0) 488343870

Enter partition id tag[backup]: unassigned

Enter partition permission flags[wu]: wm

Enter new starting cyl[0]: 0

Enter partition size[488343870b, 30398c, 30397e, 238449.16mb, 232.86gb]: 0

partition> print
Current partition table (unnamed):
Total disk cylinders available: 30398 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0
1 unassigned wm 0 0 (0/0/0) 0
2 unassigned wm 0 0 (0/0/0) 0
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 - 0 7.84MB (1/0/0) 16065
9 unassigned wm 0 0 (0/0/0) 0

partition> 0

Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0

Enter partition id tag[unassigned]: root

Enter partition permission flags[wm]: wm

Enter new starting cyl[1]:

Enter partition size[0b, 0c, 1e, 0.00mb, 0.00gb]: 230.00gb

partition> print
Current partition table (unnamed):
Total disk cylinders available: 30398 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 1 - 30025 230.00GB (30025/0/0) 482351625
1 unassigned wm 0 0 (0/0/0) 0
2 unassigned wm 0 0 (0/0/0) 0
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 - 0 7.84MB (1/0/0) 16065
9 unassigned wm 0 0 (0/0/0) 0

partition> label #
***This part is KEY - it applies the partition scheme to the disk***

[0] SMI Label
[1] EFI Label

Specify Label type[0]: 0 # You need to use an SMI label to allow booting

Ready to label disk, continue? y

partition> print
Current partition table (unnamed):
Total disk cylinders available: 30398 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 1 - 30025 230.00GB (30025/0/0) 482351625 # 'wm' means 'writable,mountable'
1 unassigned wm 0 0 (0/0/0) 0
2 unassigned wm 0 0 (0/0/0) 0
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
8 boot wu 0 - 0 7.84MB (1/0/0) 16065
9 unassigned wm 0 0 (0/0/0) 0

partition> quit

format> quit

[root@filer1 ~]# zpool create rpool c3t3d0s0

[root@filer1 ~]# lucreate -n Sol10U6ZFS -p rpool

Checking GRUB menu...
System has findroot enabled GRUB
Analyzing system configuration.
Comparing source boot environment 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 is not a root device for any boot environment; cannot get BE ID.
Creating configuration for boot environment .
Source boot environment is .
Creating boot environment .
Creating file systems on boot environment .
Creating file system for in zone on .
Populating file systems on boot environment .
Checking selection integrity.
Integrity check OK.
Populating contents of mount point .
Copying.
Creating shared file system mount points.
Copying root of zone .
zoneadm: zone 'dsee': illegal UUID value specified
Creating compare databases for boot environment .
Creating compare database for file system
.
Creating compare database for file system .
Updating compare databases on boot environment .
Updating compare databases on boot environment .
Making boot environment bootable.
Updating bootenv.rc on ABE .
File propagation successful
Copied GRUB menu from PBE to ABE
No entry for BE in GRUB menu
Population of boot environment successful.
Creation of boot environment successful.

[root@filer1 ~]# lustatus

Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
c4t0d0s0 yes no no yes -
Solaris10Update6 yes yes yes no -
Sol10U6ZFS yes no no yes -

[root@filer1 ~]# luactivate Sol10U6ZFS

System has findroot enabled GRUB
Generating boot-sign, partition and slice information for PBE
A Live Upgrade Sync operation will be performed on startup of boot environment .
WARNING: <1> packages failed to install properly on boot environment .
INFORMATION: on boot
environment contains a list of packages that failed to
upgrade or install properly. Review the file before you reboot the system
to determine if any additional system maintenance is required.

Setting failsafe console to .
Generating boot-sign for ABE
NOTE: File not found in top level dataset for BE
Generating partition and slice information for ABE
Boot menu exists.
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 command to mount:

mount -Fufs /dev/dsk/c4t0d0s7 /mnt

3. Run utility with out any arguments from the Parent boot
environment root slice, as shown below:

/mnt/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 propagation successful
File propagation successful
File propagation successful
File propagation successful
Deleting stale GRUB loader from all BEs.
File deletion successful
File deletion successful
File deletion successful
Activation of boot environment successful.

[root@filer1 ~]# lustatus

Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
c4t0d0s0 yes no no yes -
Solaris10Update6 yes yes yes no -
Sol10U6ZFS yes no yes yes -


Now I can add another disk as soon as we get one with 'zpool add mirror c3t3d0s0 cXtXd0s0'

:oD

No comments:

Archive