September 22, 2007: Surprise Day of Work

No sleeping in for me today. I had to be up before eight this morning so that I could log in and work “at the office”. I have a bit of scheduled work this morning so I won’t be doing anything exciting today.

I ended up working from before eight until well after six in the afternoon! Much longer than the two hours that I had initially expected to have been the max amount of time that I would be needed at the office. Dominica walked over to Food for Life and picked up breakfast for us. Unfortunately for her our previously foggy morning turned into a steady rain while she was outside.

We ate breakfast and then Dominica started working in ernest on cleaning the kitchen, emptying the refridgerator and cleaning that out, laundry, dishes and more.  She decided to do some shopping today for a wardrobe for our bedroom.  We are so short on closet space it isn’t funny.  There is no place to put anything.  We are getting desperate.  She spent hours trying to find something that will fit into are extremely limited space but no luck.  There are just no good options out there.  We are pretty sure that we are going to settle with some doored shelving units that match our bookshelf in the living room.

Dominica also did several hours of work on her Academic Planning project for Empire State.  She is in the process of getting her degree planning done and out of the way.  It isn’t hard or stressful work but there is just a lot of it and it takes a lot of time.  Both she and I had very productive days today.  As anyone will notice from my barrage of technical posts earlier today I took the time to write several small “how to” articles.  I did a lot of work on the V100 servers today and am very happy with how productive I have been.

We ordered in dinner from Nino’s.  Dominica was really in the mood for a sub.  We watched two episodes of Full House and that was it for us for the night.  Oreo decided that he was very tired and actually went to bed an hour or two ahead of us!  He never, ever does that.

Unfortunately with Oreo going to bed so early his own schedule was thrown off and about two hours after Dominica and I had gone to bed Oreo got up and decided that he needed to go for a walk.  I walked him and he had a lot of energy so our walked ended up being three or four times longer than his normal late night bathroom break.  I got him home and put him back to bed but was now wide awake myself.  So I returned to work cleaning the house.  I took out the trash and the recycling.  Unfortunately I had a glass jar break and had to spend twenty minutes cleaning up that mess.  It totally exploded 🙁

I still wasn’t tired so I fired the desktop back up and started doing some more work included another tech post.  I pretty much ended up with insomnia and have been awake now for more than two hours since Oreo woke me up to take him out.

Dominica and I were very happy to not have to drive anywhere at all today.  That is the type of relaxing that we really need this weekend.  Tomorrow we are considering running down to Elizabeth to go to Ikea where they have the bookshelf that we need if we decide to go that route.  I am not sure if we have decided on that yet or not.  We don’t have too many options to consider at this point.

Mounting ISO Files on Linux

Often these days, especially when working with operating system downloaded ISO images, it would be handy to be able to work directly with the contents of the ISO files rather than to burn them to CD and place them physically into a CDROM drive. Sometimes this is because the machine that you are working with is remote and sometimes because there is no physical CDROM drive. But often it is just inconvenient.

In Linux this operation is simple. We simply create a Linux MD device where we will mount the ISO file and then mount it using the loopback. In this case we will use the /mnt/iso location which is fairly standard:

mkdir -p /mnt/iso
mount -o loop -t iso9660 my_cd_image.iso /mnt/iso

An ISO is a Compact Disk image format so called because most computers today use the ISO9660 filesystem on CDROM media.  On Solaris system the older HSFS or High Sierra File System is often designated even when ISO9660 is used.  ISO9660 is an extension to High Sierra adding in important international support and standardization.

Simple SAMBA on Solaris 10

Having built a simple NFS file server off of a SUN SunFire V100 server with Solaris 10 Update 4 (8/7) my next task is to share the same directory via Microsoft’s CIFS (aka Server Message Block or SMB) protocol. In order to do this we will need the open source software package SAMBA. This is a very simple how-to and does not begin to cover the complexities of configuring SAMBA beyond a minimal single share configuration. SAMBA is an extremely powerful package with many features including, in the latest version from SUN in Update 4, the ability to integrate with Microsoft’s Active Directory or AD.

