Friday Mar 16, 2007

My Laptop Marathon, installing Open Solaris & liveupdate

After mixing it in a conversation about what Solaris needs to make me use it as my Laptop operating system of choice I was persuaded to trash my Linux build (Fedora 3.5) which was broken and unusable anyway, mainly because the update manager was completely shagged. (I'm in good company, see Eric Raymond's goodbye to Red Hat). I then can use the new space to create an up to date opensolaris build with liveupgrade, so I won't ever fall so far behind again. My Solaris build was Nevada 35 which has served me well as a Solaris platform for development and demonstration, but I had left it where it was because I am working on two projects which I wanted to finish before I caught up, however my colleagues have persuaded me to bite the bullet now.

My laptop is a Toshiba Tecra M2, with 1,6Ghz Intel Pentium M CPU, and 1Gb of RAM and 60 Gb of Disk. I planned to combine my Linux & Solaris partitions to give me 25 Gb for Solaris. I need two slices for Liveupdate and propose to place /export/home on a ZFS file system on a third slice. The lu slices are about 7Gb and the common data slice is about 11 Gb.

Firstly, I backed up my home user on the SNV 35 build, then I checked the disk partition table to create a new partition map on paper. I have two windows partitions, I can't remember why now, but I might have documented this in my Laptop Diaries articles and it probably relates to the windows skills available to me at the time. This isn't work I do often and so I generally ask for help. I also bookmarked on the wallpapers I had taken from, I'm particularly fond of “Neon Night”.

Next I borrowed a snv 58 bootable image from Chris. I booted the system using the bootable image and up came the solaris installer with its good old CDE look and feel. Sadly it didn't do very well with recognising the graphics chip set but we got the install done. Defining the partition table with the installer was a bit exciting because of the poor visibility and sharpness. This is not a mind-share winning experience; the install is all. Anyway at this point we have a bootable image on the first slice of the disk with Nevada 58. This took about 45 minutes.

We ran lu to make the bootable image part of live update and create a second boot environment.

Now I needed to reconfigure Solaris to be updated using liveupdate. There is a curses based program called lu that runs from an xterm, but not a gnome-terminal. This is menu based so that seemed to work OK. Now I turn my attention to the third file system which will be a ZFS file system.

I issued a “zpool create” command which failed. This is because while we unmounted the disk slice from its mount point in the live image, the zpool command was aware that the disk was mountable from the second bootable image. The BE was deleted using luremove/ludelete.

zpool create ${devicename}
zfs create ${poolname}/export
zfs set mountpoint=/export $poolname/export

I then repeated this for /export/home, /export/home/${USER}, /export/home/${USER}/Documents & /export/home/${USER}/Desktop

This gives me separate file systems and hence snap shot for each user, their documents and desktop.

I next installed three essential utilities, frkit for power management, inetmenu to manage the NICs and punchin to access the companies applications behind the firewall.

I now need to force Gnome as the default login manager, in a root

svcs disable cde
svcs enable gdm

Now the line "SystemMenu=true" needs to be inserted in the [greeter] section of /etc/X11/gdm/custom.conf. Gdm now handles RBAC authority. Previous versions i.e. At about nv 35, this had to be fixed using usermod.

Lastly, I prepare for the nv59 upgrade

lucreate -n nv59 -m /:${devicename}:ufs

this creates the boot environment and prepares the file system for a bootable image. I then find there's a pretty shitty bug in zfs in nv58 so I need to move forwards to build 59. Here's how I did that. I copied the new bootable image to ${ZFS_POOLNAME}/os/nv which I declared as zfs file system, then,

isofile=$(lofiadm -a ${ZFS_POOLNAME}/os/nv/${ISOfilename})
mount -F hsfs ${isofile} /mnt

then update the liveupdate packages

yes | pkgrm SUNWluu SUNWlur
yes | pkgadd /mnt/Solaris11/Product SUNWluu SUNWlur

then perform the liveupdate itself

liveupgrade -u -s /mnt -n nv59

and release the resources.

umount /mnt
lofiadm -d ${ZFS_POOLNAME}/os/nv/${ISOfilename})

then activate the update. I used lustatus before and after the activiate and rebooted using init 6. The command to reboot is important init 6 and shutdown work, while reboot is not to be used.

luactivate -n nv59
init 6

This didn't work for some reason, basically the boot archive wouldn't work and the system came up on the previously installed disk. I checked the menu.lst at /etc/lu/, came to the conclusion that the menu.lst had been changed an then,

#$ bootadm update-archive

this required no parameters because the first partition was the current boot partition. NB the first partition is the lower of the two slices used as live update partitions.

Reboot the system, and I am offered my five old entries plus four new ones created by the liveupdate process; select nv59 and up it comes, actually with snv59. xwindows dumps core the first time and the zfs file systems fail to mount because the live update process has created the directories and zfs mount points. This is fixed as follows:-

cd /export/home
rmdir \*
rmdir \*

and copy thegdm customisation

#$ zfs mount nv58 /a
#$ customfile=/etc/X11/gdm/custom.conf
#$ diff /a/${customfile} $customfile
< SystemMenu=true
#$ cp /a/${customfile} $customfile
#$ diff /a/${customfile} $customfile

Reboot and we're there!

Read Chris Gerard's blog article on automating zfs snapshots (every minute?), or you can check everything he's written about snapshots by going to his blog and using the search box with the search argument snapshot. I installed his scripts in my user area and set up a cron job to snapshot every hour.

I then created a top of desk panel, created the inetmenu and punchin buttons and assigned some other frequently used applications to the top panel. I pulled down some wallpapers from my static content site, and my list.





« October 2016