# upgrade X4500 i86pc from S10 pre U6 UFS/SVM 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 # detach submirrors - need c5t4d0s4 for new zfs (thumper) #Filesystem Size Used Available Capacity Mounted on #/dev/md/dsk/d10 486M 293M 144M 68% / #/dev/md/dsk/d20 swap #/dev/md/dsk/d40 16G 4.5G 11G 29% /var #/dev/md/dsk/d50 7.9G 3.4G 4.4G 44% /usr #/dev/md/dsk/d60 7.9G 90M 7.7G 2% /opt #/dev/md/dsk/d80 411G 12G 395G 3% /export/scratch metadetach d10 d12 metadetach d20 d22 metadetach d40 d42 metadetach d50 d52 metadetach d60 d62 metadetach d80 d82 metaclear d12 d22 d42 d52 d62 d82 metastat # as long as there is still one metadb (e.g. on c5t0d0s6) sys is bootable metadb metadb -d /dev/dsk/c5t4d0s6 metadb zoneadm list -pi | cut -f2 -d: | grep -v global |xargs -L1 -i zlogin {} 'init 5' # MOVE all ZONES to a single ZFS 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/i386/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 118855-36, 124631-13, 120012-14, 121431-31 gsed -i -e '/^\/var\/mail/ s,^,#,' /etc/lu/synclist gpatch -p0 -d / -b -z .orig < /local/misc/etc/lu-`uname -r`.patch echo '/export/home' > /etc/lu/fs2ignore.regex # assign everything to s0 except cylinder 0 for s8 aka boot fdisk -E /dev/rdsk/c5t4d0p0 fdisk -B /dev/rdsk/c5t4d0p0 format c5t4d0 zpool create -f -o failmode=continue rpool c5t4d0s0 zfs set mountpoint=/rpool rpool zfs create -o mountpoint=legacy rpool/ROOT 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 # on error this helps to get rid of most lofs mounted stuff # grep /mnt/ /etc/mnttab | awk '{ print $2 }' | sort | tac | xargs -L1 umount # grep /lu/ /etc/mnttab | awk '{ print $2 }' | sort | tac | xargs -L1 umount # zfs list -rH -o name pool1/zones | grep -- '-zfs1008BE' | xargs -L1 zfs destroy luumount zfs1008BE zfs set mountpoint=/mnt rpool/ROOT/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/var rm -rf /mnt/var/* zfs umount rpool/ROOT/zfs1008BE zfs set mountpoint=/ rpool/ROOT/zfs1008BE zfs set canmount=noauto rpool/ROOT/zfs1008BE/var luactivate zfs1008BE init 6 # boot net -s # mount -Fufs /dev/dsk/c5t0d0s0 /mnt # /mnt/sbin/luactivate # init 6 # cleanup 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 all space to s0 metaclear -r d10 d20 d40 d50 d60 d80 metastat metadb metadb -d -f /dev/dsk/c5t0d0s6 metadb fdisk -E /dev/rdsk/c5t0d0p0 fdisk -B /dev/rdsk/c5t0d0p0 format c5t0d0 zpool attach rpool c5t4d0s0 c5t0d0s0 installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c5t0d0s0 setenv CD /net/hathor/pool1/install/i386/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 setenv FAILSAFE $CD/boot/x86.miniroot test `isainfo -k` = "amd64" -a -r $CD/boot/amd64/x86.miniroot && \ setenv FAILSAFE $CD/boot/amd64/x86.miniroot cp $FAILSAFE /mnt/boot/x86.miniroot-safe sed -e '/^This appears/,/^will attempt/ d' \ /mnt/var/sadm/system/logs/upgrade_log | less 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