Less Known Solaris features: SamFS - Part 5: Configuring a SamFS filesystem
Okay, now we can configure our first filesystem with SamFS.
Before we can configure SamFS, i want to describe the prerequisites for this task: We need some harddisks for this task. I made my example a little bit more complex, thus i used iSCSI volumes for this task. I created for this tutorial:
- a 64 MB emulated volume for the storage of metadata
- a 512 MB emulated volume for the filesystem itself
- two 2 GB emulated volumes to use them as archive disks
I assume that you already know the tasks to creating them from the iSCSI tutorial.
The first and the second volume will be used by SamFS directly. You have to use the
format command to put a label and a partition table on it.
For the both archive volumes, we will use ZFS. Thus i´ve created a zpool for both:
The configuration itself
Okay, let´s start to create a filesystem. We have to tell SamFS the structure of our filesystem. This is done in the file </code>/etc/opt/SUNWsamfs/mcf</code>.
Okay, let´s dissect this file. At first i want to explain the general meaning of the columns.
- The first column of this file is the equipment identifier. This field serves multiple purposes. You define filesystems, tape drives, disk partions for the cache or tape robotics in this file. Please note: You do not define meda for disk archiving here!
- The second column is the equipment ordinal. This field enumerates every component defined in the
mcffile. This number has to be unique.
- The third colomn is the equipment type. SamFS supports a vast amount of device type. You define it by using it´s shorthand here.
mastands for a SamFS/QFS cache disk set with one or more dedicated metadevices.mo for example designates an 5 1/4 inch erasable optical drive.
- The forth column is the family set. With the family set name you group devices. For example all disks of a filesystem. All disks of a filesystem have the same name. Another example is the grouping of a tape robotic and all of it´s tape drive.
- The fifth column is the device state.
Okay, what did we describe with our
mcf file: We defined an filesystem with the name
samfs1. The name of the family set is
samfs1 as well. The filesystem is of the type “SamFS disk cache with dedicated metadevices. In the next row we´ve defined that the device
/dev/dsk/c1t0100001C42E9F21A00002A0047E6642Bd0s0 is a device solely for metadata. We gave it the ordinal number 11 and it´s part of the
samfs1 family, thus a part of the filesystem defined before. The third line configures the
/dev/dsk/c1t0100001C42E9F21A00002A0047E54033d0s0 as the data disk for this filesystem (as the family name is
samfs1 as well.
Yes, you have read it correctly. SamFS is capable to seperating the metadata and the data of the files on different disks. The idea behind this concept is to use fast disks for the metadata (eg. solid state disks) with short access times and slower disks for the data. By this seperation the filesystem has doesn´t have to step between the position of the metadata and the position of the data when it´s updata. The effect: Much better scaling when you use a large amount of disks.
Okay, now we have fully configured the filesystem. Now we modify the
/etc/vfstab to enable simpler mounting/auto mounting at start.
The device name is the name of the filesystem, in your case
samfs1. It don´t sset a raw device. The mountpoint is
/samfs1, the type samfs and we want to mount it at the start. The options are SamFS specific. They mean: Start to release files (thus freeing space in the cache) when the cache is 80 percent full. Release until the cache is filled only 60 percent.
Okay, we have to tell SamFS that ere is a new configuration:
Looks good. Now we are able to format the filesystem:
Let´s try to mount it.
You should see the obligatory
lost+found now. But let´s do an deeper check of the filesystem:
Et voila, your first SamFS filesystem.