All proceeds from Ad Clicks goes to the author of this site.

 

Wednesday, August 22, 2007

How can I ever live without ZFS?

Its getting harder and harder to live without ZFS. Finally upgraded my Sun Ultra 2 off of build 39, now that its 30 builds old. Build 69 is current now, (now they are at 70 since it got bumped up a couple days after I installed) in Solaris Express. I know I won't wait as long to upgrade next time, I have now a good system to aide in the process of migrating my apps and settings to the new version.

One of the main reasons I tend not to upgrade my Ultra 2 is because it's a fileserver, for my user accounts, sun ray server, DNS server, and squid proxy server the last 2 are the parts the family hates most when they go down. If you have been following my blog for a while you may have noticed that I now have /usr/local, and /usr/local/squid on ZFS, as well as /opt. The latest change that takes it a bit farther is moving my DNS directory to ZFS as well. I use the bind that sun ships in Solaris Express I dont change any of default values.

Here is how I make DNS happy living on ZFS.

#svcadm disable dns/server
#mv /etc/bind /etc/bind.old
#zfs create poolname/bind
#zfs set mountpoint=/etc/bind
#mv /etc/bind.old/* /etc/bind
#zfs snapshot poolname@baseline // might as well take a snapshot

That moved all of DNS data files to a ZFS filesystem. Fill free to enable compression on the filesystem before moving the files if you like.

now we move named.conf onto the zfs filesystem

#mv named.conf /etc/bind

so that DNS will be able to find it, drop a symlink in /etc

#ln -s /etc/bind/named.conf /etc/named.conf

now we can restart bind

#svcadm enable dns/server

There is one more step I have to do before I reinstall the OS and it's a good safety precaution. I tar up /etc and untar on a ZFS filesystem, I do it this way so that I'm sure to get all the files corectly I'm sure some hard core admins would just spit the magic cpio incantation to do the same thing in one step, probably getting a more accurate copy at the same time.

Now with these latest changes, I can now migrate most of the 3rd party applications and configuration files on the server to a new version with only 7 commands after I do a fresh install, I am able to restore all of my /opt /usr/local/* stuff, and get my DNS server and squid back running. I do have to do one thing before I wipe the old install, yes I live dangerously and don't back up my system, but backing it up is easier said than done. I currently have 100GB of storage attached to the box, and 100GB tape backup solutions cost more than the box so I keep multiple copies of my important data on multiple systems and I take advantage of raidz and snapshots.

Here are the magic 7 commands.

#zpool import poolname
#ln -s /etc/bind/named.conf /etc/named.conf
#svcadm enable dns/server
#svccfg import /usr/local/squid/etc/squid.xml
#svcadm enable squid
#cd /poolname/etc_backup/
#cp system passwd shadow /etc // recover my user accounts, groups and my system file.


Still left to do, is figure out what is needed to get SRSS (Sun Ray server software) to migrate to the new OS, I left this out this time because I am thinking about upgrading to the latest version 4.0x I think. I also need to find the magic tricks to migrate zones through an OS install but since I really haven't even booted my zones I have created I just decided to wipe them and recreate later as the need arises.

1 Comments:

Blogger Dikcy said...

COOLL !!! haeiawiaweh i love this site God JOB !! Thanks for info many help me

http://TrafficGold.us

1:19 AM  

Post a Comment

<< Home