Posts Tagged ‘Linux’

How to: Install APF (advanced policy firewall) for Linux

Wednesday, March 9th, 2011

 

This article explains how to quickly install and configure APF (Advanced Policy Firewall) for Linux.

(more…)

Intel DH55TC – Linux/Virtualization tests

Thursday, January 14th, 2010

I recently had the chance to test out the brand spanking new Intel DH55TC motherboard with various Linux (and virtualization) operating systems for the purposes of network installation and compatibility actually surprised me.

(more…)

Plesk – SSL: Private key does not match the certificate public key

Thursday, January 14th, 2010

After enabling SSO, Plesk will not start with the error:

(network.c.377) SSL: Private key does not match the certificate public key, reason: error:0906D06C:PEM routines:PEM_read_bio:no start line /etc/sso/sso.pem

(more…)

Split a LVM2 Volume Group into two or more!

Friday, February 15th, 2008

We’ve all had that sinking feeling in our gut. The feeling when you realize that in a rush someone let CentOS, Fedora, or Redhat Linux auto-partition disks into one huge LVM2 mess. Until recently my answer would always simply be that its faster to reformat it and restore than try and reduce the volume group. That was until I had no choice.

I was absolutely horrified at the quality of information which was available to carry out what seems like a fairly mundane task. I am sure there are 300 different ways to do this exact same process but I needed a way that would work every time. (That is how I roll)

So about 10 or 15 completely destroyed file systems later, I share with you the fruit of my labor.

What this guide covers:

This guide covers shrinking a logical volume so that you can create more logical volumes, partitions and file systems.

What this guide does not cover:

Removing physical volumes from a Volume Group so that you can separate physical disks.

Warning: I would recommend following the guide below on a test machine prior to carrying it out on a production machine. Either way systemadminihater.com takes no responsibility for any damages caused by anything you do as a result of the instructions on this page, or any drinking games described on the other pages of this site.

Requirements:

–A Linux Rescue CD with LVM2 support (I used CentOS 5.1)

Steps:

Boot your system from your rescue CD.

I will assume that your current volume group is VolGroup00 and your current logical volume is VolGroup00. I will be creating a new logical volume LogVol02 for the sake of example.

#Activate the Logical Volume so that it becomes available.

lvm lvchange -ay /dev/VolGroup00/LogVol00

#Retrieve information about the file system you wish to shrink.

tune2fs -l /dev/mapper/VolGroup00-LogVol00

Make note of the:

Block Count: 60252160
Block Size: 4096 (4K)

My disk is a 250GB RAID-1 (60252160 4K Blocks) I am going to slice my logical volume in half because it is an easy example.

#Force FSCK to run on the logical volume you want to shrink

e2fsck -f /dev/VolGroup00/LogVol00

Resize the logical volume keep in mind that the number on the end represents 4K blocks! 30126080 x 4 = 120504320K / 1048576 = ~115GB

#Notice we give resize2fs its size in 4K blocks.

resize2fs /dev/VolGroup00/LogVol00 30126080

Multiply the number you used above by 4 (30126080 * 4) = 120504320 we give lvreduce its value in K so we can get exactly what we want.

#resize the file system.

lvm lvreduce –size 120504320K /dev/VolGroup00/LogVol00

#use vgdisplay to figure out available space

lvm vgdisplay

#below you see      extents /  space free

Free  PE / Size       3677 / 114.91 GB

#Create a new Logical Volume: LogVol02
#You can create a LV using many different options:
#–size 114G would’ve created a 114GB LV
#–extents 3677
#I used extents because it seems more exact.

lvm lvcreate –extents 3677 -n LogVol02 VolGroup00

#Create a new ext3 file system on LogVol02

mkfs.ext3 /dev/VolGroup00/LogVol02

Conclusion:

You now have two logical volumes where there used to be one!

Impress your friends, your co-workers, or maybe just yourself. Either way if you ever need to get your hands in LVM I hope this makes it easier.

-Drew

Nagion 1.0 Released

Monday, October 29th, 2007

     Nagion 1.0 has been released and offers the following features:

  • auto installation of Nagios and Plugins on CentOS, RedHat, and Fedora
  • auto creation of hosts, services, hostgroups, contacts read from comma delimited files
  • very easy to use
  • completely free!

       Download the archive here.

       As always, use the contact form to send comments, suggestions, hatred.

       -Drew