UFS to ZFS migration with UFS merge

I will describe in this post the process of the UFS – ZFS migration with UFS merge in two steps. I use Solaris Live Upgrade to this procedure.

Abbreviations:
BE: Boot Environment
PBE: Primary Boot Environment
ABE: Alternativ Boot Environment

1. Prepare the system to Live Upgrade

Before running Live Upgrade for the first time, you must install the latest Live Upgrade packages
frominstallation media and install the patches listed in the My Oracle Support knowledge
document 1004881.1 – Live Upgrade Software Patch Requirements (formerly 206844). Search
for the knowledge document 1004881.1 – Live Upgrade Software Patch Requirements (formerly
206844) on the MyOracle Support web site.
The latest packages and patches ensure that you have all the latest bug fixes and new features in
the release. Ensure that you install all the patches that are relevant to your system before
proceeding to create a new boot environment.

remove the following packages:
pkgrm SUNWlucfg SUNWluu SUNWlur
and reinstall the new version, use the Oracle Solaris Operating installer DVD:
# cd /cdrom/cdrom0/Solaris_10/Tools/Installers
# ./liveupgrade20

 

2. Creating the first ABE (merging the filesystems)

In this example the OS directoryes are on separated filesystems:
/ (root)FS is on device /dev/md/dsk/d20
/var FS is on device /dev/md/dsk/d30
/export/home FS is on device /dev/md/dsk/d50
and swap is on device /dev/md/dsk/d20

The FS /, /var and /export/home will be merged:
lucreate -c old_be -n new_be -m /:/dev/dsk/c1t1d0s0:ufs -m -:/dev/dsk/c1t1d0s1:swap -m /var:merged:ufs -m /export/home:merged:ufs
This will take a little time ūüôā

[root@T-30:~]# lustatus
Boot-Umgebung              Ist      Aktiv  Aktiv        Kann    Kopieren
Name                       Fertig   Jetzt  Bei Neustart Löschen Status
————————– ——– —— ———¬†¬†¬† ——¬† ———-
old_BE ¬†¬† ¬†¬†¬† ¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† yes¬†¬†¬†¬†¬† yes¬†¬†¬†¬† yes¬†¬†¬†¬†¬†¬†¬†¬†¬† no¬†¬†¬†¬†¬†¬† –
new_be¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† yes¬†¬†¬†¬†¬† no¬†¬†¬†¬†¬† no¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† yes¬†¬†¬†¬†¬† –

Listing the original boot environment:
[root@T-30:/]# lufslist old_be
boot environment name: old_be

Filesystem              fstype    device size Mounted on          Mount Options
———————– ——– ———— ——————- ————–
/dev/md/dsk/d20¬†¬†¬†¬†¬†¬†¬†¬† swap¬†¬†¬†¬†¬†¬† 1077511680 –¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† –
/dev/md/dsk/d10¬†¬†¬†¬†¬†¬†¬†¬† ufs¬†¬†¬†¬†¬†¬† 12584678400 /¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† –
/dev/md/dsk/d30¬†¬†¬†¬†¬†¬†¬†¬† ufs¬†¬†¬†¬†¬†¬†¬† 3150282240 /var¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† –
/dev/md/dsk/d50¬†¬†¬†¬†¬†¬†¬†¬† ufs¬†¬†¬†¬†¬†¬†¬† 2097446400 /export/home¬†¬†¬†¬†¬†¬†¬† –

and the new BE:

[root@T-30:/]# lufslist new_be
boot environment name: new_be

Filesystem              fstype    device size Mounted on          Mount Options
———————– ——– ———— ——————- ————–
/dev/dsk/c1t1d0s1¬†¬†¬†¬†¬†¬† swap¬†¬†¬†¬†¬†¬† 3084480000 –¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† –
/dev/dsk/c1t1d0s0¬†¬†¬†¬†¬†¬† ufs¬†¬†¬†¬†¬†¬† 18350599680 /¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† –

And finally we need activate the new BE and reboot the server

luactivate new_be

[root@T-30:~]# lustatus
Boot-Umgebung              Ist      Aktiv  Aktiv        Kann    Kopieren
Name                       Fertig   Jetzt  Bei Neustart Löschen Status
————————– ——– —— ———¬†¬†¬† ——¬† ———-
old_BE ¬†¬† ¬†¬†¬† ¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† yes¬†¬†¬†¬†¬† yes¬†¬†¬†¬†¬† no¬†¬†¬†¬†¬†¬†¬†¬†¬† no¬†¬†¬†¬†¬†¬† –
new_be¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† yes¬†¬†¬†¬†¬† no¬†¬†¬†¬†¬† yes¬†¬†¬†¬†¬†¬†¬†¬†¬† yes¬†¬†¬†¬†¬† –

always reboot with: init 6

3. If the new BE is Ok, then we need to prepare two empty slice for rpool and swap, then create the ZFS pool rpool

A ZFS root pool must exists before the lucreate operation
and must be created with slices rather than whole disks to be upgradeable and bootable. The
disk cannot have an EFI label, but must be an SMI label.

I’ve partitioned the disk c1t3d0 and make this two slices: c1t3d0s0 for rpool and c1t3d0s1 for SWAP

Creating the ZFS pool:
zpool create rpool c1t3d0s0

verify the pool:
[root@T-30:/]# zpool status
pool: rpool
state: ONLINE
scan: none requested
config:

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

errors: No known data errors

4. Creating ABE (with ZFS)  РThe BE new_be must be the activ BE

[root@T-30:~]# lustatus
Boot-Umgebung              Ist      Aktiv  Aktiv        Kann    Kopieren
Name                       Fertig   Jetzt  Bei Neustart Löschen Status
————————– ——– —— ———¬†¬†¬† ——¬† ———-
old_BE ¬†¬† ¬†¬†¬† ¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† yes¬†¬†¬†¬†¬† no¬†¬†¬†¬†¬† no¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† yes¬†¬†¬†¬†¬†¬† –
new_be¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† yes¬†¬†¬†¬†¬† yes¬†¬†¬†¬† yes¬†¬†¬†¬†¬†¬†¬†¬†¬† no¬†¬†¬†¬†¬† –

lucreate -n zfs_be -p rpool
This will take a time..

5. Activate the zfs_be boot environtment
luactivate zfs_be

[root@T-30:~]# lustatus
Boot-Umgebung              Ist      Aktiv  Aktiv        Kann    Kopieren
Name                       Fertig   Jetzt  Bei Neustart Löschen Status
————————– ——– —— ———¬†¬†¬† ——¬† ———-
old_BE ¬†¬† ¬†¬†¬† ¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† yes¬†¬†¬†¬†¬† no¬†¬†¬†¬†¬† no¬†¬†¬†¬†¬†¬†¬†¬†¬† yes¬†¬†¬†¬†¬† –
new_be¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† yes¬†¬†¬†¬†¬† yes¬†¬† ¬†¬†¬† ¬†yes¬†¬†¬†¬†¬†¬†¬†¬† no¬†¬† ¬†¬†¬†¬†¬† –
zfs_be¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†¬†¬† yes¬†¬† ¬†¬†¬† ¬†no¬†¬† ¬†¬†¬† ¬†yes¬†¬† ¬†¬†¬† ¬†¬†¬† ¬†yes¬†¬† ¬†¬†¬† ¬† –

6. Reboot with zfs_be and test the system

init 6

7. Delete the swap on the old, and create swap on the new disk

swap -a /dev/dsk/c1t3d0s1
swap -d /dev/md/dsk/d20

… and we are ready.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s