Adding a New Disk to HP-UX with Veritas Volume Manager

Adding a new disk to a HP-UX system that is using Veritas Volume Manager is not difficult. It does require some extra steps, but if you follow along there are no problems.

Note well that this discussion does not have anything to do with LVM whatsoever, and the use of the Veritas File System (VxFS) is a minor tangent – other filesytems (like HFS) can be used – but if you’re not using OnlineJFS (which is nearly all of VxFS and its capabilities), the question would be why?

First of all, the usual steps for adding a disk to HP-UX are necessary:

  1. Run ioscan to scan for the new disk and to allocate resources in the kernel for it. My actual favorite invocation for this command is ioscan -fnC disk
  2. Next, run the insf command to create device files. I prefer to use ioscan -eC disk in this instance.

Now we add the disk to the Veritas Volume Manager. Run these commands:

  1. vxdctl enable
  2. vxdisk scandisks

At this point, there is now an additional disk available for use by vxvm but which is not a part of any disk groups yet.

To add the disk to a disk group, use vxdiskadm and option 1. You can use "list" here to get the name of the unallocated disk. Enter the name of the disk and answer the prompts; in most cases you will want the default.

Now to extend a file system in the volume group to use the new disk, you have to figure the amount of space available to use. You can use the command vxdg -g diskgroup free to find the free space in the disk group "diskgroup" - but this does not tell you the actual amount of space you can extend by; that is, it does not include striping and other restrictions - it only includes a flat number of unallocated blocks.

To get the amount of disk space you can grow a volume by, use the command vxassist -g diskgroup maxgrow volume. This will give you the actual amounts (if it is possible to grow). Replace the diskgroup and volume with the actual names of your disk group and volume respectively.

To actually grow the filesystem, you can do the following:

vxresize -b -F vxfs -t mytag group 999999

Fill in with the appropriate information instead of mytag (a tag to identify background vxvm operations), instead of group (disk group), and instead of 999999 (use the max amount of growth - or other appropriate number - identified by the maxgrow operation).

VxVM is aware of VxFS, so resizing the volume will also resize the filesystem as well; it uses fsadm in the case of OnlineJFS.

Disabling compcache in Ubuntu Jaunty (and Related Swap Errors)

If you have installed Ubuntu recently, you may have compcache enabled. This is a memory-based swap cache and its presence is unnecessary and unexpected in a permanent installation (it was designed for LiveCD operations). There is a bug report about compcache being enabled, along with directions on how to remove it.

This bug can also be seen if you are seeing errors like these:

Mar 6 17:27:29 server kernel: [14438.135859] compcache: Error allocating memory for compressed page: 60594, size=4096
Mar 6 17:27:29 server kernel: [14438.135871] Write-error on swap-device (254:0:484752)
Mar 6 17:27:29 server kernel: [14438.136813] allocation failed: out of vmalloc space - use vmalloc= to increase size.
Mar 6 17:27:29 server kernel: [14438.136824] compcache: Error allocating memory for compressed page: 60595, size=2093
Mar 6 17:27:29 server kernel: [14438.136835] Write-error on swap-device (254:0:484760)
Mar 6 17:27:29 server kernel: [14438.137088] allocation failed: out of vmalloc space - use vmalloc= to increase size.
Mar 6 17:27:29 server kernel: [14438.137098] compcache: Error allocating memory for compressed page: 60596, size=4079
Mar 6 17:27:29 server kernel: [14438.137108] Write-error on swap-device (254:0:484768)

You can also see it when you print swap information with the command swapon -s – if compcache is enabled, one of the swap entries will be “ramzswap”.

To disable compcache completely, do this:

rm -f /usr/share/initramfs-tools/conf.d/compcache && update-initramfs -u

The file compcache contains this line – which is what enables (and sizes) compcache:

COMPCACHE_SIZE="25%"

This was summarized nicely in this email on the ubuntu-users mailing list in February of this year.

Using Multiuser Sessions in GNU Screen

GNU Screen is a fantastic utility; however, if you want to use multiuser sessions – that is to share your screen session with another user – you’ll have to set it up.

First, you have to make sure that multiuser capabilities are in the screen binary. We’ll assume for purposes of this article that screen has already been compiled with multiuser capabilities – it appears that most prepackaged versions of GNU screen should have these capabilities already built in.

Make sure that the screen binary is properly configured to use the multiuser capabilities with these steps:

  • Make screen suid: chmod u+s $(which screen). This can be dangerous: you have to trust screen not to have anything in it (such as bugs) that will permit a user to take over as root.
  • Make sure that the directory /var/run/screen exists and has permissions of 755.

Now that screen is set up, run the initial screen session and prep it for multiuser access:

  • As a regular user, run GNU screen.
  • Start multiuser mode with the multiuser on screen command.
  • Allow a user to access the session by using the screen command acladd user with the appropriate user name or names.

