dd if=/dev/random of=/dev/blog

19. December 2009

Updates.

Filed under: OpenSolaris, Red Hat, Ubuntu, Linux, Misc. — admin @ 11:04

Well, it has been 23 days or so since my last update. Things have been a bit hectic. For instance, I am spending all of my free time in a start-up company intended to cater to the data storage industry. My business partner and I have a few commitments with a couple of technology partners to deliver a data storage management suite. Other time is being spent in writing a book for No Starch Press on OpenSolaris. The book is outlined for 12 chapters and the first 3 have already been submitted to the publisher.

Some other exciting stuff taking up free time is that my wife is expecting our first born this January. Between now and then, our baby daughter can show up into this world, so we are on high alert. Although so far, all is looking well.

I have also spent some time playing around with Ubuntu 9.10 Karmic Koala. It had been installed on my wife’s laptop and we have yet to see any problems or concerns. It was a brand new Sony Vaio laptop and all hardware was recognized without an issue. The operating system runs extremely quick and very smooth. Note that she is coming from the LTS Hardy Heron release, so there are some noticeable changes to her.

I must admit that Canonical is doing a great job with this distribution and I look forward to the next LTS release. I am even thinking of making a permanent switch from Fedora Linux to Ubuntu Linux. Please do not misunderstand me. I enjoy Fedora and have always been a fan. The thing with Fedora is that it is a bleeding edge technology distribution and things have a tendency to break every now and then. I have found myself with less time to go in and address those issues. Although it will not stop me from running a stable installation of RHAS on my Intel servers.

Going back to Ubuntu 9.10, while I find the integration of Plymouth a bit redundant in splash screens (one traditional and one in X; the second after an early initialization into X), one thing that I am really impressed and intrigued by is the integration of Upstart. Upstart reminds me so much of the Service Management Facility (SMF) found in Solaris/OpenSolaris as it shares some of the same basic functionality. It is Upstart that helps to speed up the boot process while also offering a nice and uniform service manager to replace the traditional init daemon. It is just amazing to see my wife’s laptop get to the desktop within 25 seconds from post. Some other positives I saw were in the addition of the Ubuntu Software Center and Ubuntu One cloud-based storage service.

Most of my recent computing hours have been spent in OpenSolaris anyways. Most of it is in development of the earlier mentioned application suite while also using it for the OpenSolaris book. The 2010.02 release is really looking good as I have been playing with build 128. It is currently installed on my Asus Eee 901 and also running on one of my 1U Sun Fire Intel servers. I even took the time to really tune the OS on the netbook and it is running fairly well. That includes, disabling unnecessary services, customizing the CPU configuration (modify the cpupm option to read the following in the /etc/power.conf file: cpupm enable poll-mode) file to utilize less power, enable ZFS compression and disabling ZFS atime updates. I even took the time to enable a RAM-based mounted file system for Firefox caching.

Nothing else new to really report but I am looking forward to the coming year and the future of some of these open source projects. Part of that is the excitement is Linux in the mobile computing industry. Linux had always had a good market share in the mobile industry. There just seems to be more excitement around Google’s Android and in turn Chrome OS.

3. November 2009

Recently integrated into ZFS: Data Deduplication

Filed under: OpenSolaris, Storage, File Systems, Solaris, UNIX — admin @ 09:26

I just stumbled onto this blog entry on the implementation of data deduplication into the Sun Microsystem’s ZFS file system. It is implemented in such a nice and clean way, I am looking forward to testing it. For instance, just like any other feature of the ZFS file system, data dedup can be enabled disabled at any path from the ZFS root mount point. Examples taken from Jeff Bonwick’s blog post cited above:

zfs set dedup=on tank
zfs set dedup=off tank/home
zfs set dedup=on tank/vm
zfs set dedup=on tank/src

It is that simple (man 1 zfs).

27. October 2009

Apple discontinues port of Sun’s ZFS file system.

Filed under: OpenSolaris, BSD, File Systems, Solaris, UNIX — admin @ 14:22

