Wednesday 17 December 2014

Simple Way of Ordering Error Messages over Multiple Syslog Files


 for file in `ls -lt messages*| awk '{print $9}'`; do echo $file; echo; grep ERROR $file; done  

Tuesday 4 February 2014

Tuesday 7 January 2014

View what the spec file does on an RPM

This can be done using the following command:-

 rpm --scripts -qp rpmname.rpm  

Thursday 2 January 2014

Extend logical volume to occupy the rest of the free space

Check that nothing is locking the partition:-
 lsof /opt/  

Unmount the partition:-
 umount /opt  

Extend the partition:-
 lvextend -l +100%FREE /dev/mapper/vg_root-lv_opt  

Check the filesystem:-
 e2fsck -f /dev/mapper/vg_root-lv_opt  

Resize the filesystem:-
 resize2fs -p /dev/mapper/vg_root-lv_opt  

Check the filesystem:-
 e2fsck -f /dev/mapper/vg_root-lv_opt  
Remount the partition:-
 mount /opt/