Skip to content

Instantly share code, notes, and snippets.

@sokil
Last active December 23, 2017 21:03
Show Gist options
  • Save sokil/7000c6e44952ab0494bced9b86a2dc35 to your computer and use it in GitHub Desktop.
Save sokil/7000c6e44952ab0494bced9b86a2dc35 to your computer and use it in GitHub Desktop.
RAM FS

Bash command

$ mount -t {TYPE} -o size={SIZE} {FSTYPE} {MOUNTPOINT}
Parameter Description
TYPE type of RAM disk to use; either tmpfs or ramfs.
SIZE size to use for the file system. Ramfs does not have a physical limit and is specified as a starting size.
FSTYPE type of RAM disk to use; either tmpfs, ramfs, ext4, etc.

Example:

$ mount -t tmpfs -o size=512m tmpfs /mnt/ramdisk

Fstab directive

tmpfs       /mnt/ramdisk tmpfs   nodev,nosuid,noexec,nodiratime,size=515M   0 0

Device list

$ sudo blkid
/dev/sda1: UUID="c5f3706e-980c-4dd3-b0d9-e60f83b9bbd4" TYPE="ext4" PARTUUID="00064a47-01"
/dev/sda5: UUID="2d62b993-19e5-52aa-fe87-f9bc0629be28" TYPE="swap" PARTUUID="00064a47-05"

ZRAM

sudo apt install zram-config # install

sudo systemctl start zram-config # start manually
sudo systemctl stop zram-config # stop manually
sudo systemctl disable zram-config # remove from autoload
sudo systemctl enable zram-config # add to autoload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment