ubuntu:disk:ramdisk:create_a_ramdisk
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ubuntu:disk:ramdisk:create_a_ramdisk [2021/06/22 10:46] – created peter | ubuntu:disk:ramdisk:create_a_ramdisk [2021/06/22 13:36] (current) – peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Ubuntu - Disk - Ramdisk - Create a Ramdisk ====== | ====== Ubuntu - Disk - Ramdisk - Create a Ramdisk ====== | ||
+ | |||
+ | ===== Create a Ramdisk ===== | ||
+ | |||
+ | <code bash> | ||
+ | mkdir / | ||
+ | mount -t tmpfs -o rw, | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * **-t tmpfs**: | ||
+ | * tmpfs only uses memory when you it contains files. | ||
+ | * When it is empty, it will take almost no space in RAM. | ||
+ | |||
+ | * An alternative to **tmpfs** is to use **ramfs**. | ||
+ | * tmpfs can use swap as well, whereas ramfs devices are memory only. | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Verify the Ramdisk ===== | ||
+ | |||
+ | Verify that the RAMDISK has been created. | ||
+ | |||
+ | <code bash> | ||
+ | df -h | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Mount the Ramdisk automatically on system boot ===== | ||
+ | |||
+ | Edit /etc/fstab, and add the following line to the the end of the file. | ||
+ | |||
+ | <file bash / | ||
+ | tmpfs / | ||
+ | </ | ||
+ | |||
+ | ---- | ||
ubuntu/disk/ramdisk/create_a_ramdisk.1624358788.txt.gz · Last modified: 2021/06/22 10:46 by peter