Mount and Umount and tmpfs in Linux Command

Linux

Today, we talk about mount | umount and tmpfs

  • Command:

mount [drive] [path]
Example: mount /dev/sdb1 /home

umount [path]
Example: umount /home

However, if you get devices are busy, so use:
umount -l /home

About tmpfs: This is a command use Memory as a Temp Directory, all data will be deleted after reboot.

You know, folder /tmp in Server, if you use other partition as /tmp , and you running Apache, LiteSpeed, MySQL Ö they are using /tmp to store temp files, session, and swap cache. If your partition is not RAID 10, you will get high load CPU on Web Server ( cause block data writing on HDD ).

First time, I use a Raid 10 Partition on /tmp , When I got over 500 connections of MySQL, I got high load CPU. And then I switch to tmpfs by command

mount -t tmpfs -o size=10G tmpfs /tmp

Set 10GB of memory to /tmp ( donít worry about 10GB, you only use maximum about 2GB hahhahaha )

I use tmpfs on /tmp, and my CPU load lower 60%

I think you should use tmpfs on /tmp ; /var/tmp

They will make your website run faster and save CPU load.

Forgot tell you about command ìdfî , type it on your shell. It show all HDD and tmpfs path.