Finally, the user who wants to access your screen session needs to run screen on the same system thusly:

screen -x shareduser/

This assumes that you ran the initial screen session as shareduser – and don’t leave off the final slash as that is necessary to make this work.

If you want to give this session a name (to separate it from your normal screen session perhaps), then use this command to start the session:

screen -S shared

Then let the other user use this command to connect:

screen -x shareduser/shared

That is, the user running the screen session is shareduser and the session name is shared.

There are more screen commands that are useful in multiuser mode; they are described the manual in section 8.4. There is also another web page that provides some tips on using screen, mostly focusing on multiuser mode – including how to create read-only users.

Installing SmartEiffel in Ubuntu Jaunty

Turns out that SmartEiffel has not been a part of the Ubuntu repositories since Dapper, per this bug report. The version of SmartEiffel in CVS is 2.4, the most current is 2.3.

However, to this day the problem remains: SmartEiffel will not compile under Ubuntu direct from source. The Ubuntu bug report states FTBFS (which turns out to mean Fails To Build From Source – clear, eh?).

The fix is to remove optimization from the configuration – switching the flags from -O2 to -O1. Follow these steps to get SmartEiffel working:

  • Unpack the archive and change into the directory it creates.
  • Add ${PWD}/bin to the current path: export PATH=${PWD}/bin:$PATH
  • Run make interactive.
  • Press the Enter key to get the menu.
  • Select item 2 (Choose the C compilers and options for each C mode).
  • Choose boost (the normal default)
  • Change the C compiler options and the C++ compiler options from using -O2 to using -O1
  • Return to the previous menu.
  • Return to the previous menu (again).
  • Choose Write the configuration file to disk.
  • Now choose Install SmartEiffel.

Making these changes should result in a successful build of SmartEiffel. However, despite the success, this does not in actuality install SmartEiffel into /usr/local or other recommended locations; it remains in the current directory.

To actually install SmartEiffel into the system, you’ll have to copy items over yourself. I’ll have more when I figure this out; SmartEiffel is perfectly usable after configuring your path and building from source as described here. Java compilation (that is, compiling Eiffel code to Java JVM code) still appears to have problems, though.

Getting the PalmPilot to work in Ubuntu Jaunty

I was surprised when I found that the Gnome Pilot Applet didn’t work – it didn’t appear at all. In the past I just brushed it off: but then, I decided it was time to get it fixed.

Strangely enough, there is a bug report about this and it is fixed in Karmic Koala (the upcoming version of Ubuntu) but not in Jaunty. This could be fixed in Jaunty but it isn’t. Can’t say why – makes no sense to me. The fix is to use an updated version of gnome-pilot which includes a patch to fix the bug – but this updated package is only available for Karmic.

However, loading the updated version of the gnome-pilot package (using the i386 version) was simple and there were no problems. I then restarted the gnome-pilot daemons for good measure:

sudo pkill gpilot

Probably overkill – but it doesn’t hurt. Then add the Pilot Applet to the panel and you should see the icon – and your gpilotd daemon will start in the background.

Next, click on the applet itself – and wait. The gnome-pilot Settings window should appear shortly. Make sure that the ID is not zero. This causes a bug (which is described in another bug report) where installs do not work. If the ID is zero, then click on Edit and change the PDA ID to another number (I used 5). Then click on Send to PDA and follow the instructions.

If you change the ID, you will have to go back into the Conduits tab (again in gnome-pilot Settings) and enable all of the conduits you want to use.

Once all of this is done, you should find that your PalmPilot is working up to par. Too bad that a distribution such as Ubuntu or Mint (both of which are billed as Linux for the normal person’s desktop) don’t properly support a PalmPilot “out of the box”.

A Little Known Utility: Regex-Markup

This little utility is a wonder. It lets you highlight items in text files or other text streams, using regular expressions and multiple configurations. I’ve seen other highlighting utilities, but none offer the flexibility of the remark program (short for regex-markup).

Unfortunately, it hasn’t been updated in two years – but it doesn’t really need it. The current Debian package works fine on Ubuntu. The utility was written by Oskar Liljeblad.

For example, the Debian package comes preconfigured for text output from diff, make, ping, traceroute, and syslog. The regular expressions are the same as used in regex(7) and the syntax for creating the rules files is very flexible and is explained well in the man pages for remark(1).

When looking at highlighted output such as remark puts out (as well as others) you’ll want to utilize the -R (raw) option to less. I use the command


less -RSXmg

With a preconfigured ruleset, you can change the foreground and background colors of anything you can match with a regular expression.

This becomes very useful when you want to scan a lot of text for certain output on a regular basis: things that are not all that important – but that you don’t necessarily want to leave out – can be left in with an appropriate color scheme so that the more important stuff isn’t missed.