On 23 October, 2009 it was announced on MacOSForge that Apple had decided to discontinue any and all development on the porting of the ZFS file system. I know that I am not the only one to say this but I am not surprised. Supposedly there were legal reasons behind this action but in the end, who cares? They are the ones losing out to continue with an out dated and still limiting file system.

Now Apple has recently been hiring file system developers to develop a next generation file system to replace the traditional HFS+ but (as Robin Harris has previously stated) how long will it take before it becomes stable and accepted by the general public? Traditionally it takes 5+ years before a file system is considered somewhat stable and ready for production use. It wasn’t until recently that ZFS was starting to make its impact in the enterprise scene. Though my question is, to whom will this next generation file system cater to? I am to assume that it will be for the general end user utilizing Mac devices that “don’t require the weight of the ZFS features and functionality” ; or so it has been said regarding the topic of Apple abandoning the ZFS project. If that is the case and is the primary focus of the new file system, how will this impact their server market share? We already know that there is no such thing as a perfect file system that will perform ideally in every arena it is thrown into. Some will excel more than others and is entirely dependent on its implementation and workload.

In past posts, I have always stressed the importance of the file system and what is integrated within the file system. I routinely point out the numerous drawbacks and limitations of the NTFS driver. Sure, Microsoft compensates for the “lack of features” with applications, services and additional APIs to fill in all those gaps. A good example is VSS (shadow copy). This can impact performance as it is taking file system concepts out from kernel mode and into user land and consuming user mode resources. All these feature should and need to be incorporated into the file system driver. That way we can ensure that there is stability and consistency with all functions the file system performs. Even the general layout is not ideal for traditional computing over large storage media; as the fragmented large seeks between the MFT and the file data can put a lot of stress on the magnetic device. Going back to HFS+ and sort of on the same topic (although the concept is a bit different), the same could be said about Apple’s Time Machine and it running as an application on top of the driver.

One thing that I hold to heart when it comes to file systems is the ability and flexibility to tune it even without taking the mounted device(s) off-line. Most modern UNIX and Linux file systems offer a lot of tunable features (built into the driver!). For instance (through the ZFS character device node) I can dynamically alter file system variables (man 1 zfs). For this example I will focus on access times. Let us say I am using an SSD and decide that it would be more cell friendly and better performing to disable file access times on the root mount.

atime=on | off
Controls whether the access time for  files  is  updated
when  they  are  read.

To view current settings and disable this feature you would type the following in the command-line terminal:

petros@opensolaris:~$ pfexec zfs get atime rpool/export/home
NAME               PROPERTY  VALUE  SOURCE
rpool/export/home  atime     on     default
petros@opensolaris:~$ pfexec zfs set atime=off rpool/export/home
petros@opensolaris:~$ pfexec zfs get atime rpool/export/home
NAME               PROPERTY  VALUE  SOURCE
rpool/export/home  atime     off    local

I just hope that Apple is prepared for the journey they are about to embark on. They obviously have file system development experience, and I have no doubts that they have the talent. Do they have the patience and time to invest?

8. October 2009

FlexTk article: NAS Performance Comparison

Filed under: Red Hat, Storage, OpenSolaris, File Systems, Ubuntu, Microsoft, Linux, UNIX — admin @ 14:11

Linked from linuxtoday.com, I found an interesting article posted on FlexTk regarding NAS Performance Comparisons between Linux, Windows and OpenSolaris. The results are very interesting. Under each category, comparisons are drawn between:

  • Red Hat Enterprise Linux 5.3 (64-bit)
  • Ubuntu Server 9.04 (64-bit)
  • OpenSolaris 2009.06 (64-bit)
  • Windows Server 2003 (64-bit)
  • Windows Server 2008 (64-bit)
  • Windows Storage Server 2008 (64-bit)

I assume that each operating system is utilizing the default file systems with default settings for that specific release. Red Hat and Ubuntu should be using Ext3-fs, Windows obviously uses NTFS while OpenSolaris is built on top of ZFS. The CIFS/NFS exported share(s) in turn are running on top of these defaulted file systems. Either way, with average overall performance, OpenSolaris seemed to really shine. It also did well in some of the other categories which made sense when knowing the design of the ZFS file system.

18. September 2009

