Tmpfs to ramfs mount question (/run + /run/lock)

Hi!

I have successfully managed this 3 paths from tmpfs to ramfs

/tmp
/var/tmp
/var/log

I can't switch tmpfs to ramfs @ /run /run/lock.

I created 2 files:
/etc/systemd/system/run.mount

[Unit]
Description=run.mount

DefaultDependencies=no

Conflicts=umount.target
Before=local-fs.target umount.target

[Mount]
What=none
Where=/run
Type=ramfs
Options=rw,nosuid,nodev,noexec,noatime,nodiratime,mode=0755

[Install]
WantedBy=local-fs.target

Added to "/etc/fstab":

none /run ramfs rw,nosuid,nodev,noexec,noatime,nodiratime,mode=0755

/etc/systemd/system/run-lock.mount

[Unit]
Description=run-lock.mount

DefaultDependencies=no

Conflicts=umount.target
Before=local-fs.target umount.target

[Mount]
What=none
Where=/run/lock
Type=ramfs
Options=rw,nosuid,nodev,noexec,noatime,nodiratime

[Install]
WantedBy=local-fs.target

Added to "/etc/fstab":

none /run/lock ramfs rw,nosuid,nodev,noexec,noatime,nodiratime

After REBOOT, my system is working but:

cat /proc/mounts

tmpfs /run tmpfs rw,nosuid,nodev,noexec,noatime,nodiratime,size=1226396k,mode=755 0 0

tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,noatime,nodiratime,size=5120k 0 0

/run + /run/lock path won't switch
to ramfs.

Is there still an extra file to edit
so that I can change the directory "/run + /run/lock".
from tmpfs to ramfs?

First explain what you want to do ... (you don't like tmpfs and want to switch to ramfs?)

yes, I like ramfs, my swap file is completly disabled and it is working great and fast on my tweaked system.

I have successfully changed to ramfs about these directories/paths.

/var/log
/var/tmp
/tmp
(also edited files @ /usr/lib/tmpfiles.d)

I can't get the /run + /run/lock directory changed from tmpfs to ramfs.

There must be a config file in the systemd system which changes the entries to tmpfs to /run + /run/lock.

Possibly a service under
/lib/systemd/system which
the tmpfs settings to /run + /run/lock
regulates?

Something like the file which sets tmpfs mount to /tmp "/etc/system/system/tmp.mount".

I can't find a run.mount.

In my Ubuntu Mate system, I just don't know where to look. Can't find anything in my system.

As you can see after a REBOOT the directory /run + /run/lock remains on tmpfs (is not changed to ramfs)

cat /proc/mounts

tmpfs /run tmpfs rw,nosuid,nodev,noexec,noatime,nodiratime,size=1226396k,mode=755 0 0

tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,noatime,nodiratime,size=5120k 0 0

Edited: "/etc/fstab"

none /run ramfs rw,nosuid,nodev,noexec,noatime,nodiratime,mode=0755
none /run/lock ramfs rw,nosuid,nodev,noexec,noatime,nodiratime

As I mentioned before, after a REBOOT of my system, the /run + /run/lock directory does not change to ramfs even though I edited the fstab.

hmm :-/

just checked, something is preventing
/run/lock to ramfs, the question is only what in the system.

sudo systemctl status run-lock.mount
[sudo] password for user:
● run-lock.mount
Loaded: bad-setting (Reason: Unit run-lock.mount has a bad unit file setting.)
Active: inactive (dead)
Where: /run/lock
What: none

Okt 25 12:07:09 host systemd[1]: run-lock.mount: Cannot create mount unit for API file system /run/lock. Refusing.

Does anyone have an idea how I can fix this?

Unit run-lock.mount has a bad unit file setting

here's my config at "run-lock.mount' @ /etc/systemd/system/run-lock.mount

[Unit]
Description=run-lock.mount

DefaultDependencies=no

Conflicts=umount.target
Before=local-fs.target umount.target

[Mount]
What=none
Where=/run/lock
Type=ramfs
Options=rw,nosuid,nodev,noexec,noatime,nodiratime,inode64

[Install]
WantedBy=local-fs.target

Don't know what is wrong with my config at run-lock.mount.

Very strange:

sudo systemctl status run.mount run-lock.mount

● run.mount (ramfs)
     Loaded: bad-setting (Reason: Unit run.mount has a bad unit file setting.)
     Active: inactive (dead)
      Where: /run
       What: none

Okt 25 14:19:57 hostname systemd[1]: run.mount: Cannot create mount unit for API file system /run. Refusing.
● run-lock.mount (ramfs)
     Loaded: bad-setting (Reason: Unit run-lock.mount has a bad unit file setting.)
     Active: inactive (dead)
      Where: /run/lock
       What: none

Okt 25 14:19:57 hostname systemd[1]: run-lock.mount: Cannot create mount unit for API file system /run/lock. Refusing.

sudo systemctl status tmp.mount var-tmp.mount

● var-tmp.mount (ramfs)
     Loaded: loaded (/etc/systemd/system/tmp.mount; enabled-runtime; vendor preset: enabled)
     Active: active (mounted) since Mon 2021-10-25 13:43:03 UTC; 41min ago
      Where: /tmp
       What: none
      Tasks: 0 (limit: 14297)
     Memory: 4.0K
     CGroup: /system.slice/tmp.mount
● var-tmp.mount (ramfs)
     Loaded: loaded (/etc/systemd/system/var-tmp.mount; enabled-runtime; vendor preset: enabled)
     Active: active (mounted) since Mon 2021-10-25 13:43:03 UTC; 41min ago
      Where: /var/tmp
       What: none
      Tasks: 0 (limit: 14297)
     Memory: 4.0K
     CGroup: /system.slice/var-tmp.mount

cat /proc/mounts

tmpfs /run tmpfs rw,nosuid,nodev,noexec,noatime,nodiratime,size=1226400k,mode=755 0 0	(did not changed to 'ramfs'
tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,noatime,nodiratime,size=5120k 0 0	(did not changed to 'ramfs'

none /tmp ramfs rw,nosuid,nodev,noatime,nodiratime,mode=1777 0 0
none /var/tmp ramfs rw,nosuid,nodev,noatime,nodiratime,mode=1777 0 0
none /var/log ramfs rw,nosuid,nodev,noexec,noatime,nodiratime,mode=775 0 0
none /var/spool ramfs rw,nosuid,nodev,noexec,noatime,nodiratime 0 0