Solaris SVM : Repartitioning Drives for Operating System Upgrade
Below instructions useful to deal with a common issue in upgrading an operating system (OS) where the existing partitions, which were fine for the operating system (OS) prior to upgrading, are not large enough to hold the same file systems of the new OS. As a example, one of the partitions which demands larger space constantly is the home directory of users which is typically the slice 7 mounted on directory named “/export/home” .
1. Do a level 0 /usr/sbin/ufsdump of all filesystems that are part of the OS or reside on a disk where you need to resize an OS partition.Example:
# /usr/sbin/ufsdump 0cfu /dev/rmt/0 /dev/rdsk/c0t3d0s0
NOTE: This is a critical step. If the dump is bad, one will not be able to complete the process, and one will have to restore the system from an older backup before starting over. If possible, do this dump booted CD-ROM and only mount the filesystem you are working on at the time.
- Repartition the drive, or drives, as needed for your installation. Keep good notes on what does where and, if possible, only resize partitions because moving a partition of the OS is itself a complex task that you do not want to introduce into this project.
- Run /usr/sbin/newfs for each slice so that you will be able to restore to it.Example:
# /usr/sbin/newfs -v /dev/rdsk/c0t0d0s0
- Run /usr/sbin/ufsrestore for each slice from the tape.
- Install a boot block on the root slice of the boot drive.NOTE: For Sun x86 machines the boot block is installed on the overlap partition of the boot drive.
Example - SPARC(R) Platform:
# /usr/sbin/installboot/usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/ c0t0d0s0
NOTE: The previous examples are based on the assumption that the boot disk is c0t0d0 and the root partition is s0; modify your commands as appropriate for your configuration.
Example - Sun x86 Platform:
# /usr/sbin/installboot/usr/platform/`uname -i`/lib/fs/ufs/pboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c1t0d0s2
- Boot the machine and verify that the OS will boot.
- Comment all non-OS partitions out of /etc/vfstab.
- SDS/SVM encapsulated root disk needs to be returned to non-metadevice BEFORE proceeding,if both the followings are true:
- Solstice DiskSuite (SDS) OR Solaris Volume Manager (SVM) software is installed.
- the OS upgrading is to a release prior to Solaris 9 update 6 (4/04).
Solstice DiskSuite needs to be disabled on OS disks prior to the OS upgrade unless you are upgrading to Solaris 9 update 6 (4/04), in that case Solaris Volume Manager will mount and upgrade the md devices present in the vfstab (the operating system) and the Disksuite product itself.
If the OS release to upgrade to is prior to Solaris 9 update 6 (4/04), the entries in /etc/vfstab files need to the corresponding filesystems prior to encapsulation by SDS/SVM.
/dev/md/dsk/d11 – – swap – no -
/dev/md/dsk/d10 /dev/md/rdsk/d10 / ufs 1 no -
/dev/md/dsk/d15 /dev/md/rdsk/d15 /usr ufs 1 no logging
/dev/md/dsk/d14 /dev/md/rdsk/d14 /var ufs 1 no logging
swap – /tmp tmpfs – yes –
/dev/dsk/c1t0d0s1 – – swap – no -
/dev/dsk/c1t0d0s0 /dev/rdsk/c1t0d0s0 / ufs 1 no -
/dev/dsk/c1t0d0s5 /dev/rdsk/c1t0d0s5 /usr ufs 1 no logging
/dev/dsk/c1t0d0s4 /dev/rdsk/c1t0d0s4 /var ufs 1 no logging
swap – /tmp tmpfs – yes -
- Bring the system down gracefully (/usr/sbin/init 0 or /usr/sbin/shutdown commands) and, at the ok prompt, enter one of the followings as appropriate to the environment :
ok boot cdrom
ok boot net install
- Select “Upgrade” as the type of install and continue.
ADDITIONAL NOTES :
It is important to note that there are other reasons for not being able to do an upgrade installation on a system. A linked /var or one of its subdirectories is one reason, but there are others. Do not assume the procedure in this document will solve all problems related to an upgrade. The total number of possible issues in an installation or upgrade is largely dependent on your environment and well beyond the scope of one document.
Good planning and backups are important to any installation. The time spent up front will be paid back several fold if you run into issues during the installation process.
Please take the time to walk through your planned installation before doing it live; doing so will save you many hours of frustration and alert you to holes in your planning very quickly.