Blog

Resizing an LVM Partition on a Live Server

I recently ran out of space in an lvm partition on a server I manage. I needed to grow the partition with minimal interruption. Here's what I did.

First, I used the lvextend command to grow the logical volume.


lvextend -L +4G /dev/vgname/lvname /dev/hda4

That assigns 4 gigs of space from the physical volume hda4 into the lvname logical volume.

After this step, that extra space is still not usable because the filesystem has not been resized. Resizing the filesystem is done with the following steps.

Note: These steps are specific to ext2/ext3 filesystems. These steps are dangerous. At the time this procedure was done, the volume was completlely full, and problems were already occuring in applications using the volume. This solution represents a brute-force, as fast-as-possible solution to the issue. The good news is that it worked for me, and only minimal data was lost.

Setup Requirements

Install mysql:


apt-get install mysql

Set root password for mysql


mysqladmin -u root -p password NEW_PASSWORD

Create new client super-user


nml_clientadd superusername

Create client user


nml_useradd superusername username

Enabling Apache Modules in Ubuntu

Ubuntu uses a nice symlink system to enable and disable apache modules. To enable a module. Use this simple command:


sudo a2enmod %module_name%

To disable one:


sudo a2dismod %module_name%

Troubleshooting PHP Include Failures on SUSE10

All PHP includes were failing in my Drupal application on a newly configured SUSE box. After verifying all the permissions, I found that the php.ini file had an extra-secure
include_path variable. Unlike most other distributions it doesn't allow relative path includes. To change that, just modify the
include_path variable like so.

;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"
include_path = ".:/php/includes"

The change is subtle. Notice the dot before the colon. That

Enabling mod_rewrite on SUSE Linux 10.0

SUSE's distribution of Apache does not enable mod_rewrite by default. To enable it, edit
/etc/sysconfig/apache2 as root. Look for the uncommented APACHE_MODULES variable, and add
rewrite between the quotes.

Using Velocity Toolbox Features in Spring

Today the need to URL encode some URLs within a Velocity view came up in a Spring application of mine. After a few failed attempts to get a LinkTool working, I found the issue. There was a problem with the formatting of my toolbox.xml file. I thought I'd better recap the complete setup for using Velocity toolbox views in Spring.

First, I define a VelocityViewResolver in my servlet beans configuration file (spring-servlet.xml). I define a
toolboxConfigLocation, and set it to /WEB-INF/classes/toolbox.xml. I change the viewClass to use the VelocityToolboxView class instead of VelocityView. Here's an excerpt of the important area:

File Extension Finder

The best source to identify the application that created a file of unknown origin: FileXT.com. Assuming you have a file extension, this web site maintains a database of information about programs' file extensions.

Rails Won't Run With Ruby 1.8.3

Ruby on Rails fails to run with Ruby 1.8.3 The error is:

$ rails
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/clean_logger.rb:13:in `remove_const': constant Logger::Format not defined (Na
meError)
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/clean_logger.rb:13
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support.rb:31
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'

Rails and FastCGI Setup on Fedora+

http://wiki.rubyonrails.com/rails/pages/RailsOnFedora

CentOS 4 External YUM Repositories

Check out the CentOS External Repositories thread.