Finding Easter Eggs…

Filed under: BSD, Red Hat, OpenSolaris, Solaris, Ubuntu, Microsoft, Linux, UNIX — admin @ 10:12

Yesterday afternoon I was really bored at work and had eventually navigated to a website dedicated to Easter Eggs that could be found on an operating system, software application and more. Naturally I went to the list of operating systems and started looking up the operating systems which were accessible to me. As I read through the Linux and UNIX related ones, I had already known some but there were a few that I was interested in trying.

Seeing how I was on an OpenSolaris laptop I decided to first look through the SunOS list. Unfortunately none of them seemed to work. It would appear that they were taken out. But I did remember one from many years ago that a friend (Marian Lakov) had shown me. Originally found on an installation of RHEL, it was in the man page for the xorg.conf file.

man page for xorg.conf 

Listed under the VIDEOADAPTER SECTION you will read the following: Nobody wants to say how this works. Maybe nobody knows…

If you know of any hidden secret(s) that is not listed on the site posted earlier, please feel free to share.

15. September 2009

TuxRadar Article: OpenSolaris vs. Linux

Filed under: OpenSolaris, Linux — admin @ 13:14

Here is an interesting article I stumbled on earlier today. This article is intended to inform a reader who is either not familiar with or new to the OpenSolaris environment with some preliminary information about the operating system. The writer does a fairly decent job in bringing up Linux comparisons for each OpenSolaris feature (if it exists).

14. August 2009

OpenSolaris: Installing gnome-launch-box

Filed under: OpenSolaris — admin @ 07:49

Mark your calendars, for 12 August 2009 deserves to be remembered for all eternity. At least it was an important day for me. Because one thing that I was missing on OpenSolaris and in the GNOME desktop environment was GNOME-DO. This application was one of many that truly made me efficient in a GNU/Linux environment. It is unfortunate though that a package of it does not exist in OpenSolaris. Even when installing Mono (pkg.opensolaris.org/contrib) and all the necessary components, I still had problems building the package. One day I may revisit that but in the meantime I decided to concentrate on building and installing the gnome-launch-box. For the most part, gnome-launch-box will do all that I really need it to do.

Going through the build process was no easy task as I was constantly bombarded with errors. It took almost a couple of hours of troubleshooting and research to finally get it to work. Below is a rough guide of the steps I took to install gnome-launch-box.

First and foremost I downloaded the latest build (version 0.4) and extracted its contents. In order to build and install the application, please verify that the following packages have been installed (verified in build 111b/2009.06 and build 118/2010.02):

  • sunstudio12u1
  • SUNWgnu-gettext
  • SUNWgnome-common-devel
  • SUNWxorg-headers
  • SUNWgmake

Navigate to the directory where the extracted contents exist and type the following lines. If you don’t the make process will invoke unresolved symbol errors.

petros@opensolaris:~/Downloads/gnome-launch-box-0.4$ LIBS="-lsocket -lnsl"
petros@opensolaris:~/Downloads/gnome-launch-box-0.4$ export LIBS

All the installed application need to be accessible in your current PATH. Run the configure script, gmake and the pfexec gmake install so that it can install the binary into /usr/local/bin/. Verify that the install path is set to your current path (~/.profile) and from the command line you can initiate the binary by its name:

petros@opensolaris:~/Downloads/gnome-launch-box-0.4$ gnome-launch-box

No matter how many times you call on the binary, it utilizes one and the same PID. If I do not need it I hit ESC or when I launch an application, it closes (into the background). This is a great feature and makes it easier on the system when I configure various hotkeys to launch application. For example, you can install the SUNWgnome-config-editor package so that you can use the gconf-editor to enable hotkey functions in /apps/metacity/global_keybindings and /apps/metacity/keybinding commands (in my case, <Control><Shift>q invokes the application). Here are some images of gnome-launch-box running on my desktop:

 gnome-launch-box 1

gnome-launch-box 2

 gnome-launch-box 3

30. July 2009

OpenSolaris: GRUB and the Boot Environment

Filed under: OpenSolaris, File Systems, Solaris — admin @ 12:26