We will begin by installing the SUN SAMBA packages which are available on the Solaris 10 8/7 CD #2. These are installed by default with many of the installation options but are not installed with the “Core” option which is what I normally use to build Solaris servers. So we have to do the install separately. If you have the second installation CD inserted into the drive and mounted, as I do, as /mnt/cdrom then the following command should work for you exactly – just copy and paste. If your CDROM device is mounted elsewhere the you will need to change the command accordingly.

# pkgadd -d /mnt/cdrom/Solaris_10/Product/ *smb* SUNWlibpopt

This command installs the SUNWsmbac, SUNWsmbar, SUNWsmbau and SUNWlibpopt packages. If you install the three SAMBA and WINS packages without installing SUNWlibpopt you can expect to get this error in your /var/svc/log/network-samba:default.log:

Executing start method ("/usr/sfw/sbin/smbd -D") ]
ld.so.1: smbd: fatal: libpopt.so.0: open failed: No such file or directory

You can check the version of SAMBA that has been installed easily using the smbd -V command. Solaris 10 Update 4 includes the SAMBA 3.0.25a package.

# /usr/sfw/sbin/smbd -V
Version 3.0.25a

Once you have the correct packages all installed you can proceed to configure your SAMBA service. Do not get ahead of yourself and attempt to enable them at this stage as the /etc/sfw/smb.conf file is missing and you will get an error until it exists. We will need to create this file now and enter a basic configuration. Here is the configuration that I created:

[global]
workgroup = DEMO-SMBFS
server string = Sol10u4 CIFS Server
log file = /var/adm/samba_log.%m
security = SHARE
[backupdata]
comment = backupdata
path = /data
force user = samiller
force group = other
read only = No
guest ok = Yes

Once you have entered your configuration parameters into the smb.conf file you may want to test them using the testparm program included with SAMBA to be sure that the syntax of the file is correct. This program will automatically check to see that the file is in the correct location and that it appears to be a valid configuration file. This quick check is highly recommended.

# /usr/sfw/bin/testparm

As long as your configuration file has passed its check we can continue on our way and enable our SAMBA and WINS services. First reboot your server. I am sure that there is a simpler way to make these services available to us but rebooting is always easy and clean. When your server has restarted you can enable your services. The svcadm command should run silently. In order to check that the services have started correctly you will need to verify them with the svcs command.

# svcadm enable samba wins
# svcs samba wins

If both of your samba related services, samba and wins, return as “online” then you are up and running. If they fail to start you can gain additional information about them by using the -xv option to the svcs command.

# svcs -xv samba wins

At this point your CIFS/SMB file server should be functioning. If you want to attempt to access it from a Windows computer you can using the CIFS syntax such as \\samba_server_hostname\backupdata\.

Easy NFS Sharing on Solaris 10

If there is one service made easy with Solaris it is NFS. Originally developed and designed by SUN NFS is the industry standard UNIX file sharing mechanism today and is likely to remain the dominant player for some time due to its ubiquity, openness, time proven protocol, simplicity and ease of management not to mention the expanse skill base of administrators who use it every day.

If you are following along in my series on building my SunFire V100 with Solaris 10 Core 8/7 then you know that we have gotten all of our filesystems setup and have a large, 106.44GB, ZFS partition mounted as /data. In this very short tutorial we are going to take that directory and make it available to the universe via NFS. Let’s get started.

Firstly we have a very easy time because Solaris installs NFS even with the Core version of the operating system so no worries there. If you don’t believe me you can take a quick look under /etc/init.d/ and you should see your nfs.server daemon script lurking there. It isn’t running yet but it is installed and ready to go.

