Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

use TMPFS for /var or /var/log

Featured Replies

Continued from prior post.

 

2. BUG: Allowing the possibility of a runaway syslog to completly use up all RAM and crash the server.

Such train wrecks can be so easily prevented by mounting  /var/log/  into its own limited-size ramdisk.

I've actually done this on my custom bzroot build by adding this single line to  /etc/fstab

none  /var/log  tmpfs  size=128m  0  0

That ramdisk doesn't set apart any RAM.  It will only start using up RAM when stuff starts filing it up, up to the set limit.

 

That's a really good idea & I will incorporate in the next release.

 

I think this is worthy of it;s own feature request so that it's clearer.

This has been suggested a few times over the past couple years, but might have been lost.

I did the same thing for some directories to prevent crashes.

 

The beauty of tmpfs is it "can" be swapped out if needed.

If a size is not given, it will assume half of all memory but will not use the memory until requested.

If push comes to shove, that tmpfs "can" be swapped out without ill effect on kernel memory.

 

I suppose it might be wiser to use busybox's switchroot command to move the whole root to a tmpfs, but that may involve more testing.

 

In the past I used switch_root so that I could use tmpfs and finally a unionfs on root.

 

In the meantime something in the go script may work too.

 

In the meantime something in the go script may work too.

That how I first did it a few months ago, but that's not very elegant. 

That's why I modified my bzroot to add the line I mentioned above.

It's been working rock-solid.  Can't crash it even if you try.  :) 

 

I tried this a long time ago, and IIRC, I ran into an issue regarding the difference between an initrd versus initramfs.... that the latter had problems with root switching.

  • Author

I tried this a long time ago, and IIRC, I ran into an issue regarding the difference between an initrd versus initramfs.... that the latter had problems with root switching.

 

I had problems with root switching too.

Thereis pivot_root and switch_root. I did get switch_root working.

I did have to modify it a bit. I know it worked because I had unionfs and aufs working at one point.

I had a custom filesystem from the boot flash unioned with /

 

In any case, this post is in regards to tmpfs for /var or /var/log.

I prefer /var so that people can use programs which need to write/read /var without interfering with the root filesystem.  I had prior issues with getting exim working without creating a tmpfs.

In the meantime something in the go script may work too.

That how I first did it a few months ago, but that's not very elegant. 

That's why I modified my bzroot to add the line I mentioned above.

It's been working rock-solid.  Can't crash it even if you try.   :) 

 

Did you also modify /etc/logrotate.d/syslog?  Or did you leave it as is?  

 

I like your solution a LOT, and, apparently, so does Tom @ lime-tech.

 

 

  • Author
Can't crash it even if you try.   :) 

Oh I can get it to crash easy without filling up the log.

My unraid use to crash all the time just from running updatedb or a massive rsync.

I had to change the default vfs_cache_pressure. After setting it to 200 it has been stable.

Did you also modify /etc/logrotate.d/syslog?  Or did you leave it as is?

No, I didn't touch anything else.  Although I think it may now be good to increase the filesize setting for the rotation.

 

Can't crash it even if you try.   :) 

Oh I can get it to crash easy without filling up the log.

LOL!  True!  ;D 

 

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.