$ 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
tmpfs /mnt/ramdisk tmpfs nodev,nosuid,noexec,nodiratime,size=515M 0 0
$ 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"
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