Ever since I started working with OpenSolaris (release 2008.05 to build 118: 2010.02), I have been suffering through some of the longer load times. While the distribution is maturing fairly well and quick, the boot times are just horrible. And to my understanding the culprit is ZFS. OpenSolaris utilizes ZFS as its default file system. On top of that, one thing that I still cannot understand is why GRUB defaults its timeout value to 60 seconds. 60 seconds! Why!?! Who needs this 60 seconds and/or who wants to be constantly annoyed to hit enter to the default kernel image, initiating the boot process? Either way, this can be modified. On OpenSolaris, editing the GRUB boot options is a little different from your traditional UNIX/Linux operating system. Note that this article is for Intel architectures and not SPARC.

Traditionally we find the appropriate files for editing in the /boot path, specifically in /boot/grub; and depending on your distribution the configuration file can vary (grub.conf or menu.lst). In OpenSolaris and on the ZFS file system, while the /boot/grub/ path exists, it does not contain the menu.lst file that we need. Instead, it is located in the /rpool/boot/grub/ path.

When you really start using Solaris/OpenSolaris, you may notice one thing that sticks out when compared to the GNU/Linux counterpart; and that is Solaris/OpenSolaris tends to be better polished when it comes to using the command line for editing system configuration files. For example, two separate tools exist for managing boot configuration files and the boot environment: bootadm and beadm. I know that certain Linux distributions have their own sets of tools for managing such stuff (i.e. QGRUBEditor as I have seen in Ubuntu; among others) but when I hop back onto a Solaris machine, it just seems simpler and a lot more straight forward. It is also standardized across both operating platforms as opposed to each distribution having their own. Historically I have always opened up the menu.lst or grub.conf file with vim and made my modifications right there. While this can still be done, the development team behind Solaris/OpenSolaris have decided to standardize it within the two applications.

bootadm

As mentioned earlier, bootadm is used to list and/or redefine specific values in your menu.lst file. Its usage is as follows (man bootadm):

#petros@opensolaris:~$ bootadm
bootadm: a command option must be specified
USAGE:
bootadm update-archive [-vn] [-R altroot [-p platform>]]
bootadm list-archive [-R altroot [-p platform>]]
bootadm set-menu [-R altroot] key=value
bootadm list-menu [-R altroot]

If I wanted to list my current configuration I would type at the command line:

petros@opensolaris:~$ bootadm list-menu
the location for the active GRUB menu is: /rpool/boot/grub/menu.lst
default 0
timeout 3
0 Solaris Development snv_118 X86

I can easily modify a parameter such as the timeout with the following command:

petros@opensolaris:~$ pfexec bootadm set-menu timeout=2
petros@opensolaris:~$ bootadm list-menu
the location for the active GRUB menu is: /rpool/boot/grub/menu.lst
default 0
timeout 2
0 Solaris Development snv_118 X86

beadm

The beadm tool is used to create and enable new boot environments. What beadm can do is take a snapshot of your current environment. This routinely occurs (transparent to the user) after a system update. Usually these snapshots should be made when applications are installed/removed to even when configuration files are modified. It will then append the listing into the menu.lst file. This way, if the new image ends up bringing down the system, you can revert back to the previous image (snapshot). Such are some advantages when the ZFS file system incorporates its own native snapshot mechanism. Basic usage for this utility is extremely simple (man beadm).

petros@opensolaris:~$ beadm

Usage:
beadm subcommand cmd_options

subcommands:
beadm activate beName
beadm create [-a] [-d description]
[-e non-activeBeName | beName@snapshot]
[-o property=value] ... [-p zpool] beName
beadm create beName@snapshot
beadm destroy [-fF] beName | beName@snapshot
beadm list [[-a] | [-d] [-s]] [-H] [beName]
beadm mount beName mountpoint
beadm rename beName newBeName
beadm unmount [-f] beName

To list all boot environments you would type the following on the command line:

petros@opensolaris:~$ beadm list
BE          Active Mountpoint Space Policy Created
--          ------ ---------- ----- ------ -------
opensolaris NR     /          6.10G static 2009-02-18 08:35

Let us say you made some changes to a configuration file or two or maybe install some applications or enable/disable services. You may want to create a new image so that if someone was wrong with the image, you can always revert back to the previous.

petros@opensolaris:~$ pfexec beadm create 22Feb09
petros@opensolaris:~$ beadm list
BE          Active Mountpoint Space Policy Created
--          ------ ---------- ----- ------ -------
22Feb09     -      -          92.0K static 2009-02-22 11:54
opensolaris NR     /          6.10G static 2009-02-18 08:35

A new entry is created in GRUB, although the older image is still the default.

petros@opensolaris:~$ bootadm list-menu
the location for the active GRUB menu is: /rpool/boot/grub/menu.lst
default 0
timeout 2
0 Solaris Development snv_118 X86
1 22Feb09

To activate the new image and have it default in GRUB, you can invoke beadm as so:

petros@opensolaris:~$ pfexec beadm activate 22Feb09
petros@opensolaris:~$ bootadm list-menu
the location for the active GRUB menu is: /rpool/boot/grub/menu.lst
default 1
timeout 2
0 Solaris Development snv_118 X86
1 22Feb09

After reboot beadm list will look like this:

petros@opensolaris:~$ beadm list
BE          Active Mountpoint Space Policy Created
--          ------ ---------- ----- ------ -------
22Feb09     NR     /          6.24G static 2009-02-22 11:54
opensolaris -      -          5.25M static 2009-02-18 08:35

22. July 2009

Playing with RAM disks on OpenSolaris 2009.06

Filed under: OpenSolaris, Storage, File Systems, Solaris — admin @ 11:11

After writing my article on The Linux RAM Disk for Linux+ Magazine and also after writing a very generic Linux RAM disk block device module, I decided to play around with the concept of RAM disks on OpenSolaris 2009.06. I must admit that this was actually a very great learning experience. One that I wish to share with the reader. Note that this post will be separated into two section: (2) tmpfs and (3) ramdiskadm.

TMPFS

While the tmpfs module exists across multiple operating systems, including Linux, the Solaris/OpenSolaris version does differ quite a bit its Linux counterpart. It is also not as flexible as the one found in Linux. For instance, on the Linux version you have the following supported user-defined module parameters (for more details, please reference the Documentation/filesystems/tmpfs.txt file in the Linux kernel source tree):

  • size - limit of allocated bytes for the size of the volume
  • mode - volume permission (once mounted)
  • nr_blocks - same as in size, but in blocks
  • nr_inodes - maximum number of inodes

The Solaris/OpenSolaris version only defines size and when you list the mounted device with the df command, it labels it as a swap. When it comes to volume permissions, you can always work around this (read below). In all cases, the advantages to utilizing tmpfs lie in the fact that it works off of virtual memory and can swap to disk when necessary. It runs like a normal file system, but when the power goes out or when the mounted volume is unmounted, all data contents disappear; as is the case with any RAM disk and no method of synchronization employed. By default, a normal installation of Solaris/OpenSolaris will use tmpfs for various computing needs such as mounting the /tmp directory with a tmpfs volume. This module can also be used to help ease a user’s computing experience and security, for example by optimizing Firefox and instead of having cache all data contents to the physical hard drive, create and have it write all necessary content to a tmpfs mounted device. The file system can also serve well in an area where constant database queries or other web services are being cached and routinely accessed. These are a few of many scenarios in which this can be used in.

Despite the few differences between each operating system, the tmpfs module is still easy to work with. Once a directory for the mount point is created, you can then mount the tmpfs RAM-based volume:

petros@opensolaris:~$ pfexec mkdir /mnt/rdisk
petros@opensolaris:~$ pfexec mount -F tmpfs -o size=96m tmpfs /mnt/rdisk

You can even configure the /etc/vfstab to automount the tmpfs volume at bootup:

#device         device          mount           FS      fsck    mount   mount
#to mount       to fsck         point           type    pass    at boot options
#
/devices        -               /devices        devfs   -       no      -
/proc           -               /proc           proc    -       no      -
ctfs            -               /system/contract ctfs   -       no      -
objfs           -               /system/object  objfs   -       no      -
sharefs         -               /etc/dfs/sharetab       sharefs -       no      -
fd              -               /dev/fd         fd      -       no      -
swap            -               /tmp            tmpfs   -       yes     -
/dev/zvol/dsk/rpool/swap        -               -               swap    -       no      -
swap            -               /mnt/rdisk      tmpfs   -       yes     size=96m

