Project

General

Profile

Actions

Todo #12145

closed

Convert RAM disks to ``tmpfs``

Added by Jim Pingle over 2 years ago. Updated about 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Operating System
Target version:
Start date:
07/19/2021
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
22.01
Release Notes:
Default

Description

For various reasons we may want to switch the RAM disks from ufs on md devices to tmpfs .

Appears to be a simple source change:

diff --git a/src/etc/rc.ramdisk_functions.sh b/src/etc/rc.ramdisk_functions.sh
index 522b7f2b1e..0ec9894f70 100755
--- a/src/etc/rc.ramdisk_functions.sh
+++ b/src/etc/rc.ramdisk_functions.sh
@@ -101,7 +101,7 @@ ramdisk_try_mount () {
     NAME=$1
     if [ ramdisk_check_size ]; then
         SIZE=$(eval echo \${${NAME}size})m
-        /sbin/mdmfs -S -M -s ${SIZE} md /${NAME}
+        /sbin/mount -o rw,size=${SIZE},mode=1777 -t tmpfs tmpfs /${NAME}
         return $?
     else
         return 1;
diff --git a/src/usr/local/www/includes/functions.inc.php b/src/usr/local/www/includes/functions.inc.php
index c25ccebaca..3edeeade3b 100644
--- a/src/usr/local/www/includes/functions.inc.php
+++ b/src/usr/local/www/includes/functions.inc.php
@@ -158,7 +158,7 @@ function get_temp() {
 function get_mounted_filesystems() {
     $mout = "";
     $filesystems = array();
-    exec("/bin/df -Tht ufs,zfs,cd9660 | /usr/bin/awk '{print $1, $2, $3, $6, $7;}'", $mout);
+    exec("/bin/df -Tht ufs,zfs,tmpfs,cd9660 | /usr/bin/awk '{print $1, $2, $3, $6, $7;}'", $mout);

     /* Get rid of the header */
     array_shift($mout);

Naturally that could be deceptively oversimplifying it. Needs lots of testing.

Feel free to kick ahead as needed.

Actions

Also available in: Atom PDF