RSS

Diff. b/w RAMFS and TMPFS Mount

15 Aug

Diffent b/w RAMFS and TMPFS

Both can allocate part of the physical memory to be used as a partition. Once you mount the partition and start writing and reading files to the RAM, it should be faster.

1. How to mount Tmpfs

# mount -t tmpfs -o size=512M tmpfs /opt/zimbra/data/amavisd/tmp
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_email-LogVol01
18G 5.6G 12G 33% /
tmpfs 936M 72K 936M 1% /dev/shm
/dev/sda1 291M 49M 227M 18% /boot
tmpfs 512M 0 512M 0% /opt/zimbra/data/amavisd/tmp

2. How to mount Ramfs

# mount -t ramfs -o size=512M ramfs /opt/zimbra/data/amavisd/tmp
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_email-LogVol01
18G 5.6G 12G 33% /
tmpfs 936M 72K 936M 1% /dev/shm
/dev/sda1 291M 49M 227M 18% /boot
tmpfs 512M 0 512M 0% /opt/zimbra/data/amavisd/tmp

# mount
/dev/mapper/vg_email-LogVol01 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda1 on /boot type ext3 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
tmpfs on /opt/zimbra/data/amavisd/tmp type tmpfs (rw,size=512M)

3. Ramfs vs Tmpfs

Ramfs will grow dynamically / Tmpfs will not grow dynamically
Ramfs does not use swap / Tmpfs uses swap

4. Disadvandages

Since both ramfs and tmpfs is writing to the system RAM, it would get deleted once the system gets rebooted, or crashed. So it will not help in the time of system crash.

 
Leave a comment

Posted by on August 15, 2017 in Documents, Linux, Zimbra

 

Leave a comment