The only major drawback is that at this point only root or someone with superuser permissions (i.e. sudo/pfexec) can work with the volume or change the mount point permissions so that other users can access it. If you desire have these permissions altered at bootup, it may be advantageous to automate it in a startup script. If it doesn’t already exist, you can create it. I am referring to the /etc/rc3.d/S99local file. Some, if not all of you may already be familiar with the concept of run levels and if you are coming from a Linux environment, you may realize that the run levels are not the same between Linux and Solaris. But, this is a topic for another day. Notice under the field of startup, how I use pfexec (similar to sudo) to change the permission of the tmpfs mount. Also note that you can skip the vfstab step shown earlier and just mount the file system within the same script file.

#!/bin/bash
if [ $? -ne 0 ]; then
exit 0;
fi
case "$1" in
'start')
pfexec chmod 777 /mnt/rdisk
;;
'stop')
;;
*)
echo "Usage: $0 { start | stop }"
exit 1
;;
esac
exit 0

As can be seen, tmpfs is very easy to work with and can be applied to many things to bring forth many advantages and additional securities (a result of having the contents disappear at power down of the system). If one wanted to employ some basic method of synchronization, a script can be called during scheduled periods to perform an rsync to another mount point.

RAMDISKADM

I find this module to be an excellent tool, capable of being utilized in both production use or for teaching purposes. To utilize the ramdisk module you need to invoke the ramdiskadm command on the command line. For example, let us say I want to create a memory-based volume 100 MB in size, I would type:

petros@opensolaris:~$ pfexec ramdiskadm -a ramdisk1 100m

A device node would be created at /dev/ramdisk/ramdisk1. You can format this node with a file system and mount it locally to even exporting it as an NFS share; or configure it as an iSCSI target.

To destroy the RAM disk, you would need to type:

petros@opensolaris:~$ pfexec ramdiskadm -d ramdisk1

If you are interested, you can even create multiple ramdisks and pool them in a ZFS volume.  An advantage to utilizing this approach comes from the checksum feature to prevent data corruption of contents stored in volatile memory and also the ability to grow the volume and add it to the RAM-based pool.

petros@opensolaris:~$ pfexec ramdiskadm -a ramdisk1 100m
/dev/ramdisk/ramdisk1
petros@opensolaris:~$ pfexec ramdiskadm -a ramdisk2 100m
/dev/ramdisk/ramdisk2
petros@opensolaris:~$ pfexec zpool create rampool mirror /dev/ramdisk/ramdisk1 /dev/ramdisk/ramdisk2

I now have a zfs pool mirroring two 100 MB ramdisks. Obviously there are no real advantages to mirroring two RAM disks but this just serves as an example. I can check the status of the rampool device with the following command:

petros@opensolaris:~$ zpool status
pool: rampool
state: ONLINE
scrub: none requested
config:
NAME                       STATE     READ WRITE CKSUM
rampool                    ONLINE       0     0     0
mirror                   ONLINE       0     0     0
/dev/ramdisk/ramdisk1  ONLINE       0     0     0
/dev/ramdisk/ramdisk2  ONLINE       0     0     0
errors: No known data errors

Listing the zfs device will provide the following information (note that I cropped out the unrelated material):

petros@opensolaris:~$ zfs list
NAME                       USED  AVAIL  REFER  MOUNTPOINT
rampool                   71.5K  63.4M    19K  /rampool

To destroy the rampool I can invoke the following on the command line:

pfexec zpool destroy rampool

Let us create a RAIDZ volume:

petros@opensolaris:~$ pfexec ramdiskadm -a ramdisk1 64m
/dev/ramdisk/ramdisk1
petros@opensolaris:~$ pfexec ramdiskadm -a ramdisk2 64m
/dev/ramdisk/ramdisk2
petros@opensolaris:~$ pfexec ramdiskadm -a ramdisk3 64m
/dev/ramdisk/ramdisk3
petros@opensolaris:~$ pfexec zpool create rampool raidz /dev/ramdisk/ramdisk1 /dev/ramdisk/ramdisk2

