# upgrade sparc sun4u from S10 pre U6 UFS to ZFS and finally to S10 U6 # for more information see: # http://iws.cs.uni-magdeburg.de/~elkner/luc/ufs2zfs.html # http://iws.cs.uni-magdeburg.de/~elkner/luc/lutrouble.html#debug # split hw mirror - only for LSI1020, LSI1030, SAS1064, or SAS1068 HBA # otherwise dataloss + raidctl -d c1t1d0 + touch /reconfigure + init 6 + tcsh # make some space in case one has less than ~25M free on / mv /etc/gconf /opt ln -s /opt/gconf /etc/gconf rm /usr/lib/mail mv /etc/mail/cf /usr/lib/mail ln -s /usr/lib/mail /etc/mail/cf # patch 125555-02 wants much more space than actually is required dueto # estimation of 2x max. bootarchive size: we fix the bootarchive manually # later, and thus ~25M free space is sufficient - i.e. we know it better ;-) patchrm 125555-03 patchrm 138866-02 patchrm 125555-02 zoneadm list -pi | cut -f2 -d: | grep -v global |xargs -L1 -i zlogin {} 'init 5' # MOVE all ZONES to pool1/zones/$zname chmod 0700 /pool1/zones/* # adjust zonepath in /etc/zone/$zname.xml # zonecfg -z $zname < verify; commit # doesn't work per -f script zoneadm list -pi | cut -f2 -d: | grep -v global |xargs -L1 -i zoneadm -z {} boot pca -a -d pca -i setenv CD /net/hathor/pool1/install/sparc/Solaris_10_u6-ga1 mount /local/misc set path = ( /usr/bin /usr/sbin /local/misc/sbin ) pkgrm SUNWluu SUNWlur SUNWlucfg pkgadd -d $CD/Solaris_10/Product SUNWlucfg SUNWlur SUNWluu pkgchk -v SUNWscpr checkpatches.sh -p 119252-26, 119254-59, 119313-23, 121430-29, 121428-11, \ 124628-08, 124630-19 gsed -i -e '/^\/var\/mail/ s,^,#,' /etc/lu/synclist gpatch -p0 -d / -b -z .orig < /local/misc/etc/lu-`uname -r`.patch # assign everything to s0 format c1t1d0 zpool create -f -o failmode=continue rpool c1t1d0s0 zfs set mountpoint=/rpool rpool zfs create -o mountpoint=legacy rpool/ROOT # just in case lucreate doesn't get it right #zfs create -V 4g rpool/swap #zfs create -V 4g rpool/dump zfs create -o canmount=noauto rpool/ROOT/zfs1008BE zpool set bootfs=rpool/ROOT/zfs1008BE rpool zfs set mountpoint=/ rpool/ROOT/zfs1008BE lucreate -c ufs1008BE -n zfs1008BE -p rpool lumount zfs1008BE /mnt luumount zfs1008BE zfs mount rpool/ROOT/zfs1008BE zfs create rpool/ROOT/zfs1008BE/mnt cd /mnt/var find . -depth -print | cpio -puvmdP@ /mnt/mnt/ cd /mnt rm -rf /mnt/var zfs rename rpool/ROOT/zfs1008BE/mnt rpool/ROOT/zfs1008BE/var mkdir /mnt/mnt rm -rf lost+found var/lost+found usr/lost+found opt/lost+found cd / zfs umount rpool/ROOT/zfs1008BE zfs set mountpoint=/ rpool/ROOT/zfs1008BE zfs set canmount=noauto rpool/ROOT/zfs1008BE/var # we're short on space: make boot archive smaller rm -f /platform/sun4u/boot_archive bootadm update-archive luactivate zfs1008BE # setenv boot-device /pci@1f,700000/scsi@2/disk@0,0:a init 6 # for each zone: zlogin $zone 'init 5' # xfer the rest of c1t0d0 to rpool umount /var/log/web zfs create -p rpool/var/log/web mount /dev/dsk/c1t0d0s6 /mnt cd /mnt find . -depth -print | cpio -puvmdP@ /var/log/web umount /mnt # for each zone: zoneadm -z $zone boot # cleanup umount /export/scratch gsed -i -e '/\/export\/scratch/ s,^,#,' /etc/vfstab gsed -i -e '/\/export\/scratch/ d' /etc/lu/ICF.2 ludelete ufs1008BE zfs list -rH -o name pool1/zones | egrep -- '-zfs1008BE$' |xargs -L1 zfs promote zfs list -rH -o name pool1/zones | egrep -- '-zfs1008BE$' | \ xargs -L1 zfs set canmount=on zfs list -rH -o name pool1/zones | grep @zfs1008BE | xargs -L1 zfs destroy -R rmdir /.alt.lucopy.* mount -F lofs -o nosub / /mnt rm -rf /mnt/var/* umount /mnt # assign everything to s0 format c1t0d0 zpool attach rpool c1t1d0s0 c1t0d0s0 # paranoid people wait for 'til resilvering is done installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk \ /dev/rdsk/c1t0d0s0 mkdir -p /rpool/platform/`uname -m`/ cp -p /platform/`uname -m`/bootlst /rpool/platform/`uname -m`/bootlst # reposition 'make space 4 /' stuff rm /etc/gconf mv /opt/gconf /etc/ rm /etc/mail/cf mv /usr/lib/mail /etc/mail/cf ln -s ../../etc/mail/cf /usr/lib/mail setenv CD /net/hathor/pool1/install/sparc/Solaris_10_u6-ga1 setenv JUMPDIR /net/hathor/pool1/install/jumpstart mount /local/misc set path = ( /usr/bin /usr/sbin /local/misc/sbin ) lucreate -n s10u6 -p rpool chmod 0700 /pool1/zones/*s10u6 ls -1d /pool1/zones/*s10u6 | xargs -L 1 umount lumount s10u6 /mnt luumount s10u6 $JUMPDIR/mkProfile.sh -u $CD/Solaris_10 echo 'cluster SUNWC4u1 delete' >> /tmp/profile.orig echo 'cluster SUNWCcvc delete' >> /tmp/profile.orig cp /tmp/profile.orig /var/tmp/profile rm -f /var/tmp/upgrade.err /var/tmp/upgrade.out ls -1d /pool1/zones/*s10u6 | xargs -L 1 umount luupgrade -u -n s10u6 \ -l /var/tmp/upgrade.err -o /var/tmp/upgrade.out \ -s $CD -j /var/tmp/profile ls -1d /pool1/zones/*s10u6 | xargs -L 1 umount lumount s10u6 /mnt gpatch -p0 -d /mnt -b -z .orig < /local/misc/etc/lu-`uname -r`.patch cd /mnt/var/sadm/system/data/ less upgrade_failed_pkgadds # gsed -re 's,(partial|conflict|action)=ask,\1=nocheck,' \ # /var/sadm/install/admin/default >/tmp/dontask # awk '{ print "pkgadd -n -M -R /mnt -a /tmp/dontask -d $CD/Solaris_10/Product " $1 }' upgrade_failed_pkgadds cleanup4humans.sh /mnt cd /mnt/var/tmp less preserved.txt renamed.txt restored.txt removeSafe.sh \ symlinkchange.txt typechange.txt misc.txt lupatch.sh -d lupatch.sh -r lupatch.sh -i gpatch -p0 -d /mnt -b -z .orig < /local/misc/etc/lu-`uname -r`.patch cd / luumount s10u6 luactivate s10u6 init 6 # In case of a failure while booting to the target BE: # boot net -s # mount -Fzfs /dev/dsk/c1t1d0s0 /mnt # /mnt/sbin/luactivate # init 6