Category: Linux/Unix Tips and Tricks

How to get CORRECT memory usage for Linux

One of the most common mistakes made by Linux users, is to run free (Mem: line) or sar to get memory utilization.   The memory used fields include the space used by the OS to cache files and directory info cace,…

Application Account Management

Best practices for application account management is to have all application dependent accounts and groups local to the server. These accounts should be locked, so no interactive logins can happen.  Ssh keys could still be used for automation from trusted…

Lunix Core Files

To enable core file generation.. Configure core files to use the PID as a extension.   Set “kernel.core_uses_pid = 1” in /etc/sysctl.conf  and run “/sbin/sysctl -p /etc/sysctl.conf: or to add it temporarily run “/sbin/sysctl -w kernel.core_uses_pid=1” to change the running kernel.  …

How to Reduce/Shrink a ext[234] File System

In order to shrink a file system, the file system must be unmounted.   For example with a LVM Logical volume called testfilesystem in volume group testVG mount on  /opt/testfilesystem  ( /dev/testVG-testfilesystem or /dev/mapper/testVG-testfilesystem) that we want to make 162 GB in sise.   First…

Listing Full RPM Package Name

To get a full list RPM name, like the RPM file name use the Query Format option (–qf or –queryformat). This is useful in comparing 2 systems, seeing 32 bit and 64 bit packages and finding the RPMs. This lists…

Increasing Linux Ring Buffer Size

This doesn’t work on all drivers, but on the bnx2x and other it does.   In particular, if you are seeing packet drops this can help.   Use ethtool –g <interface> to see the buffer settings. # ethtool -g eth0 Ring…

Mapping SCSI Disks

Identify scsi disk Paths – Mapping Devices [root@rhel6 ~]# for i in sdb sdc sdd sde; do printf “%s %s\n” “$i” ; “$(scsi_id –page=0x83 –whitelisted –device=/dev/$i)”;