Archive for the ‘Tips & Tricks’ Category

Extend a ext3 volume with LVM

February 7th, 2009 2 comments

If you have a ext3 volume on LVM you can easily change this volume.

When you want to extend a volume you can do this with lvextend.
To extend a volume with 10GB do the following:

[[email protected] ~]# lvextend -L+10G /dev/<volgroup>/<volume>
Extending logical volume <volume> to 14.88 GB
Logical volume <volume> successfully resized

After this you have to extend/resize the filesystem:

[[email protected] ~]# resize2fs /dev/<volgroup>/<volume>
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/VolGroup00/os is mounted on /; on-line resizing required
Performing an on-line resize of /dev/VolGroup00/os to 3899392 (4k) blocks.
The filesystem on /dev/VolGroup00/os is now 3899392 blocks long.

That’s all!
You can do this without any problems on a live root file system.

Less logging from snmpd

February 7th, 2009 No comments

The snmp deamon logs a lot to the syslog deamon on CentOS. Especially when you have some monitoring with the snmp protocol.

You can change this by editing the init options of snmpd. This options can be found in /etc/init.d/snmpd. Search for the rule starting with “OPTIONS=”


OPTIONS="-Ls d -Lf /dev/null -p /var/run/ -a"

You have to change this to:

OPTIONS="-LS 0-4 d -Lf /dev/null -p /var/run/ -a"

This says that you want to log everything with a priority above debug to the syslog deamon.

In CentOS and other Redhat distro’s you also can create a file /etc/snmp/snmpd.options and put the options line there.