Unfortunately, this tool is almost unheard of and is always a pain for me to relocate – but now I won’t lose it again! Give it a try and see if you like it. Kudos to Oskar for a beautiful package!

Using Open Source in the Enterprise: Two Stories

This was interesting. Just recently MIT announced that they would be replacing their Cyrus IMAP infrastructure with Microsoft Exchange. The reason was that the IS Department wanted to offer Exchange – that is, they wanted to provide Microsoft Exchange services to their “customers” (students and faculty). Isn’t it ironic that it is none other than Carnegie Mellon, another educational institution, that maintains Cyrus IMAP? Many students are also upset, as they will no longer be able to use Pine for their email.

This news can be compared to the recent news from the London Stock Exchange: they are dropping their Windows-based trading system for one based on Linux. Of course, they didn’t go out of their way to choose one or the other: but the Windows-based system halted trading for an entire day; the exchange never stated exactly what the cause was, but information was that it was the trading system that was at fault. Now the CEO that brought in the trading system is out without any comment, and the first order of business for the new CEO is to dump the old Windows-based trading system. ComputerWorld has a nice article on it. This shows the reliability of Linux overall and suggests that the reliability of Linux should be a strong selling point.

Next time management starts suggesting replacing Linux with Windows – tell them the story of the London Stock Exchange. They are also not the only ones; go read the article.

Using synergy: Trips and Traps

Synergy is a program to combine a number of host displays together (using one keyboard and mouse). Using the network, it allows you to move your mouse seamlessly from one system’s display to another – including combining many displays in this way. However, there are some trips for the unwary – or just plain surprises. None of this should make you stop using synergy; but knowing about it and what to do about it can make your use of synergy better. If you aren’t already using synergy, you should be.

The network data used by synergy is unencrypted. This means when you type in passwords on a synergy client, the passwords are sent in the clear across the network. To take care of this, use an ssh tunnel:

$ ssh -R 24800:syn-server:24800 syn-client

Then on the synergy client host, use 127.0.0.1 for the synergy server address:

$ synergyc 127.0.0.1

This will encrypt the traffic between the two hosts.

If any process hogs the processor on the machine your mouse is active on, you won’t be able to switch to another display. This makes sense when you think about it, but it still can come as a surprise. What is happening is that the synergy client program is not able to run, so it doesn’t respond when you hit the edge of the screen. Still, it would be nice if the server would recognize a client in this state and relocate the mouse somewhere you can use it.

The mouse can spontaneously relocate. This can happen for a variety of reasons – the most common is that while the synergy “mouse” has a different location than the actual mouse. When you switch from one to the other, the operating system thinks the mouse has “jumped” and moves the mouse pointer on screen accordingly. On inactive systems (where synergy does not have a pointer) the “physical” mouse pointer is usually put at the center of the screen (and usually hidden). Again, this is a little bit of a surprise, but not damaging.

The Windows-based synergy server may stop handling remote clipboards. This has been a bug with the Windows version of synergy, and can be “fixed” be restarting synergy.

XWindows clipboards may appear to not transfer. This is because XWindows has two clipboards. When you select a string of text in an xterm, for example, the data is put into a particular clipboard. However, this is not the primary clipboard and thus synergy does not transfer it. You can copy the selected text with a right-click menu and selecting “Copy…” or you can use a program like xclip to move the clipboard data into the right place.

With all of those desktops together, you’ll find that you may lose the location of the mouse from time to time. This is where the capability of “locating” the mouse with the press of a key comes in handy. Windows will do this, as will GNOME and KDE. Windows is configured to answer to a single press of the Control key. Some systems show you where the mouse is with a ever-shrinking set of rings (Windows) or squares (Fedora); Linux Mint is set up to flash a disk around the cursor.

When moving the mouse cursor across all of the different desktops, the speed and acceleration of each controls how the mouse moves when it is in that desktop. This can present itself in the form of a desktop acting like “quicksand” – the mouse moves fast until it gets to a desktop, then on that desktop the mouse moves slower until it gets to the other side. Adjust the mouse properties of each system until the mouse acts appropriately. You still won’t be able to (probably) shove the mose over and have the mouse go all the way from right to left (or vice versa) but moving will be nicer.

Watch where your mouse focus is. When you select a text box on one system, you typically then may move the mouse “out of the way.” However, if “out of the way” means the mouse is now on another system, then when you type the characters will go somewhere you don’t want them to go. This can be dangerous if you are typing in a password; don’t let your password go out over IRC or something because the wrong system’s desktop is active. It may be a good idea to break off the habit of moving the mouse off to the side; you don’t need to do this.

Follow

Get every new post delivered to your Inbox.

Join 39 other followers