Search This Blog

Tuesday 26 July 2016

Linux - Identify the disk type and disk partitions where mount points allocated

We can use the command LSSCSI. This will show disk device type and model.

In order to find which physical device its assigned to , we can use command line 
LS -L /sys/block/sda

This will give long string of "../../devices/pci0000:00/0000:00:0d.0/host..." where "0000:00:0d.0" is a PCI device ID. Use "lspci" to identify it. LSPCI is in sbin therefore require superuser access

"parted -l" also gives information about disks.

We can check the file "/proc/partitions" for all list of disk partitions to which mount points are linked.

all the mount points can be seen in the file "/proc/mounts"
"fdisk" could be used to analyse the disks but it requires super user access.

If you are looking for IBM SAN disks , as an option we can check file system as GPFS
Note from Wiki: IBM discontinued selling the SAN File System in April 2007. It has been replaced by IBM General Parallel File System(GPFS).

Monday 4 July 2016

Working with Memory in Unix

In Unix, files are arranged in file hierarchy, this hierarchy called file system. Files in different devices or on same devices can be mounted to one hierarchy so that all these files can be accessed as single file system. Each mount point can be assigned a space limit. The mount points, space usage and available space on each mount point can be listed using following command.
DF -H (all small letters)

When mount point reached max space limited then processes writing to that mount point will start failing as space is not available for that mount point even though lots of space available in disk.

In this scenario we have two options,
         1)  Either increase space limit for mount point (If more space available in disk)
         2) Purge some files to release space
 
The command that can be used to increase the logical extents for the mount point is lvextend .
The following article explains how to increase space limit on mount point
In terms of releasing the space.. it will be as easy as using “rm -rf”

But if do not want to delete existing folder structure and delete only the old or big files, we need to do following
          1) Identify the folder which occupied more space
          2)   Delete older and larger files

To identify the folders that occupied more space in a mount point, we can use following command
DU -H –MAX-DEPTH=1 (all small letters)

To delete files bases on size and time, use find as below
FIND /TMP/VAR -TYPE F -MTIME +15 -SIZE +2M -EXEC RM -RF {} \; (all small letters)


If we want to check the RAM size and memory usage in linux system, we could use either of following commands

view /proc/meminfo file

or use "free" command

or use vmstat for memory statistics.