All we need to do for our simple NFS setup is to make an entry to the filesystem export table /etc/dfs/dfstab (analogous to /etc/exportfs in Linux), enable the NFS service and instruct the system to share the contents of the dfstab. So, start by adding the following line to dfstab:

share -F nfs -o public,nosuid,rw,anon=-1 -d "backup" /data

We can explore the intricacies of this configuration file at another time. The important bits are that you are sharing the directory /data as a readable and writing (rw) directory. If you want remote machines to only be able to read from this directory without being able to make changes use (ro) instead.

Next we need to enable the NFS service in Solaris 10. If you need to look up the instructions for doing this the SUN engineers have thoughtfully included directions right at the top of the /etc/dfs/dfstab file in the comments section. How handy. But so you don’t need to go looking there, here is the command.

# svcadm enable network/nfs/server

There is one last step. Before we can actually use our newly configured NFS shared we need to tell Solaris to go ahead and share the directories. “How do we do that?”, you ask. Simple. Just shareall!

# shareall

At this point your /data directory is available to other NFS enabled computers. Wasn’t that easy? Yes it was.

Getting Started with ZFS on Solaris

If you have been following along with my series on the SunFire V100 you know that I have installed Solaris 10 Core 8/7 onto it (adding in SSH and BASH packages to make it actually useful in the real world) and have put the root volume under the control of the Solaris Volume Manager or SVM which has mirrored it under RAID 1. Now the final task for disk management is to create the ZFS storage that will exist on the large, remaining section of the disks.

Getting Starting – Prepping the Disks

Since we are not working with dedicated drive devices to use for ZFS we need to prepare some slices that we will be assigning to our ZFS pool or zpool. To complete the use of my disk space I use the format command to add a 106.44GB partition (that is block 10822 – 65533) to slice 5 on both of my drives. Now we have the space ready to be added to our first zpool.

Creating the ZPool

A zpool refers to a group of virtual (or physical) devices that will be incorporated together as a single entity under ZFS. The zpool system is analogous to logical volume management and is used instead of SVM for ZFS. Since we are working with just two drives here – as that is all that can be held by the entry-level V100 server – we are limited to working with mirrored pools. If we had three or more devices then we could opt to use RAIDZ. RAIDZ is SUN’s ZFS answer to RAID 5 but with better performance. Read Jeff Bonwick’s post for more detailed information. He explains it best.

For our simple mirroring purposes, we just use the zpool create command and select our zpool name, I chose “datapool”, and list your two slices. If you are following along on a V100 then everything should be exactly the same as mine. Feel free to use any name that makes sense for your pool.

# zpool create datapool mirror c0t0d0s5 c0t2d0s5

If all goes well you should now have your very first zpool. You can learn more about the state of your pool using zpool list and zpool status.

Creating a ZFS Filesystem

Creating our first ZFS filesystem is very easy. For my needs, I am only looking to create a single ZFS filesystem which spans the entire available space and will be eventually mounted simply as /data. For this I just need to use the simple zfs create command. Since we will probably want to be able to work with this new filesystem in the traditional manner using the commands mount and umount and by making a simple entry in the /etc/vfstab then we also need to complete the additional step of setting the mountpoint property to “legacy”. And, of course, make your mountpoint while you are at it.

# zfs create datapool/data
# zfs set mountpoint=legacy datapool/data
# mkdir /data

Add Your New ZFS Filesystem to /etc/vfstab

All that needs to be done is to open up your /etc/vfstab and add in the following line and ask Solaris to re-read the filesystem table.

datapool/data - /data zfs - yes -
# mount /data

That’s it. Now it is time to enjoy your new ZFS filesystem. Go ahead and move some shiny new files on there and try it out. Unless you are like me and would like to compress the files going onto your new partition in which case we have one last task to perform. Let’s issue the zfs set command to set our compress to on. This is very simple and straightforward.

# zfs set compress=on datapool/data

Okay, you did it. Now your filesystem is ready to be used. Enjoy.

ZFS Resources: