Archive for the ‘Software’ Category

“Message: dualvar is only available with the XS version of Scalar::Util” Error in CentOS 5

Posted 2 days ago by Alex in Randomness, Software

After upgrading the CentOS 5 system that is running my company’s internal ticketing system (OTRS), the automated cron jobs for processing tickets started throwing the following error:

Message: dualvar is only available with the XS version of Scalar::Util at /usr/lib/perl5/vendor_perl/5.8.8/IO/Socket/SSL.pm line 19

This error was caused by an upgrade to the Compress::Zlib package. The newer version of the package isn’t compiled with XS support. I found some information about this error from this OTRS mailing list post from 2010 regarding RHEL. Looks like it takes about a year for RHEL packages to make it downstream to CentOS.

To fix the error, I ran the following from the command line:

perl -MCPAN -e "CPAN::Shell->force(qw(install Scalar::Util));"

After letting the cronjobs rerun, the error was gone and tickets successfully processed again.

Disable nouveau drivers in Fedora 15

Posted 115 days ago by Alex in Code, Software, Technology

Edit: This also works in Fedora 16. During the upgrade I had to boot into single user mode to switch to run level 3 and reinstall the latest nVidia drivers. Then switch back to run level 5 and reboot.

When trying to install the latest nVidia drivers on my Fedora 15 workstation, I kept getting errors about the default nouveau video driver being loaded into the kernel. The nVidia installer creates a modprobe config file that is supposed to prevent that module from being loaded but it doesn’t work fully.

To really disable the nouveau driver, you need to edit the grub config file and add the following to the end of the kernel init line:

rdblacklist=nouveau nouveau.modeset=0

For example, your resulting grub.conf file will look like this:

title Fedora (2.6.40.6-0.fc15.x86_64)
        root (hd0,1)
        kernel /vmlinuz-2.6.40.6-0.fc15.x86_64 ro root=/dev/mapper/vg_cline-lv_root noiswmd LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb vga=794 quiet rdblacklist=nouveau nouveau.modeset=0
        initrd /initramfs-2.6.40.6-0.fc15.x86_64.img

Enable Remote Disk Browsing on a Mac

Posted 157 days ago by Alex in Hardware, Software, Technology

I recently bought a blu-ray drive for my PC to be able to watch movies and burn blu-ray disks easily. Sadly, Apple doesn’t offer a Mac with a blu-ray drive nor have I found a blu-ray internal drive for Macbook Pros.

One thing that is available for Macs is called ‘DVD or CD Sharing’, also called ‘Remote Disk’. You can find the default instructions on how to set it up over at Apple’s support article. The instructions include how to install the DVD or CD Sharing client on a Windows PC for sharing to a Mac.

What isn’t included in those instructions is the fact that by default, only Macbook Airs and Mac Minis support Remote Disk out of the box. I guess this is because they are the only two Mac models that don’t have optical drives.

Once DVD or CD Sharing has been enabled on a remote system (and the firewalls between the two systems correctly configured), the following two lines will activate the ‘Remote Disk’ option in the Finder window. Run them in a terminal window, then restart your computer.

defaults write com.apple.NetworkBrowser EnableODiskBrowsing -bool true
defaults write com.apple.NetworkBrowser ODSSupported -bool true

After boot, you should see the following options in your Finder.
Screenshot of Finder with Remote Disk devices
Note: My PC has two disk drives shared in the above picture.

Augeas Lens for Modifying Munin Nodes

Posted 177 days ago by Alex in Code, Software, Technology

Augeas (from EPEL) doesn’t come with a default lens for the munin-node.conf files that control Munin Nodes. So I whipped one together.

(* Munin Node module for Augeas *)

module MuninNode =
  autoload xfm

  let record =
    let value = store /[^ \t\n]+([ \t]+[^ \t\n]+)*/ in
      [ key Rx.word . Sep.space . value . Util.eol ]

  let lns = (record | Util.comment | Util.empty) *

  let filter = incl "/etc/munin/munin-node.conf" . Util.stdexcl

  let xfm = transform lns filter

Volume group “VolGroup00″ not found woes.

Posted 219 days ago by Alex in Hardware, Software

My attempts to migrate a physical CentOS installation to a Virtual machine were fraught with perils. First, I had to figure out how to actually transfer the data. There are many tools out there that say they can assist in a P2V conversion, but the simplest method is usually the easiest. I ended up going with a good old dd.

  1. First, you’ll want to create the new VM that you’ll be migrating to; we’ll call this the DestinationVM. Just configure the hardware — don’t install an OS.
  2. Next, boot the VM from the CentOS installation disk and enter rescue mode. At the prompt, type
    linux rescue
  3. Configure the network interfaces and when it asks to search for installations, allow it to initialize the disks in the VM. There isn’t an install present, but we need to setup the disks to perform the copy.
  4. When the VM has booted run
    nc -l -p 6501 | dd of=/dev/sda

    This will start the nc daemon and output the data to the /dev/sda disk. Make sure to change the destination disk if it is different than /dev/sda.

  5. On the physical machine run
    dd if=/dev/sda | nc <ip-of-VM> 6501

    Tip: Start the command in a screen session if you might be disconnected from the server during the transfer. It may take a while.

  6. You won’t see anything until the transfer completes. It took 6 hours for a 250GB drive to copy for me. YMMV
  7. Once the transfer is complete, reboot the VM and you should be good to go!

Sadly, when I rebooted the VM, I encountered the following error:

  Reading all physical volumes. This may take awhile...
  Volume group "VolGroup00" not found
Unable to access resume device (/dev/VolGroup00/LogVol01)
mount: could not find filesystem '/dev/root'
setuproot: moving /dev failed: No such file or directory
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
switchroot: mount failed: No such file or directory
Kernel panic - not syncing: Attempted to kill init!

This error likely means that the kernel copied from the old physical system doesn’t have drivers to support the disk hardware in the virtual machine. Because of this, the LVM configuration isn’t loading properly. The easiest way to resolve this is to reinstall the kernel using yum.

  1. Boot the VM into the CentOS install CD and at the prompt, type
    linux rescue
  2. Enable and configure networking and allow the mounting of the local installation. Make sure to mount is as read/write — we’ll be making changes to it.
  3. chroot /mnt/sysconfig
    yum remove kernel
    yum install kernel
    exit
    exit

    Note, it’s OK to remove all versions of the kernel. Just make sure you install one before you reboot.

  4. The system will reboot, once it does, let it load into the OS. If everything went OK, your new system will be up and running!

Expand CentOS 5.6 LVM running on vSphere.

Posted 243 days ago by Alex in Hardware, Software, Technology

I spent a while looking for information about how to resize an LVM within CentOS 5.6. After adding additional space to the Virtual disk through the vSphere1, CentOS doesn’t automatically utilize that space. To be able to make use of the extra space, you’ll have to do the following:
Note: These initial steps are required when expanding the size of the root partition. A non-system partition can be expanded without having to restart.

  1. Boot into a CentOS 5 installation disk. At the prompt, type:
    linux rescue
  2. Type the following commands at the prompt. The following assume you have a standard CentOS LVM configuration.
  3. # Create new partition from free space
    fdisk /dev/sda
    p  # Print partition table
    n  # New partition
    p  # Primary partition
    3  # ID = 3
    t  # Change partition type
    3  # Change partition 3
    8e # Type = Linux LVM
    p  # Print partition table
    w  # Write partition table
    
    # Create a new LVM physical volume from the new partition
    lvm pvcreate /dev/sda3
    lvm pvdisplay
    
    # Extend the volume group with the new physical volume
    lvm vgextend /dev/VolGroup00 /dev/sda3
    
    # Extend the logical volume to include 100% of the free space on the volume group.
    lvm lvextend -l+100%FREE /dev/VolGroup00/LogVol00
    
    # Mount the volume group
    lvm vgscan
    lvm vgchange -ay
    
    # Resize the filesystem on the volume group to match the total size of the drive.
    resize2fs /dev/VolGroup00/LogVol00
    

As always, have a backup of your data.

1 Learn about how to resize the virtual disk in VMWare KB Article 1004047.