zpool status gives us:

pool: rampool
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
rampool ONLINE 0 0 0
raidz1 ONLINE 0 0 0
/dev/ramdisk/ramdisk1 ONLINE 0 0 0
/dev/ramdisk/ramdisk2 ONLINE 0 0 0
errors: No known data errors

A zfs list will show:

petros@opensolaris:~$ zfs list
NAME USED AVAIL REFER MOUNTPOINT
rampool 70K 27.4M 19K /rampool

I now want to add another device to the rampool. Notice the differences when I list the zpool status and list the zfs device.

petros@opensolaris:~$ pfexec zpool add -f rampool /dev/ramdisk/ramdisk3
petros@opensolaris:~$ zpool status
pool: rampool
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
rampool ONLINE 0 0 0
raidz1 ONLINE 0 0 0
/dev/ramdisk/ramdisk1 ONLINE 0 0 0
/dev/ramdisk/ramdisk2 ONLINE 0 0 0
/dev/ramdisk/ramdisk3 ONLINE 0 0 0
errors: No known data errors
petros@opensolaris:~$ zfs list
NAME USED AVAIL REFER MOUNTPOINT
rampool 73K 86.9M 19K /rampool

CONCLUSION

As one can see, working with RAM disks on Solaris/OpenSolaris is fairly simple and can be configured in just a couple of steps. Who knows, you may find situations in your current environment which may benefit from the use of a RAM disk. Note - Do not forget to destroy the zpool and the RAM disks when not in use. The last thing you want to do is waste much needed memory.

12. July 2009

Customizing vim and coloring the terminal in OpenSolaris 2009.06

Filed under: OpenSolaris, Solaris, UNIX — admin @ 05:58

I have been using Sun’s Solaris (and now OpenSolaris) for years now. In fact while some of you can probably go as far back as the SunOS days, the first Solaris operating system that I worked on was Solaris 8. The company that I was working for had some older SPARC server/client nodes. They had conformed to the mindset of, “if it isn’t broken, why fix it?”

During this time I had already grown extremely comfortable with GNU/Linux. Especially when it came to the text editor tools. I have always been a fan of vim (vi improved); but when I would hop from one platform to the other, I always found myself getting stuck with the way Solaris and now, OpenSolaris default their environment.

By stuck, I mean trying to get used to their command line interface in general. The shell used to always default to the traditional Bourne Shell (/bin/sh) and not the Bourne Again Shell (/bin/bash). While this could always be customized under the user’s profile in the /etc/passwd file, I am glad to see that at least in OpenSolaris this has been changed. Now the terminal defaults to bash. Although I do not know if this will carry over to Solaris 11.

That is why as soon as a new Solaris/OpenSolaris installation is completed, I append the following additions to my my ~/.vimrc and ~/.bashrc files:

.vimrc

syntax on
set background=dark
set ru
set hls

.bashrc

export TERM=xterm-color
alias ls='ls --color=always'
alias ll='ls -l --color=always'

Note that sometimes (if it doesn’t already exist) you may have to create the .vimrc file. What these settings do is enable the ruler and syntax highlighting while also adding some necessary color to your terminal environment. This will aid in differentiating between file types from normal listings of directory contents while also color coding scripting and other code-like syntax.

To add some more customization, I will even append certain key binding because for some odd reason Sun has never implemented them in their terminal. For example, the Delete, Page Up and Page Down keys (still working on figuring out Home and End; although same results can be obtained with CTRL+A and CTRL+E). The delete will perform a delete of the characters on the prompt while the page up/down keys will page through your recent history. You would append the following to the .bashrc file:

# delete key
bind '"\e[3~":delete-char'
# page up key
bind '"\e[5~":history-search-forward'
# page down key
bind '"\e[6~":history-search-backward'

These features help me get started and as I use the system more, usually more will get added to these configuration files.

Next Page »

Powered by WordPress