0

I use Ubuntu 18.04 on an embedded system. By default it has tmpfs mounted on /dev/shm with 3.8G (~half RAM size) and some mount options.

I'm trying to change the /dev/shm size and mount options via the /etc/fstab. If I remount it, it works until next reboot, getting default values afterwards.

  1. I read that systemd can be used to configure this filesystem but they still recommend using the fstab file: Systemd backed tmpfs | How to specify /tmp size manually

  2. I read that some people changed the /etc/fstab entry from /dev/shm to /run/shm, but after doing so I had both filesystems mounted, not linked to each other: https://answers.launchpad.net/ubuntu/+question/232487

  3. I read that on redhat distributions , the /dev/shm is being mounted via boot from rc scripts but grep -r '/dev/shm' /etc/rc*/* returned nothing useful.

So how can I assure the /dev/shm mount options in /etc/fstab will take effect after reboot?

Z0OM
  • 3,149
hutcruchi
  • 329
  • Does your embedded system have systemd-remount-fs.service? – u1686_grawity May 23 '23 at 06:00
  • I tried "systemctl mask dev-shm.mount" and "systemctl mask run-shm.mount" but still the changes in /etc/fstab regarding /dev/shm didn't apply (tried to reboot the system) – hutcruchi May 23 '23 at 06:17

1 Answers1

1

Originally I performed the following actions:

  1. Created some new partitions with ext4 filesystems.
  2. Mounted these new filesystems (on /var , /var/log , /home , and more..) and added suitable entries in /etc/fstab.
  3. Added new entries for tmpfs on /tmp and /dev/shm in /etc/fstab

When I perform step 3 before the others I get the desired results - the /dev/shm mount options remained changed even after reboot.

I don't know the exact reason but maybe the precedence of the /dev/shm entry upon the others in /etc/fstab has something to do with that.

hutcruchi
  • 329