DISCLAIMER : Please note that blog owner takes no responsibility of any kind for any type of data loss or damage by trying any of the command/method mentioned in this blog. You may use the commands/method/scripts on your own responsibility.If you find something useful, a comment would be appreciated to let other viewers also know that the solution/method work(ed) for you.


Showing posts with label RAM. Show all posts
Showing posts with label RAM. Show all posts

Single command to find out RAM(memory) size in Linux

You can use the command cat /proc/meminfo to get the memory details in the linux operating system.
But this gives much more information of memory.
If you need just the memory size , use the below command to get that.


cat /proc/meminfo | awk 'match($1,"MemTotal") == 1 {print $2}'

This gives the memory size in kilobytes(kb).
But I don't know if the format of /proc/meminfo varies among distribution.

 

RAM disk in AIX


AIX provides 'mkramdisk' command for producing a disk that resides in the RAM for very high I/O intensive applications like database.
Here is a simple set of commands to create a ramdisk and a filesystem on top of it:


1.create a RAM disk specifying the size

# mkramdisk 5G

The system will assign the available RAM disk. Since this is the first one, it will be called as ramdisk0

2.Check for the new disk

# ls -l /dev | grep -i ram

If there isn't sufficient available memory, the mkramdisk command will warn about the same during the creation.


3.Create and mount a filesystem on top of the ram disk

/sbin/helpers/jfs2/mkfs -V jfs2 /dev/ramdiskx

mount -V jfs2 -o log=NULL /dev/ramdiskx /ramdiskx

The new filesystem will now be available like any other FS.

To remove a ram disk, unmount/remove the filesystem and use 'rmramdisk' command to remove the ram disk.