Howto migrate from UFS to ZFS in a Sun Cluster 3.2 environment


In this howto we’ll review the migration process for the root (/) file system from UFS to ZFS with the difficulty of working in a possibly production cluster environment. We will also use one of the new features of Sun Cluster 3.2u2: the lofi global devices for the /global directory (the globaldevices mount point).

You’ll find a lot of places and posts with the necessary steps to upgrade from UFS to ZFS. In our example, the process is pretty much the same, but there are some steps and tricks you should consider.

There is a very good course from Sun including some of these steps: Sun Cluster 3.2 Advanced Administration (ES-445).

In the following steps we consider the following scenario:

  • Solaris 10 5/09 (10/08 minimum).

  • Sun Cluster 3.2 u2 (update 2 required).

  • Root in UFS (required for the example).

  • Some Solaris Zones installed in ZFS datasets (optional).

We’ll use Live Upgrade tool for the migration. It will create the cloned boot environment.

Execute this commands in all the nodes. We can check the cluster status:

# clrg status

=== Cluster Resource Groups ===

Group Name Node Name Suspended Status
---------- --------- --------- ------
hazone-rg node12 No Offline
node11 No Online
# df -kh /
Filesystem size used avail capacity Mounted on
/dev/dsk/c1t1d0s0 31G 8.8G 22G 29% /

In this example, the source disk is c1t1d0 and the destination disk will be c1t0d0.

The partitioning of the destination disk must be all free space to the slice 0. The label must be EFI:

partition> p
Current partition table (unnamed):
Total disk cylinders available: 24620 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 24619 33.92GB (24620/0/0) 71127180
1 unassigned wu 0 0 (0/0/0) 0
2 backup wu 0 - 24619 33.92GB (24620/0/0) 71127180
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

Now, create the zpool called rpool and the new Boot Environment. Remember to execute this commands in all nodes at the same time:

# zpool create rpool c1t0d0s0
# zpool list
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
pool1 33.2G 1.38G 31.9G 4% ONLINE /
rpool 33.8G 111K 33.7G 0% ONLINE -

# lucreate -c s10u7be -n zfsBE -p rpool
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.
Creating snapshot for
on
.
Creating clone for
on
.
Creating compare databases for boot environment .
Creating compare database for file system .
Creating compare database for file system .
Updating compare databases on boot environment .
Making boot environment bootable.
Creating boot_archive for /.alt.tmp.b-awe.mnt
updating /.alt.tmp.b-awe.mnt/platform/sun4u/boot_archive
Population of boot environment successful.
Creation of boot environment successful.

The problem now is that in a cluster environment we need a dedicated slice for the /global directory (for the globaldevices DIDs). Sun Cluster 3.2u2 solves this issue with the use of lofi devices.

To use lofi devices for the /global directory we will execute the following commands (again execute this in all cluster nodes):

# lustatus
Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
s10u7be yes yes yes no -
zfsBE yes no no yes -
# lumount zfsBE
/.alt.zfsBE
# mkfile 100m /.alt.zfsBE/.globaldevices
# lofiadm -a /.alt.zfsBE/.globaldevices
/dev/lofi/1
# newfs /dev/rlofi/1
/dev/rlofi/1: Unable to find Media type. Proceeding with system determined parameters.
/dev/rlofi/1: Unable to find Media type. Proceeding with system determined parameters.
newfs: construct a new file system /dev/rlofi/1: (y/n)? y
/dev/rlofi/1: 204600 sectors in 341 cylinders of 1 tracks, 600 sectors
99.9MB in 22 cyl groups (16 c/g, 4.69MB/g, 2240 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 9632, 19232, 28832, 38432, 48032, 57632, 67232, 76832, 86432,
115232, 124832, 134432, 144032, 153632, 163232, 172832, 182432, 192032, 201632
# lofiadm -d /dev/lofi/1

Now edit the vfstab file of the new boot environment and remove or comment the line containing the /global mountpoint:

# vi /.alt.zfsBE/etc/vfstab
[..]
/dev/did/dsk/d7s3 /dev/did/rdsk/d7s3 /global/.devices/node@2 ufs 2 no global ← Delete or comment the line.

Finally, everything is ready to reboot. Activate the new boot environment:

# export BOOT_MENU_FILE="menu.lst"
# luactivate zfsBE
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.

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

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. Enter the PROM monitor (ok prompt).

2. Change the boot device back to the original boot environment by typing:

setenv boot-device /pci@1d,700000/scsi@4/disk@1,0:a

3. Boot to the original boot environment by typing:

boot

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

Modifying boot archive service
Activation of boot environment successful.

# init 6

After the reboot, check your new ZFS root:

# df -kh
Filesystem size used avail capacity Mounted on
rpool/ROOT/zfsBE 33G 5.2G 26G 17% /
/devices 0K 0K 0K 0% /devices
ctfs 0K 0K 0K 0% /system/contract
proc 0K 0K 0K 0% /proc
mnttab 0K 0K 0K 0% /etc/mnttab
swap 1.6G 528K 1.6G 1% /etc/svc/volatile
objfs 0K 0K 0K 0% /system/object
sharefs 0K 0K 0K 0% /etc/dfs/sharetab
/platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1
31G 5.2G 26G 17% /platform/sun4u-us3/lib/libc_psr.so.1
/platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1
31G 5.2G 26G 17% /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1
fd 0K 0K 0K 0% /dev/fd
swap 1.6G 144K 1.6G 1% /tmp
swap 1.6G 56K 1.6G 1% /var/run
rpool 33G 95K 26G 1% /rpool
rpool/ROOT 33G 18K 26G 1% /rpool/ROOT
/dev/lofi/126 94M 3.6M 81M 5% /global/.devices/node@2
/dev/lofi/127 94M 3.6M 81M 5% /global/.devices/node@1

pool1 33G 25K 31G 1% /zonas
pool1/hazone 33G 768M 31G 3% /zonas/hazone
pool1/hazone-s10u7be 33G 838M 31G 3% /zonas/hazone-s10u7be
pool1/hazone-s10u7be-zfsBE
33G 838M 31G 3% /zonas/hazone-s10u7be-zfsBE

# swap -l
swapfile dev swaplo blocks free
/dev/zvol/dsk/rpool/swap 256,2 16 3074032 3074032

# dumpadm
Dump content: kernel pages
Dump device: /dev/zvol/dsk/rpool/dump (dedicated)
Savecore directory: /var/crash/node11
Savecore enabled: yes

After everything is checked and running properly, set your old UFS disk as part of the ZFS mirror for the root (remember that we are in a cluster ;) ):

Note: in the example c1t0d0s0 is source disk with the ZFS root and c1t1d0 is the old UFS disk.

# zpool status rpool
pool: rpool
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
c1t0d0s0 ONLINE 0 0 0

errors: No known data errors

# prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2
# zpool attach rpool c1t0d0s0 c1t1d0s0
# installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c1t1d0s0

/Sergio

VN:F [1.9.12_1141]
Rating: 10.0/10 (4 votes cast)
VN:F [1.9.12_1141]
Rating: +1 (from 1 vote)
Howto migrate from UFS to ZFS in a Sun Cluster 3.2 environment, 10.0 out of 10 based on 4 ratings Sphere: Related Content

FacebookTwitterGoogle BookmarksLinkedInShare

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

, , , ,

  1. No comments yet.
(will not be published)